Skip to content

luckyyyroyyy/Skill-Swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”„ SkillSwap Pro

A modern, gamified skill-sharing platform where users exchange knowledge and grow together.

Features β€’ Tech Stack β€’ Setup β€’ Structure β€’ API β€’ Contributing


Features ✨

πŸ” Authentication & Security

  • Secure registration & login with Werkzeug password hashing
  • Password reset via email β€” styled HTML emails sent through Gmail SMTP
  • CSRF protection on all forms (Flask-WTF)
  • Rate limiting on sensitive endpoints (Flask-Limiter)
  • Secure session cookies with HTTPOnly & SameSite flags
  • Input validation with WTForms & email-validator
  • SQL injection prevention via SQLAlchemy ORM

🎯 Smart Skill Matching

  • Fuzzy matching algorithm β€” finds users even with partial skill name matches
  • Weighted scoring system:
    • 🧩 Mutual skill compatibility (25 pts per match)
    • ⭐ User reputation & rating (10 pts per rating point)
    • πŸ“ˆ Experience level / XP (scaled)
    • 🌍 Timezone bonus (+10 pts for same timezone)
  • Filter matches by skill category
  • Skill proficiency levels: Beginner β†’ Intermediate β†’ Expert

πŸ’¬ Real-Time Chat

  • WebSocket-powered messaging via Flask-SocketIO
  • Per-swap chat rooms with message history
  • Unread message counter in navigation
  • Read/unread message tracking

πŸ† Gamification System

  • XP Points:
    • +10 XP β€” Adding a skill
    • +50 XP β€” Completing a swap
    • +50 XP β€” Receiving a review
  • Level Progression: Beginner 🌱 β†’ Skilled πŸš€ β†’ Expert πŸ”₯ β†’ Master πŸ‘‘
  • Achievement Badges:
    Badge Requirement
    🀝 First Swap Complete 1 swap
    ⭐ Rising Star Earn 200 XP
    πŸ… Skill Master Earn 500 XP
    πŸ§‘β€πŸ« Trusted Mentor Receive 5+ reviews

πŸ“‹ Core Platform

  • Skill Marketplace β€” Browse users offering/wanting skills across 8 categories
  • Swap Requests β€” Send, accept, reject, and complete skill exchanges
  • Smart Scheduling β€” Set your weekly availability and propose swap times converted automatically to the viewer's timezone
  • Review System β€” Rate (1-5 stars) and comment after completed swaps
  • User Profiles β€” Customizable bio, social links (GitHub, LinkedIn, Portfolio)
  • Portfolio Showcase β€” Add project highlights with descriptions and images to your profile
  • Interactive Avatar Cropper β€” Crop and precisely adjust your profile picture before upload (2MB limit)
  • Notifications & Feedback β€” Real-time alerts for requests and elegant toast notifications for actions
  • Dashboard β€” Paginated view of matched users with compatibility scores

Tech Stack πŸ› οΈ

Layer Technology
Backend Flask 3.1.2, Flask-Login, Flask-SQLAlchemy, Flask-Migrate
Real-Time Flask-SocketIO, python-socketio, python-engineio
Database SQLite (dev) / PostgreSQL (production-ready)
Email Flask-Mail with Gmail SMTP
Frontend HTML5, CSS3, JavaScript, Jinja2 Templates
Auth Flask-Login + Werkzeug password hashing
Forms Flask-WTF, WTForms, email-validator
Security CSRF Protection, Rate Limiting, Secure Sessions
Migrations Flask-Migrate (Alembic)
Environment python-dotenv

Database Models πŸ—„οΈ

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     User     │────▢│    Skill     β”‚     β”‚    Badge     β”‚
│──────────────│     │──────────────│     │──────────────│
β”‚ id           β”‚     β”‚ id           β”‚     β”‚ id           β”‚
β”‚ username     β”‚     β”‚ name         β”‚     β”‚ name         β”‚
β”‚ email        β”‚     β”‚ category     β”‚     β”‚ description  β”‚
β”‚ password     β”‚     β”‚ type         β”‚     β”‚ icon         β”‚
β”‚ bio / socialsβ”‚     β”‚ proficiency  β”‚     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ xp / badge   β”‚     β”‚ user_id (FK) β”‚            β”‚
β”‚ profile_pic  β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
β”‚ rating       β”‚                          β”‚  UserBadge   β”‚
β”‚ timezone     │◀─────────────────────────│──────────────│
β”‚ created_at   β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚ user_id (FK) β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚ SwapRequest  β”‚     β”‚ badge_id(FK) β”‚
       β”‚             │──────────────│     β”‚ earned_at    β”‚
       β”‚             β”‚ sender_id    β”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Άβ”‚ receiver_id  β”‚
       β”‚             β”‚ status       β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚             β”‚ proposed_timeβ”‚     β”‚ ChatMessage  β”‚
       β”‚             β”‚ completed_at │────▢│──────────────│
       β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚ swap_id (FK) β”‚
       β”‚                                  β”‚ sender_id    β”‚
       β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚ message      β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Άβ”‚   Review     β”‚     β”‚ is_read      β”‚
       β”‚             │──────────────│     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚             β”‚ reviewer_id  β”‚
       β”‚             β”‚ reviewed_id  β”‚     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚             β”‚ rating       β”‚     β”‚ Notification β”‚
       β”‚             β”‚ comment      β”‚     │──────────────│
       β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚ user_id (FK) β”‚
       β”‚                                  β”‚ message      β”‚
       β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚ is_read      β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Άβ”‚ PortfolioProjβ”‚     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚             │──────────────│
       β”‚             β”‚ title / desc β”‚
       β”‚             β”‚ project_url  β”‚
       β”‚             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”‚             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       └────────────▢│ Availability β”‚
                     │──────────────│
                     β”‚ day_of_week  β”‚
                     β”‚ start / end  β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Setup & Installation πŸš€

Prerequisites

  • Python 3.9+
  • pip (Python package manager)
  • Gmail account with App Password (for password reset emails)

Installation Steps

  1. Clone the repository

    git clone https://github.com/luckyyyroyyy/Skill-Swap.git
    cd Skills-Swap
  2. Create & activate virtual environment

    python -m venv venv
    
    # Windows
    venv\Scripts\activate
    
    # macOS/Linux
    source venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    cp .env.example .env

    Edit .env with your settings:

    SECRET_KEY=your-secret-key-here
    FLASK_ENV=development
    DATABASE_URL=sqlite:///skillswap.db
    UPLOAD_FOLDER=static/profile_pics
    
    # Gmail SMTP (for password reset emails)
    MAIL_SERVER=smtp.gmail.com
    MAIL_PORT=587
    MAIL_USE_TLS=True
    MAIL_USERNAME=your-email@gmail.com
    MAIL_PASSWORD=your-16-char-app-password
    MAIL_DEFAULT_SENDER=your-email@gmail.com
  5. Initialize the database

    python -m flask db upgrade

    Or manually:

    python -c "from app import app, db; app.app_context().push(); db.create_all()"
  6. Run the application

    python app.py

    The app will be available at http://localhost:5000 πŸŽ‰


Project Structure πŸ“

Skills-Swap/
β”œβ”€β”€ app.py                  # Flask app, SocketIO events, context processors
β”œβ”€β”€ config.py               # Config classes (Dev / Prod / Test)
β”œβ”€β”€ extensions.py           # Flask extensions (DB, Login, Limiter, Mail, SocketIO)
β”œβ”€β”€ models.py               # SQLAlchemy models (User, Skill, Swap, Review, etc.)
β”œβ”€β”€ forms.py                # WTForms (Registration, Login, Skills, Reviews, Reset)
β”œβ”€β”€ utils.py                # XP, rating, matching, badge & notification systems
β”œβ”€β”€ seed.py                 # Database seeding script
β”œβ”€β”€ test_app.py             # Unit tests
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ .env.example            # Environment template
β”œβ”€β”€ .gitignore              # Git ignore rules
β”‚
β”œβ”€β”€ routes/                 # Blueprint modules
β”‚   β”œβ”€β”€ __init__.py         # Blueprint exports
β”‚   β”œβ”€β”€ main.py             # Landing page
β”‚   β”œβ”€β”€ auth.py             # Register, login, logout, password reset
β”‚   β”œβ”€β”€ user.py             # Profile, dashboard, skills management
β”‚   β”œβ”€β”€ swap.py             # Swap requests, reviews, matching
β”‚   └── chat.py             # Real-time messaging
β”‚
β”œβ”€β”€ templates/              # Jinja2 HTML templates
β”‚   β”œβ”€β”€ base.html           # Base layout with nav & scripts
β”‚   β”œβ”€β”€ landing.html        # Public landing page
β”‚   β”œβ”€β”€ register.html       # Registration form
β”‚   β”œβ”€β”€ login.html          # Login form
β”‚   β”œβ”€β”€ reset_password_request.html  # Forgot password
β”‚   β”œβ”€β”€ reset_password.html # Password reset form
β”‚   β”œβ”€β”€ dashboard.html      # Main dashboard with matches
β”‚   β”œβ”€β”€ profile.html        # User profile view
β”‚   β”œβ”€β”€ edit_profile.html   # Profile editor with avatar upload
β”‚   β”œβ”€β”€ my_swaps.html       # Swap request management
β”‚   β”œβ”€β”€ matches.html        # Skill matching results
β”‚   β”œβ”€β”€ chat.html           # Real-time chat interface
β”‚   └── notifications.html  # Notification center
β”‚
β”œβ”€β”€ static/                 # Static assets
β”‚   β”œβ”€β”€ css/                # Stylesheets
β”‚   β”œβ”€β”€ js/                 # JavaScript files
β”‚   β”œβ”€β”€ img/                # Images & icons
β”‚   └── profile_pics/       # User uploaded avatars
β”‚
β”œβ”€β”€ migrations/             # Flask-Migrate / Alembic
β”‚   β”œβ”€β”€ versions/           # Migration scripts
β”‚   β”œβ”€β”€ env.py              # Migration environment
β”‚   └── alembic.ini         # Alembic configuration
β”‚
└── instance/               # Instance-specific files
    └── skillswap.db        # SQLite database

API Routes πŸ“‘

πŸ”“ Authentication

Method Endpoint Description
GET/POST /register User registration
GET/POST /login User login
GET /logout Logout (auth required)
GET/POST /reset_password_request Request password reset email
GET/POST /reset_password/<token> Reset password with token

πŸ‘€ User & Profile

Method Endpoint Description
GET /dashboard Dashboard with matched users
GET/POST /profile/<username> View user profile
GET/POST /edit_profile Edit profile (bio, avatar, timezone)
POST /add_skill Add a new skill

πŸ”„ Swaps & Reviews

Method Endpoint Description
POST /send_swap/<user_id> Send swap request
GET/POST /my-swaps View all swap requests
GET /accept/<swap_id> Accept a swap
GET /reject/<swap_id> Reject a swap
GET /complete/<swap_id> Mark swap as completed
POST /submit_review/<user_id> Submit review for user

πŸ’¬ Chat & Notifications

Method Endpoint Description
GET/POST /chat/<swap_id> Chat for a specific swap
GET /notifications View all notifications

πŸ”Œ WebSocket Events

Event Direction Description
join_room Client β†’ Server Join a chat room
send_message Client β†’ Server Send a chat message
receive_message Server β†’ Client Receive a chat message
new_notification Server β†’ Client Real-time notification push

Environment Variables πŸ”

Variable Default Description
SECRET_KEY dev-secret-key... Flask secret key (change in production!)
FLASK_ENV development development / production / testing
DATABASE_URL sqlite:///skillswap.db Database connection string
UPLOAD_FOLDER static/profile_pics Profile picture upload path
DEBUG True Enable debug mode
MAIL_SERVER smtp.gmail.com SMTP server address
MAIL_PORT 587 SMTP port (587 for TLS)
MAIL_USE_TLS True Enable TLS encryption
MAIL_USERNAME β€” Gmail address
MAIL_PASSWORD β€” Gmail App Password (16-char)
MAIL_DEFAULT_SENDER β€” Default "From" email address

Testing πŸ§ͺ

pip install pytest
pytest test_app.py -v

Tests cover:

  • βœ… User model operations
  • βœ… Skill management (CRUD)
  • βœ… Swap request lifecycle
  • βœ… Matching algorithm accuracy
  • βœ… Badge award system
  • βœ… Notification creation
  • βœ… Review system

Production Deployment 🌐

  1. Set production environment variables β€” Use a strong SECRET_KEY, set FLASK_ENV=production, DEBUG=False
  2. Switch to PostgreSQL β€” Update DATABASE_URL connection string
  3. Apply migrations β€” flask db upgrade
  4. Use a production WSGI server:
    gunicorn --worker-class eventlet -w 1 --bind 0.0.0.0:8000 app:app
  5. Enable HTTPS with SSL/TLS certificates
  6. Setup monitoring (Sentry, Datadog, etc.)

Contributing 🀝

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Changelog πŸ“œ

v1.2.0 (Stable Release)

  • βœ… End-to-end quality assurance (QA) validation complete
  • βœ… Verified real-time WebSocket interactions & DOM updates
  • βœ… New Feature: Weekly Availability Scheduling with timezone-aware logic
  • βœ… New Feature: Portfolio Projects and Social Links on User Profiles
  • βœ… UI/UX Polish: Interactive Avatar Cropper, UI Pagination, and stylish Toast Notifications
  • βœ… Production-ready deployment optimizations
  • βœ… Database records cleaned and reset for fresh deployment
  • βœ… Temporary logs and cache files cleaned

v1.1.0

  • βœ… Password reset via Gmail SMTP with styled HTML emails
  • βœ… Flask-Migrate database migrations
  • βœ… Timezone-aware matching with timezone bonus
  • βœ… Skill proficiency levels (Beginner / Intermediate / Expert)
  • βœ… Fuzzy skill name matching
  • βœ… Improved error handling & user feedback

v1.0.0

  • βœ… Core platform with auth, skills, swaps, chat
  • βœ… Gamification (XP, badges, levels)
  • βœ… Security hardening (CSRF, rate limiting, secure sessions)
  • βœ… Unit tests & logging

License πŸ“„

This project is licensed under the MIT License β€” see the LICENSE file for details.


Support πŸ’¬

For issues, suggestions, or questions:


Made with ❀️ for skill-sharing
Β© 2026 SkillSwap Pro β€” Swap skills, grow together.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors