A web-based platform for skill trading where users can exchange knowledge and abilities without monetary transactions. Built with PHP, MySQL, and Tailwind CSS.
SkillSwap is designed to facilitate peer-to-peer skill exchanges in a community-driven environment. Users create profiles listing skills they can teach and skills they want to learn. The platform's intelligent matching engine identifies potential swap partners based on complementary skills, ensuring mutually beneficial exchanges.
The application emphasizes simplicity, security, and user trust through features like secure authentication, real-time messaging, and a rating system. It's built as a semester project, focusing on core functionalities without complex features like real-time chat or admin analytics.
- Skills: Predefined list of skills (e.g., Cooking, Programming, Guitar) that users can offer or request.
- Matching: Direct matching where User A offers Skill X and wants Skill Y, and User B offers Skill Y and wants Skill X.
- Swaps: Structured requests with statuses (pending, accepted, declined, completed).
- Messaging: Thread-based chat for each swap to coordinate exchanges.
- Ratings: Post-swap feedback to maintain quality and trust.
- User Authentication: Secure login and registration system with password hashing.
- Profile Management: Users can create and edit profiles, including bio, location, and skill preferences (offered and wanted).
- Skill Matching: Intelligent matching engine that finds direct swap partners based on complementary skills.
- Swap Requests: Send and manage swap proposals with status tracking (pending, accepted, declined, completed).
- Messaging: WhatsApp-style chat interface for communicating during swaps, with real-time polling.
- Ratings & Reviews: Post-swap rating system to build trust and track user reputation.
- Backend: PHP 8.0+ with PDO for secure database interactions.
- Database: MySQL for data storage, with normalized schema for users, skills, swaps, messages, and ratings.
- Frontend: HTML5, Tailwind CSS for responsive, dark-themed UI, and vanilla JavaScript for dynamic interactions (e.g., message polling).
- Server: Designed for Apache/Nginx with PHP support (tested on XAMPP).
- Security: Session-based authentication, input sanitization, and SQL injection prevention via prepared statements.
The matching engine uses a SQL query to find users where:
- The current user offers a skill that another user wants.
- The other user offers a skill that the current user wants.
- The other user does not offer any skills that the current user offers (to avoid same-skill matches).
- No existing swap requests exist between them.
This ensures direct, complementary matches.
- Registration/Login: New users register with name, email, password. Existing users log in.
- Profile Setup: Edit profile to add bio, location, and select offered/wanted skills from a predefined list.
- Find Matches: Visit the Match page to see potential swap partners.
- Send Request: Click to send a swap request specifying offered and wanted skills.
- Respond: Receive notifications; accept or decline requests.
- Communicate: Use the chat thread to discuss details.
- Complete Swap: Mark swap as done and rate the partner.
The schema includes tables for users, skills, user_skills (junction with type: offered/wanted), swap_requests, threads, messages, and ratings. Foreign keys ensure data integrity.
Follow these steps to set up the SkillSwap project on your local machine:
-
Clone or Download the Repository:
git clone <repository-url>
Place the project folder (e.g.,
skillswap) inside your local web server's root directory (such ashtdocsfor XAMPP, orwwwfor WAMP/MAMP). -
Start your Local Web Server: Ensure you have a local PHP web server installed (like XAMPP, WAMP, or MAMP). Start both the Apache and MySQL services.
-
Set up the Database:
- Open your database administration tool (such as phpMyAdmin, typically at
http://localhost/phpmyadmin). - Create a new database (e.g.,
skillswap). - Import the provided SQL script located at
database/skillswap.sqlto set up the necessary tables and structure.
- Open your database administration tool (such as phpMyAdmin, typically at
-
Update Configuration:
- Locate and open the
config/db.phpfile in your code editor. - Update the database credentials (username, password, and database name) to match your local MySQL configuration. For example, if using standard XAMPP, the username might be
rootwith an empty password. - Similarly, update
config/constants.phpif you need to set a specific base URL.
- Locate and open the
-
Access the Application: Open a web browser and navigate to the project directory:
http://localhost/skillswap/
- Landing Page: Overview of the platform; redirects logged-in users to match page.
- Profile Pages: View your own or others' profiles; edit your own.
- Match Page: Lists potential matches; click to send requests.
- Swaps Dashboard: View all your sent/received requests; respond or complete.
- Messages: Access chat threads for active swaps.
- Ratings: Rate partners after completing swaps.