← All projects
Full-Stack · MERN

Hospital Management System (MERN)

Three roles, real appointment conflicts, and a schema that holds up when the examiner pokes it.

The most-attempted project in Indian colleges, built the way it should be. Separate portals for patients, doctors, and admin; JWT auth with role guards on every route; appointment booking that actually detects slot collisions instead of overwriting them; and prescriptions and billing tied to real MongoDB relations. The marks in this project are in the schema design and the auth flow, so that is where the sessions spend their time.

Suits
BCA ·MCA ·B.Tech ·B.Sc IT
Level
Intermediate
Live sessions
7
Seats per college
2 / year

What it does

  • Three role-based portals — patient, doctor, admin — behind one login
  • Appointment booking with real slot-conflict detection per doctor
  • Doctors write prescriptions against a visit; patients see their history
  • Auto-generated bills with printable invoices
  • Admin dashboard: doctor onboarding, department management, daily load
  • Search and filter across patients, doctors, and appointments

What the sessions cover

  1. 01Schema design — how the six collections relate, and why not one big document
  2. 02Auth: hashing, JWT issue and verify, and role-guarded middleware
  3. 03The appointment engine — slot generation and conflict detection logic
  4. 04Express route structure, controllers, and centralised error handling
  5. 05React app structure: routing, protected routes, and shared state
  6. 06Prescriptions and billing — the write path end to end
  7. 07Deployment on a free tier, plus mock viva on schema and auth

Stack

ReactNode.jsExpressMongoDBMongooseJWTTailwind CSS

How it works

One login serves three roles. The JWT carries the role, React routes render the patient, doctor or admin portal, and Express middleware enforces the same role checks on every API route, so the UI hiding a button is never the only protection.

A doctor's availability is stored as weekly working hours split into fixed slots. Booking checks the slot against existing appointments for that doctor; a unique compound index on doctor and slot start time means the database itself rejects a second booking for the same slot, even if two patients press confirm together.

After a visit, the doctor writes a prescription linked to that appointment. Completing the visit generates a bill from the consultation fee and any listed services, which the patient can view and print as an invoice. The admin dashboard aggregates appointments per department and per day.

The data

Users (with a role), doctors (department, fee, weekly schedule), patients (basic medical profile), appointments (doctor, patient, slot start, status), prescriptions (medicines with dose and duration, linked to an appointment) and bills. Mongoose schemas validate required fields and enums such as appointment status at the model layer.

The hard parts examiners ask about

Double booking

Checking for a clash and then inserting leaves a gap where two requests both pass the check. A unique index on doctor and slot makes the second insert fail, and the API turns that error into a slot-taken message.

Who can see what

A patient must see only their own records and a doctor only their own patients. Every query is filtered by the logged-in user's id on the server, never by an id sent from the browser.

Time zones

Slots are stored in UTC and displayed in IST, so a server running in another region does not shift every appointment by five and a half hours.

Viva questions on this project

How do you prevent two patients booking the same slot?
A unique compound index on doctor id and slot start time. The database rejects the second insert atomically, which a check-then-insert in application code cannot guarantee.
Why enforce roles on the server if the UI already hides pages?
Anyone can call the API directly with a tool like Postman. Middleware that checks the role from the verified JWT is the real protection; hiding pages is only convenience.
How is a prescription linked to the patient?
Through the appointment. The prescription references the appointment, which references both doctor and patient, so a patient's history is every prescription on their completed appointments.
Why MongoDB for hospital data?
The records are naturally document-shaped, such as a prescription with a list of medicines. For heavy cross-record reporting or strict transactions across many tables, a relational database would be a reasonable alternative, and that trade-off is worth stating.
How are passwords stored?
Hashed with bcrypt and a per-password salt. The plain password is never stored, and login compares the hash.

Pick what you need

Direct UPI / bank transfer in monthly installments. Sessions start after the first installment; handover is after the final installment. Full terms — including what happens if you stop midway.

Source

₹4,500

single payment

  • Full source code
  • Local setup guide
  • Sample dataset / seed data
  • One handover call
Enquire about Source

Academic

₹8,500

or ₹4,300/month × 2

  • Everything in Source
  • Project report (synopsis + full document)
  • Presentation deck
  • ER / DFD / architecture diagrams
  • Deployment walkthrough
Enquire about Academic

Mentored

Most picked

₹15,000

or ₹5,000/month × 3

  • Everything in Academic
  • 7 live sessions on Google Meet
  • Line-by-line code walkthrough
  • Viva question prep + mock viva
  • One module varied for you (dataset / domain)
  • WhatsApp support until submission
Enquire about Mentored
Opening 3 seats

This page has no reviews on it yet. Be the reason it does.

The first 3 students get 40% off in exchange for an honest review and permission to show your finished project here. Same build, same sessions, same handover — the discount is the price of going first, and it is not coming back once those seats are gone.

Claim a seat on WhatsApp

Two things I hold myself to

  • Only 2 students from your college get this project in an academic year. On the Mentored tier one module is varied for you — the dataset, the domain, or a feature — so no two submissions read the same.
  • You build nothing. You just have to be able to explain it. The project is delivered finished — code, report, diagrams, deployed. Then daily 60-minute sessions on Google Meet after 8:00 PM IST, walking the code you are submitting, ending in a mock viva. Turn up and you will know it well enough to answer anything the panel asks.

Enquire about this project

Tell me your submission deadline and which tier fits. You get a session schedule and an installment split back — usually within a day.