Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SkillSwap Platform

A modern React-based platform for skill exchange where users can offer their expertise in exchange for learning new skills from others.

Features

πŸ”₯ Current Features

  • Firebase Authentication - Secure user registration and login
  • Real-time Database - Firebase Realtime Database for storing skill swaps
  • Skill Management - Create, browse, and search skill exchange offers
  • Advanced Filtering - Filter by category, skill level, location, and virtual availability
  • Responsive Design - Works seamlessly across desktop, tablet, and mobile
  • Real-time Updates - Live updates when new skill swaps are created
  • User Profiles - Integrated with Firebase Auth for user management

🚧 Upcoming Features

  • Communication System - Direct messaging between users βœ… (Completed)
  • Rating & Reviews - User feedback and reputation system
  • Advanced Matching - AI-powered skill recommendations βœ… (AI Chatbot Added)
  • Calendar Integration - Schedule skill exchange sessions
  • Video Calling - Built-in video chat for virtual sessions βœ… (Completed)

Tech Stack

  • Frontend: React 19 + TypeScript + Vite
  • Styling: Tailwind CSS + Custom Design System
  • Authentication: MongoDB + JWT
  • Database: MongoDB + Mongoose
  • Backend: Node.js + Express
  • Real-time: Socket.IO
  • AI Assistant: OpenAI GPT-4o-mini
  • Routing: React Router DOM
  • Animations: Framer Motion
  • Icons: Lucide React

Firebase Setup

1. Create Firebase Project

  1. Go to Firebase Console
  2. Create a new project
  3. Enable Authentication and Realtime Database

2. Configure Authentication

  1. In Firebase Console, go to Authentication > Sign-in method
  2. Enable Email/Password sign-in method

3. Set Database Rules

Go to Realtime Database > Rules and set:

{
  "rules": {
    "skillSwaps": {
      ".read": true,
      ".write": "auth != null",
      "$swapId": {
        ".write": "auth != null && (auth.uid == data.child('userId').val() || !data.exists())"
      }
    },
    "users": {
      "$userId": {
        ".read": "auth != null && auth.uid == $userId",
        ".write": "auth != null && auth.uid == $userId"
      }
    }
  }
}

4. Get Firebase Configuration

  1. Go to Project Settings > General
  2. Scroll down to "Your apps" and add a web app
  3. Copy the Firebase config object

Installation & Setup

1. Clone the repository

git clone https://github.com/VinitaPatil2005/SkillsSwapPlatform.git
cd SkillsSwapPlatform

2. Install dependencies

npm install firebase

3. Configure environment variables

# Copy the example file
cp .env.example .env

# Edit .env with your configuration

Edit .env file with your credentials:

# MongoDB Backend
VITE_API_BASE=http://localhost:4000

# OpenAI API Key (for AI Chatbot)
VITE_OPENAI_API_KEY=your-openai-api-key-here

Get your OpenAI API Key:

  1. Go to OpenAI Platform
  2. Sign up or log in
  3. Navigate to API Keys
  4. Create a new secret key
  5. Copy and paste it into your .env file

4. Start the MongoDB backend server

cd server
npm install
npm start

The server will run on http://localhost:4000

5. Start the frontend development server

# In the root directory
npm run dev

Project Structure

src/
β”œβ”€β”€ components/           # Reusable UI components
β”‚   β”œβ”€β”€ ui/              # Base UI components (Button, etc.)
β”‚   β”œβ”€β”€ Header.tsx       # Navigation header with auth
β”‚   β”œβ”€β”€ SkillCard.tsx    # Skill swap display card
β”‚   └── ProtectedRoute.tsx # Route protection component
β”œβ”€β”€ contexts/            # React contexts
β”‚   └── AuthContext.tsx  # Authentication state management
β”œβ”€β”€ services/            # Firebase services
β”‚   β”œβ”€β”€ authService.ts   # Authentication methods
β”‚   └── skillSwapService.ts # Database operations
β”œβ”€β”€ pages/               # Route components
β”‚   β”œβ”€β”€ HomePage.tsx     # Landing page
β”‚   β”œβ”€β”€ FindSkillPage.tsx # Browse skills
β”‚   β”œβ”€β”€ OfferSkillPage.tsx # Create skill swap
β”‚   β”œβ”€β”€ LoginPage.tsx    # User login
β”‚   └── SignUpPage.tsx   # User registration
β”œβ”€β”€ config/              # Configuration files
β”‚   └── firebase.ts      # Firebase initialization
└── layouts/             # Layout components
    └── MainLayout.tsx   # Main app layout

Data Structure

User Object

interface AuthUser {
  uid: string;
  email: string | null;
  displayName: string | null;
  photoURL: string | null;
}

Skill Swap Object

interface SkillSwap {
  id?: string;
  userId: string;
  user: {
    name: string;
    email: string;
    avatarUrl?: string;
  };
  skillOffered: string;
  skillSought: string;
  description?: string;
  category?: string;
  level?: 'beginner' | 'intermediate' | 'advanced';
  location?: string;
  isVirtual?: boolean;
  tags?: string[];
  createdAt: number;
  updatedAt: number;
  isActive: boolean;
}

Features Guide

Authentication

  • Users can register with email/password
  • Secure login with Firebase Auth
  • Password reset functionality
  • Protected routes for authenticated users

Skill Management

  • Create detailed skill swap offers
  • Include categories, skill levels, and tags
  • Virtual or in-person session options
  • Real-time preview while creating

Discovery

  • Advanced search with multiple filters
  • Real-time updates when new swaps are added
  • Category and skill level filtering
  • Virtual session filtering

User Experience

  • Responsive design for all devices
  • Smooth animations and transitions
  • Loading states and error handling
  • Intuitive navigation and user flow

πŸš€ Deployment

This platform is ready to deploy to production! We support deployment to Vercel (frontend) and Render (backend).

Quick Deploy

  1. Run pre-deployment checks:

    .\pre-deploy-check.ps1
  2. Follow the guides:

Deployment Architecture

Frontend (Vercel)          Backend (Render)         Database (MongoDB Atlas)
   React App    ←→    Express API + Socket.IO  ←→    Cloud Database

Required Services

  • Vercel - Frontend hosting (Free tier available)
  • Render - Backend hosting (Free tier available)
  • MongoDB Atlas - Database (Free tier available)
  • OpenAI - Chatbot API (Pay-per-use)

Environment Variables

See .env.production.example and server/.env.example for required configuration.


Contributing

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please:

  1. Check the Issues page
  2. Create a new issue if your problem isn't already reported
  3. Provide detailed information about your environment and the issue

About

A platform for skill exchange and collaborative learning built with TypeScript

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages