Special Hospital: a hospital management system
Appointments, staff and patient records for an Ayurvedic clinic group, with a booking engine that cannot double-book.

01The problem
An Ayurvedic clinic group needed appointments, staff and patient records in one place, without two patients ever landing in the same slot.
02What it had to do
- One system for appointments, staff and patient records across clinics.
- A slot can never be booked twice, even when two requests arrive at the same moment.
- Every role sees only its own dashboard and data.
- Clinic owners see live operational metrics.
03What I built
Booking, patient records and five role-specific dashboards with real-time metrics for clinic owners.
04Architecture
- FrontendReact 19 + TypeScriptRole-aware routing with route guards per dashboard.
- APINode.js + Express 5REST API with JWT authentication and authorisation middleware.
- DataMongoDBBooking documents with TTL holds; 8+ aggregation pipelines for metrics.
05Engineering decisions
01Double-booking engine
- Challenge
- Two people can ask for the same slot at the same instant. A "check, then save" flow lets both through.
- Decision
- Booking runs as an atomic three-phase optimistic-locking flow in MongoDB, with TTL holds on slots.
- Why
- Correct under concurrency without a global lock, and a hold that is abandoned expires on its own.
02Five isolated dashboards
- Challenge
- Different staff roles must never see each other’s data or actions.
- Decision
- Five role dashboards secured with JWT sessions, server middleware and client route guards.
- Why
- Access is enforced on the server for every request; hiding a button is never the security.
03Metrics in the database
- Challenge
- Owners need live numbers without exporting spreadsheets.
- Decision
- Designed 8+ MongoDB aggregation pipelines that compute the metrics where the data lives.
- Why
- One query per metric instead of shipping raw records to the browser.
06Security
- JWT sessions
- Authorisation middleware on every API route
- Route guards per role in the UI
07Outcome
- Five isolated role dashboards
- 8+ aggregation pipelines for real-time metrics
- Double booking prevented at the database level
- Live demo on Vercel