A production-style REST API for appointment and slot booking built with Node.js, Express.js, PostgreSQL, and Prisma.
| URL | |
|---|---|
| API | https://book-my-slot-peach.vercel.app |
| Swagger Docs | https://book-my-slot-peach.vercel.app/api-docs |
| Health Check | https://book-my-slot-peach.vercel.app/health |
BookMySlot is a backend appointment booking platform that allows businesses to manage appointments while enabling customers to book available time slots.
The project demonstrates production-level backend engineering concepts including:
- RESTful API Design
- Authentication & Authorization
- PostgreSQL Database Design
- Prisma ORM
- Transaction Management
- Clean Architecture
- Unit & Integration Testing
- API Documentation using Swagger
This project is designed to be domain-independent and can be used by:
- Doctors
- Dentists
- Salons
- Fitness Trainers
- Lawyers
- Consultants
- Tutors
- Wellness Centers
- Physiotherapists
- Register
- Login
- Search Providers
- Search Clinics
- View Available Slots
- Book Appointment
- Cancel Booking
- View Booking History
- Register Business
- Manage Clinics
- Configure Working Hours
- Generate Appointment Slots
- Review Booking Requests
- Confirm Bookings
- Reject Bookings
- Block Dates
- Manage Users
- Manage Providers
- View System Bookings
- Suspend Accounts
| Category | Technology |
|---|---|
| Backend | Node.js |
| Framework | Express.js |
| Database | PostgreSQL (Neon) |
| ORM | Prisma |
| Authentication | JWT + bcrypt |
| Testing | Jest + Supertest |
| API Documentation | Swagger (OpenAPI) |
| Deployment | Vercel |
| Version Control | Git & GitHub |
| API Testing | Postman |
Client
│
▼
Express Routes
│
▼
Controllers
│
▼
Services
│
▼
Repositories
│
▼
Prisma ORM
│
▼
PostgreSQL (Neon)
bookmyslot/
│
├── prisma/
│ ├── migrations/
│ └── schema.prisma
│
├── src/
│ ├── config/
│ ├── controllers/
│ ├── middleware/
│ ├── repositories/
│ ├── routes/
│ ├── services/
│ ├── utils/
│ ├── validators/
│ ├── app.js
│ └── server.js
│
├── tests/
│
└── README.md
The system consists of the following core entities:
- Users
- Providers
- Businesses
- Clinics
- Provider Availability
- Slots
- Bookings
- Booking Status History
- Refresh Tokens
Customer
│
▼
Select Slot
│
▼
Booking Created
│
▼
PENDING_CONFIRMATION
│
▼
Provider Reviews Request
├──────────────┐
▼ ▼
CONFIRMED REJECTED
│ │
▼ ▼
Slot Reserved Slot Released
Each appointment slot has configurable capacity.
Example:
| Time | Total | Pending | Confirmed | Available |
|---|---|---|---|---|
| 10-11 | 5 | 2 | 1 | 2 |
| 11-12 | 5 | 0 | 4 | 1 |
| 12-1 | 5 | 5 | 0 | 0 |
Available Capacity is calculated as:
Available =
Total Capacity
− Pending Confirmations
− Confirmed Bookings
Customers can only book slots where:
Available Capacity > 0
- Authentication
- Providers
- Clinics
- Slots
- Bookings
- Admin
- JWT Authentication
- Password Hashing using bcrypt
- Input Validation
- SQL Injection Protection (Prisma)
- Rate Limiting
- Protected Routes
- PostgreSQL Transactions
- Atomic Booking Operations
- Rollback on Failure
- Prevents Double Booking
The project includes:
- Unit Tests
- Integration Tests
- API Tests
Tools:
- Jest
- Supertest
Swagger documentation is available after running the application.
http://localhost:3000/api-docs
git clone https://github.com/Anjali394/BookMySlot.git
cd BookMySlotnpm installCreate a .env file based on .env.example:
PORT=3000
DATABASE_URL=postgresql://user:password@host/dbname?sslmode=require
JWT_SECRET=your_super_secret_key_here
JWT_EXPIRES_IN=1d
JWT_REFRESH_SECRET=your_refresh_secret_here
JWT_REFRESH_EXPIRES_IN=7d
NODE_ENV=developmentnpx prisma generatenpx prisma migrate devnpm run seedThis creates the default admin account needed to access /api/v1/admin routes.
npm run devnpm testor
npm run testBackend:
- Vercel
Database:
- Neon PostgreSQL
Future Full Stack Deployment:
- Railway
The following features are intentionally out of scope for Version 1.
- React Frontend
- Docker
- Redis Caching
- Payment Gateway
- Email Notifications
- SMS Notifications
- Google Calendar Integration
- Appointment Reminders
- Analytics Dashboard
- CI/CD Pipeline
- Multi-language Support
This repository contains:
- Software Requirement Specification (SRS)
- Swagger Documentation (live at
/api-docs) - README
This project demonstrates practical backend engineering skills including:
- Clean Architecture
- REST API Development
- Authentication & Authorization
- Database Design
- Prisma ORM
- PostgreSQL Transactions
- Repository Pattern
- Error Handling
- Testing
- Deployment
Current Version: v1.0
Under active development.
Anjali Rajput
Backend Developer
This project is licensed under the MIT License.