Skip to content

khokan/skill-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ SkillBridge – Full Stack Tutoring Platform

SkillBridge is a modern, role-based tutoring marketplace that connects students with verified tutors. Built with a modular backend and a responsive Next.js frontend, it provides seamless booking, availability management, reviews, and admin controls.


✨ Key Features

πŸ‘¨β€πŸŽ“ For Students

  • Browse and filter tutors by specialty and rating
  • Book tutoring sessions with available slots
  • Leave reviews and ratings after completed sessions
  • Track all bookings and history
  • Manage profile and preferences

πŸ‘¨β€πŸ« For Tutors

  • Create and manage professional profiles
  • Set hourly rates and availability slots
  • Accept and complete bookings
  • View student reviews and ratings
  • Track earnings and booking history

πŸ›‘οΈ For Admins

  • Manage users and roles
  • Monitor all bookings and transactions
  • Create and manage course categories
  • View analytics and platform stats
  • Moderation tools

πŸ€– AI-Powered Features

  • RAG-based tutor recommendations
  • Embeddings for semantic search
  • Intelligent query responses
  • Real-time tutor matching

🧱 Tech Stack

Backend

  • Node.js + Express.js
  • TypeScript
  • Prisma ORM
  • PostgreSQL (Neon DB)
  • Better Auth (Session-based)
  • OpenRouter API (LLM for RAG)

Frontend

  • Next.js 16 (App Router)
  • TypeScript
  • shadcn/ui (Component library)
  • Tailwind CSS
  • Server Actions
  • Sonner (Toast notifications)
  • React Hook Form + Zod (Validation)

Infrastructure

  • Vercel (Frontend & Backend deployment)
  • PostgreSQL (Neon) (Database)
  • Git (Version control)

πŸ—‚οΈ Project Structure

skill-bridge/
β”œβ”€β”€ backend/                    # Express API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ modules/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/          # Authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ users/         # User management
β”‚   β”‚   β”‚   β”œβ”€β”€ tutors/        # Tutor listings
β”‚   β”‚   β”‚   β”œβ”€β”€ tutor-profile/ # Tutor profiles
β”‚   β”‚   β”‚   β”œβ”€β”€ bookings/      # Booking logic
β”‚   β”‚   β”‚   β”œβ”€β”€ reviews/       # Reviews & ratings
β”‚   β”‚   β”‚   β”œβ”€β”€ categories/    # Course categories
β”‚   β”‚   β”‚   β”œβ”€β”€ admin/         # Admin operations
β”‚   β”‚   β”‚   └── rag/           # RAG (AI Search)
β”‚   β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.ts        # Role guards
β”‚   β”‚   β”‚   └── errorHandler.ts
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   β”œβ”€β”€ prisma.ts
β”‚   β”‚   β”‚   └── auth.ts
β”‚   β”‚   β”œβ”€β”€ app.ts
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   └── schema.prisma      # Database schema
β”‚   β”œβ”€β”€ package.json
β”‚   └── vercel.json
β”‚
β”œβ”€β”€ frontend/                   # Next.js App
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ (commonLayout)/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx       # Landing
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ login/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ register/
β”‚   β”‚   β”‚   β”‚   └── tutors/
β”‚   β”‚   β”‚   β”œβ”€β”€ (dashboardLayout)/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/     # Student dashboard
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ tutor/         # Tutor dashboard
β”‚   β”‚   β”‚   β”‚   └── admin/         # Admin dashboard
β”‚   β”‚   β”‚   └── api/
β”‚   β”‚   β”‚       └── rag/          # Proxy endpoints
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ modules/          # Feature components
β”‚   β”‚   β”‚   β”œβ”€β”€ shared/           # Reusable components
β”‚   β”‚   β”‚   └── ui/               # shadcn components
β”‚   β”‚   β”œβ”€β”€ services/             # API service layer
β”‚   β”‚   β”œβ”€β”€ actions/              # Server actions
β”‚   β”‚   β”œβ”€β”€ hooks/                # Custom hooks
β”‚   β”‚   └── constants/            # App constants
β”‚   β”œβ”€β”€ package.json
β”‚   └── next.config.ts
β”‚
β”œβ”€β”€ README.md                   # This file
└── .gitignore

πŸ” Authentication & Authorization

Auth System

  • Provider: Better Auth (Session-based)
  • Storage: HTTP-only cookies
  • Strategy: JWT tokens with session persistence

User Roles

Role Access Level Default Route
STUDENT Public + Student features /dashboard
TUTOR Public + Tutor features /tutor/dashboard
ADMIN All features /admin

Protected Routes

Backend uses middleware to guard routes:

router.get("/me", auth(UserRole.TUTOR), Controller.getMine);

Frontend uses proxy.ts for role-based redirects.


πŸ“‘ API Routes Overview

πŸ”“ Public Endpoints

GET    /api/tutors              # List all tutors
GET    /api/tutors/:id          # Tutor profile
GET    /api/categories          # All categories
POST   /api/auth/sign-up        # Register
POST   /api/auth/sign-in        # Login

πŸ‘¨β€πŸŽ“ Student Private Routes

GET    /api/bookings            # My bookings
POST   /api/bookings            # Create booking
PATCH  /api/bookings/:id/cancel # Cancel booking
POST   /api/reviews             # Leave review
GET    /api/users/me            # My profile
PATCH  /api/users/me            # Update profile

πŸ‘¨β€πŸ« Tutor Private Routes

GET    /api/tutor/profile/me    # My profile
POST   /api/tutor/profile       # Create profile
PATCH  /api/tutor/profile       # Update profile
GET    /api/tutor/availability  # My slots
PUT    /api/tutor/availability  # Set availability
GET    /api/tutor/bookings      # My bookings
PATCH  /api/bookings/:id/complete
GET    /api/tutor/reviews       # My reviews

πŸ›‘οΈ Admin Private Routes

GET    /api/admin/stats         # Dashboard stats
GET    /api/admin/users         # Manage users
GET    /api/admin/bookings      # All bookings
GET    /api/admin/categories    # Categories
POST   /api/admin/categories    # Create category
PATCH  /api/admin/categories/:id

πŸ€– RAG AI Endpoints

POST   /api/rag/query           # AI tutor search
POST   /api/rag/index           # Index profiles
GET    /api/rag/stats           # RAG stats

πŸ” Core Business Workflows

Booking Lifecycle

1. Student browses tutors
2. Student selects available slot
3. Booking created β†’ CONFIRMED
4. Tutor completes session
5. Booking β†’ COMPLETED
6. Student leaves review

Review System

  • Reviews only allowed on COMPLETED bookings
  • One review per booking
  • Auto-calculates tutor avgRating and reviewCount

Availability Management

  • Tutors set time slots (startTime, endTime)
  • Students book from available slots
  • System prevents double-booking

πŸ“Š Database Schema Overview

Key Models

Model Purpose
User Authentication & profile
TutorProfile Tutor information
AvailabilitySlot Time slots
Booking Session reservations
Review Ratings & feedback
Category Subject categories
DocumentEmbedding RAG vectors

Relations

  • User β†’ TutorProfile (1:1)
  • User β†’ Booking (1:many)
  • TutorProfile β†’ AvailabilitySlot (1:many)
  • TutorProfile β†’ Review (1:many)
  • Category β†’ TutorCategory (many:many)

πŸš€ Setup & Installation

Prerequisites

  • Node.js 18+
  • pnpm (or npm)
  • PostgreSQL (Neon)
  • Git

Clone Repository

git clone https://github.com/khokan/skill-bridge.git
cd skill-bridge

Backend Setup

cd backend

# Install dependencies
pnpm install

# Set up environment variables
cp .env.example .env
# Edit .env with your credentials:
# DATABASE_URL=postgres://...
# BETTER_AUTH_SECRET=your_secret
# OPENROUTER_API_KEY=your_key

# Run migrations
pnpm prisma migrate dev

# Start development server
pnpm dev
# Backend runs on https://skillbridge-be.vercel.app/

Frontend Setup

cd frontend

# Install dependencies
pnpm install


# Start development server
pnpm dev
# Frontend runs on http://localhost:3000

πŸ§ͺ Running Locally

Start Backend

cd backend
pnpm dev

Start Frontend (in another terminal)

cd frontend
pnpm dev

Access the App


πŸ“¦ Building for Production

Build Backend

cd backend
pnpm build

Build Frontend

cd frontend
pnpm build
pnpm start

🌐 Deployment

Deploy to Vercel

Backend

cd backend
vercel --prod

Frontend

cd frontend
vercel --prod

Environment Variables (Vercel)

Backend Project:

DATABASE_URL=postgres://...
BETTER_AUTH_SECRET=...
OPENROUTER_API_KEY=...
APP_URL=https://skillbridge-be.vercel.app
FRONTEND_URL=https://skillbridge-fe.vercel.app

Frontend Project:

NEXT_PUBLIC_API_URL=https://skillbridge-be.vercel.app/api

πŸ€– RAG (Retrieval-Augmented Generation)

How It Works

  1. Tutor profiles are indexed with embeddings
  2. Queries are converted to vectors
  3. Semantic search finds relevant profiles
  4. LLM generates recommendations

API Usage

POST /api/rag/query
Content-Type: application/json

{
  "query": "Math tutor for calculus",
  "limit": 5
}

Response:

{
  "answer": {
    "recommendations": [
      {
        "name": "John Doe",
        "reason": "Expert in Calculus",
        "matchedCategories": ["Math"],
        "strengths": ["Patient", "Clear explanations"]
      }
    ],
    "summary": "Found 2 highly-rated calculus tutors"
  },
  "sources": [...],
  "contextUsed": true
}

🎨 UI/UX Highlights

Design System

  • Built on shadcn/ui components
  • Tailwind CSS for styling
  • Responsive across all devices
  • Dark mode compatible

Key Components

  • Booking modal with calendar
  • Availability slot picker
  • Review dialog
  • Admin dashboards
  • Tutor profile cards
  • Loading animations
  • Toast notifications

Loading Animation

Premium animated loading screen with rotating rings and pulsing effects.


πŸ› Error Handling

Backend

  • Global error handler middleware
  • Consistent JSON error responses
  • Prisma transaction rollback
  • Detailed console logging

Frontend

  • Server Action error boundaries
  • Toast notifications for user feedback
  • Fallback error pages
  • Network error handling

πŸ“‹ Environment Variables

Backend (.env)

PORT=5000
DATABASE_URL=postgresql://user:password@host/database
BETTER_AUTH_SECRET=your-secret-key
BETTER_AUTH_URL=http://localhost:5000
APP_URL=http://localhost:3000
OPENROUTER_API_KEY=sk-or-v1-...
OPENROUTER_LLM_MODEL=nvidia/nemotron-3-super-120b-a12b:free
OPENROUTER_EMBEDDING_MODEL=nvidia/llama-nemotron-embed-vl-1b-v2:free
NODE_ENV=development

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:5000/api

πŸ“š Additional Resources

Documentation


🀝 Contributing

  1. Create a feature branch: git checkout -b feature/your-feature
  2. Commit changes: git commit -m 'Add feature'
  3. Push to branch: git push origin feature/your-feature
  4. Open a Pull Request

πŸ“ License

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


🎯 Roadmap & Future Improvements

Planned Features

  • βœ… Real-time messaging between tutor & student
  • βœ… Payment gateway integration (Stripe)
  • βœ… Video conferencing integration
  • βœ… Advanced analytics & reporting
  • βœ… Notification system (email, SMS)
  • βœ… Tutor verification system
  • βœ… Performance optimizations
  • βœ… Mobile app (React Native)

Known Issues

  • CORS configuration on Vercel (resolved with proxy)
  • Rate limiting on OpenRouter API

πŸ’¬ Support & Contact

For questions or issues, please:

  1. Check existing GitHub issues
  2. Create a new issue with detailed description
  3. Contact: [your-email@example.com]

Built with ❀️ by the SkillBridge Team

Last Updated: May 3, 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors