Prescripto is a high-performance, production-ready doctor appointment booking platform refactored from a monolithic MERN stack into a Scalable Microservices Architecture. This project demonstrates advanced system design principles, including service decoupling, asynchronous processing, and high-availability caching.
βββββββββββββββββββββββ
β Client App β
β React + Vite UI β
ββββββββββββ¬βββββββββββ
β
β HTTP API
βΌ
ββββββββββββββββββββββββββ
β API Gateway β
β Express Router β
ββββββββββββ¬ββββββββββββββ
β
βββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββββ ββββββββββββββββββ
β Auth Service β β Booking Service β β Payment Service β
β β β β β β
β JWT Auth β β Appointment β β Razorpay β
β Login/Registerβ β Scheduling β β Integration β
β Role Control β β Availability β β Transactions β
βββββββββ¬ββββββββ ββββββββββ¬βββββββββ ββββββββββ¬ββββββββ
β β β
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββ
β Redis Cache β
β Doctor Profiles & Availability β
βββββββββββββββββ¬ββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β MongoDB β
β Appointments β
β Users/Doctors β
βββββββββββββββββββ
β
β Event Queue
βΌ
βββββββββββββββββββββββββββ
β BullMQ Queue β
β Background Job System β
βββββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Notification Worker β
β Email / Reminder Jobs β
βββββββββββββββββββββββββββ
### Infrastructure Layer
```text
ββββββββββββββββββββββββββββ
β Docker Compose β
β Container Orchestration β
βββββββββββββ¬βββββββββββββββ
β
ββββββββββββββββ¬βββββββββββββββ¬βββββββββββββββ
βΌ βΌ βΌ βΌ
Auth Service Booking Service Payment Notification
Container Container Service Worker
Container Container
ββββββββββββββββ¬βββββββββββββββ
βΌ βΌ
MongoDB Redis
Container Container
βββββββββββββββββββββββββββ
β Winston Logs β
β Centralized Logging β
βββββββββββββ¬ββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Sentry β
β Error Tracking System β
βββββββββββββββββββββββββββ
βββββββββββββββββββββββββββ
β k6 β
β Load Testing Framework β
β Simulates 100+ users β
βββββββββββββββ¬ββββββββββββ
β
βΌ
Booking API
The system is split into independent microservices to ensure fault isolation and independent scaling:
- Services communicate via REST and high-performance message queues.
- Independent deployment pipelines for each service.
- Implemented Redis caching to store doctor profiles and availability.
- Reduced database read latency by 60% for frequently accessed medical professionals.
- Automatic cache invalidation on availability updates.
- Booking confirmations and reminders are offloaded to background workers.
- Ensures the booking API remains highly responsive by avoiding blocking I/O operations.
- Mongoose Transactions: Guaranteed atomicity for booking operations to prevent double-booking.
- Indexing: Optimized MongoDB queries with indexes on
userIdanddocId.
- Dockerized: Entire stack orchestrated with
docker-composefor local and production parity. - Rate Limiting: Protected sensitive APIs against brute-force and abuse.
- Observability: Centralized logging with Winston and real-time error tracking with Sentry.
- Frontend: React.js, Vite, Tailwind CSS
- Backend: Node.js, Express.js (Microservices)
- Database: MongoDB (Mongoose ODM)
- Caching: Redis
- Message Queue: BullMQ
- Payment: Razorpay
- DevOps: Docker, Docker Compose
- Monitoring: Winston, Sentry, k6 (Load Testing)
- Docker & Docker Compose
- Node.js (v18+)
git clone https://github.com/saumya1317/prescripton.git
cd prescripton/backendCreate a .env in backend/ with your credentials:
MONGODB_URI=mongodb://mongodb:27017/prescripto
JWT_SECRET=your_secret
RAZORPAY_KEY_ID=your_id
RAZORPAY_KEY_SECRET=your_secret
REDIS_URL=redis://redis:6379docker-compose up --buildThis will start MongoDB, Redis, and all microservices.
I have implemented k6 load testing scripts to verify system stability under high concurrency.
k6 run tests/load/load_test.jsThe system comfortably handles 100+ concurrent users with sub-500ms response times thanks to Redis caching.
backend/
βββ services/
β βββ auth/ # Authentication Microservice
β βββ booking/ # Doctor & Appointment Logic (Redis)
β βββ payment/ # Payment Processing (Razorpay)
β βββ notification/ # Background Worker (BullMQ)
βββ shared/ # Common Middlewares & Utils
βββ tests/ # Load Testing (k6)
βββ docker-compose.yml # System Orchestration
Saumya - GitHub
This project was built to demonstrate best practices in scalable backend architecture and cloud-native development.