Loading repository data…
Loading repository data…
CodeByRachit / repository
Skill Swap Platform: A full-stack web application for connecting individuals to exchange skills. Features include user authentication, comprehensive profiles, swap request management, a feedback system, and an admin panel. Built with Flask (Python) and React (HTML/CSS/JS) with a SQLite database
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A full-stack web application enabling users to connect, offer, and request skills from each other. It includes user authentication, profile management, a swap request system, and an admin panel for platform management.
The request page is not working properly
The Skill Swap Platform is designed to foster a community where individuals can exchange knowledge and skills. Users can create profiles, list skills they can offer, and skills they wish to learn. They can browse other users' profiles, send swap requests, and provide feedback on completed swaps. An administrative interface allows for user management, monitoring swap requests, and platform-wide announcements.
werkzeug.security: For password hashinguuid: For generating unique IDsFlask-CORS: For handling Cross-Origin Resource SharingFollow these steps to get the Skill Swap Platform up and running on your local machine.
Clone the repository (or save app.py):
If you have the files locally, ensure app.py is in your project directory.
Create a Python virtual environment (recommended):
python -m venv venv
Activate the virtual environment:
source venv/bin/activate
.\venv\Scripts\activate
Install backend dependencies:
pip install Flask Flask-Cors Werkzeug
Database Initialization:
The init_db() function in app.py will automatically create the skill_swap.db SQLite database and its tables when the Flask app is run for the first time. It will also create the default admin user.
Create uploads directory:
Ensure there's an uploads directory in the same location as app.py for profile pictures. The backend code will attempt to create it if it doesn't exist.
The frontend (index.html) uses CDN links for React, ReactDOM, Babel, Tailwind CSS, Three.js, and Font Awesome. This means no separate npm install or build step is strictly required for the frontend to run.
Place index.html:
Ensure index.html is in a directory named html_templates in the same location as app.py. The Flask app is configured to serve static files from this folder.
your_project_root/
├── app.py
├── uploads/
└── html_templates/
└── index.html
Start the Backend (Flask server):
Open your terminal, navigate to your project root directory (where app.py is located), activate your virtual environment, and run:
python app.py
The server will typically run on http://127.0.0.1:5000. You should see output indicating the server is running.
Access the Frontend:
Open your web browser and navigate to http://127.0.0.1:5000/.
The application should load, and you will be presented with the login/signup page.
A default admin user is automatically created when the app.py is run for the first time (if the database doesn't already contain a user with this name).
Admin UserAdminpassYou can log in with these credentials to access the Admin Panel.
The backend provides the following API endpoints:
Authentication:
POST /api/auth/signup
{ "name": "string", "password": "string", "location": "string", "skillsOffered": ["string"], "skillsWanted": ["string"], "availability": ["string"], "isPublic": boolean }POST /api/auth/login
{ "name": "string", "password": "string" }User Profiles:
GET /api/profile/<user_id>
PUT /api/profile/<user_id>
multipart/form-data including fields like name, location, bio, skillsOffered, skillsWanted, availability, isPublic, theme, profilePhoto (file) or profilePhotoUrl (string).GET /api/users
searchTerm (optional)Swap Requests:
POST /api/swap_requests
{ "senderId": "string", "senderName": "string", "receiverId": "string", "receiverName": "string", "skillOffered": "string", "skillWanted": "string" }GET /api/swap_requests/<user_id>
PUT /api/swap_requests/<request_id>
{ "status": "string" } (e.g., "accepted", "rejected", "completed")DELETE /api/swap_requests/<request_id>
Feedback:
POST /api/feedback
{ "swapRequestId": "string", "giverId": "string", "receiverId": "string", "rating": integer (1-5), "comment": "string" }GET /api/feedback
Admin Endpoints:
GET /api/admin/users
PUT /api/admin/users/<user_id>/ban
{ "isBanned": integer (0 or 1) }GET /api/admin/platform_message
POST /api/admin/platform_message
{ "message": "string" }GET /api/admin/swap_requests
The skill_swap.db SQLite database contains the following tables:
users:
id (TEXT, PRIMARY KEY)name (TEXT, NOT NULL, UNIQUE)password_hash (TEXT, NOT NULL)location (TEXT)skills_offered (TEXT) - comma-separated stringskills_wanted (TEXT) - comma-separated stringavailability (TEXT) - comma-separated stringis_public (INTEGER) - 1 for public, 0 for privateis_admin (INTEGER) - 1 for admin, 0 for regular useris_banned (INTEGER) - 1 for banned, 0 for activeprofile_photo (TEXT) - URL or path to photobio (TEXT)theme (TEXT)average_rating (REAL)rating_count (INTEGER)created_at (TIMESTAMP)swap_requests:
id (TEXT, PRIMARY KEY)sender_id (TEXT, NOT NULL, FOREIGN KEY to users.id)sender_name (TEXT, NOT NULL)receiver_id (TEXT, NOT NULL, FOREIGN KEY to users.id)receiver_name (TEXT, NOT NULL)skill_offered (TEXT, NOT NULL)skill_wanted (TEXT, NOT NULL)status (TEXT) - 'pending', 'accepted', 'rejected', 'completed'created_at (TIMESTAMP)feedback:
id (TEXT, PRIMARY KEY)swap_request_id (TEXT, NOT NULL, FOREIGN KEY to swap_requests.id)giver_id (TEXT, NOT NULL, FOREIGN KEY to users.id)receiver_id (TEXT, NOT NULL, FOREIGN KEY to users.id)rating (INTEGER, NOT NULL) - 1 to 5comment (TEXT)created_at (TIMESTAMP)platform_messages:
id (INTEGER, PRIMARY KEY AUTOINCREMENT)message (TEXT, NOT NULL)created_at (TIMESTAMP)