Connect with Expert Tutors, Learn Anything
This is the backend server for the SkillBridge platform — a full-stack tutoring system that connects students with expert tutors.
Built with Node.js, Express, TypeScript, Prisma, PostgreSQL, and Better Auth.
Md. Nazmul Hossen
--
SkillBridge is a role-based tutoring platform where:
- 👨🎓 Students can browse tutors, book sessions, and leave reviews.
- 👨🏫 Tutors can create profiles, set availability, and manage bookings.
- 🛡️ Admins can manage users, categories, and monitor bookings.
This repository contains only the Backend REST API Server.
- Node.js
- Express v5
- TypeScript
- PostgreSQL
- Prisma ORM
- Better Auth
- Zod (Validation)
- CORS
- dotenv
src/
├── modules/
│ ├── admin/
│ ├── student/
│ ├── tutor/
│ ├── public/
│ ├── categories/
│ └── subjects/
│
├── middlewares/
│ └── authMiddleware.ts
│
├── prisma/
│
└── server.ts
Authentication is handled using Better Auth.
Role-based access:
- STUDENT
- TUTOR
- ADMIN
Protected routes use:
authMiddleware("ROLE");Create a .env file in the root directory:
FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:5000
DATABASE_URL=your_postgresql_connection_string
PORT=5000
BETTER_AUTH_URL=http://localhost:5000
BETTER_AUTH_SECRET=your_secret_key
CALLBACK_URL=http://localhost:5000
NODE_ENV=development
Database: PostgreSQL
ORM: Prisma
Main Tables:
- Users
- TutorProfiles
- Categories
- Subjects
- Bookings
- Reviews
- Availabilities
- TimeSlots
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Get all tutors |
| GET | /features |
Get featured tutors |
| GET | /tutor/:id |
Get tutor details |
| Method | Endpoint | Description |
|---|---|---|
| GET | /student/me |
Get student profile |
| POST | /student/bookings/:id |
Create booking |
| PATCH | /student/bookings/cancel/:id |
Cancel booking |
| POST | /student/bookings/review/:id |
Create review |
| Method | Endpoint | Description |
|---|---|---|
| GET | /tutor/me |
Get tutor profile |
| POST | /tutor |
Create tutor profile |
| PATCH | /tutor/update/hourly_rate |
Update hourly rate |
| POST | /tutor/subjects |
Add subject |
| DELETE | /tutor/subjects/:subjectId |
Remove subject |
| POST | /tutor/education |
Add education |
| PATCH | /tutor/education/:id |
Update education |
| DELETE | /tutor/education/:id |
Delete education |
| POST | /tutor/availabilities |
Add availability |
| PATCH | /tutor/availabilities/:id |
Update availability |
| DELETE | /tutor/availabilities/:id |
Delete availability |
| POST | /tutor/time-slot |
Create time slot |
| PATCH | /tutor/time-slot/:id |
Update time slot |
| DELETE | /tutor/time-slot/:id |
Delete time slot |
| PATCH | /tutor/bookings/confirm/:id |
Confirm booking |
| PATCH | /tutor/bookings/cancel/:id |
Cancel booking |
| PATCH | /tutor/bookings/complete/:id |
Complete booking |
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/users |
Get all users |
| GET | /admin/bookings |
Get all bookings |
| PATCH | /admin/users/:id |
Update user status |
| PATCH | /admin/tutors/:id/featured |
Feature tutor |
| Method | Endpoint | Description |
|---|---|---|
| GET | /categories |
Get all categories |
| POST | /categories |
Create category (Admin) |
| PATCH | /categories/:id |
Update category |
| DELETE | /categories/:id |
Delete category |
| Method | Endpoint | Description |
|---|---|---|
| GET | /subjects |
Get all subjects |
| POST | /subjects/:id |
Add subject |
| PATCH | /subjects/:id |
Update subject |
| DELETE | /subjects/:id |
Delete subject |
Booking status values:
- CONFIRMED (default after booking)
- COMPLETED (marked by tutor)
- CANCELLED (cancelled by student)
Flow:
- Student creates booking → CONFIRMED
- Tutor completes session → COMPLETED
- Student cancels → CANCELLED
git clone <your-repository-url>
cd level-2-a4-backend
npm install
Create .env file (see above).
npx prisma migrate dev
npm run dev
Server will run at:
http://localhost:5000
npm run build
- Role-based authorization
- Protected routes
- Zod input validation
- Environment variable configuration
- Secure PostgreSQL connection
ISC License