# meniraj07/prescripto-hospital_management_system architecture

> Architecture diagram of the GitHub repository meniraj07/prescripto-hospital_management_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/meniraj07/prescripto-hospital_management_system
- Repository: https://github.com/meniraj07/prescripto-hospital_management_system

## Overview

Prescripto is a hospital-management application with separate patient and admin/doctor panels backed by an Express API. Patients discover doctors, manage profiles, book and manage appointments, and pay; staff administer doctors and appointments, while doctors manage their schedules and profiles. The graph includes the documented patient-record and messaging capabilities, but their detailed implementation is not shown in the sampled source. Edges are limited to relationships visible in excerpts, the SOURCE INDEX, or the README.

Main entry points: [`admin/src/App.jsx`](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/App.jsx) (Staff panel), [`frontend/src/App.jsx`](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/App.jsx) (Patient web app), [`backend/controllers/userController.js`](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/userController.js) (User workflows), [`frontend/src/context/AppContext.jsx`](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/context/AppContext.jsx) (Patient app state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient panel"]
  node_patient_app["Patient web app<br/>[App.jsx]"]
  node_patient_context["Patient app state<br/>[AppContext.jsx]"]
  node_doctor_discovery["Doctor discovery<br/>[Doctors.jsx]"]
  node_booking["Appointment booking<br/>[Appointment.jsx]"]
  node_my_appointments["My appointments<br/>[MyAppointments.jsx]"]
  node_profile["Patient profile<br/>[MyProfile.jsx]"]
  node_patient_records["Patient records<br/>[userModel.js]"]
  node_messaging["Doctor-patient messaging"]
end

subgraph group_staff["Admin and doctor panels"]
  node_staff_app["Staff panel<br/>[App.jsx]"]
  node_admin_state["Admin state<br/>[AdminContext.jsx]"]
  node_doctor_state["Doctor state<br/>[DoctorContext.jsx]"]
  node_doctor_management["Doctor management<br/>[AddDoctor.jsx]"]
  node_admin_appointments["Appointment oversight"]
  node_admin_dashboard["Admin analytics<br/>[Dashboard.jsx]"]
  node_doctor_appointments["Doctor appointments"]
  node_doctor_profile["Doctor profile<br/>[DoctorProfile.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["API server<br/>[server.js]"]
  node_user_routes["User routes<br/>[userRoute.js]"]
  node_doctor_routes["Doctor routes<br/>[doctorRoute.js]"]
  node_admin_routes["Admin routes<br/>[adminRoute.js]"]
  node_user_controller["User workflows<br/>[userController.js]"]
  node_doctor_controller["Doctor workflows"]
  node_admin_controller["Admin workflows<br/>[adminController.js]"]
end

subgraph group_data["Persistence and integrations"]
  node_mongo[("MongoDB<br/>[mongodb.js]")]
  node_user_model["User records<br/>[userModel.js]"]
  node_doctor_model["Doctor records<br/>[doctorModel.js]"]
  node_appointment_model["Appointment records"]
  node_cloudinary["Cloudinary<br/>[cloudinary.js]"]
  node_payments["Payment gateways"]
end

node_patient(("Patient"))

node_patient -->|"uses"| node_patient_app
node_patient_app -->|"routes to"| node_doctor_discovery
node_patient_app -->|"routes to"| node_booking
node_patient_app -->|"routes to"| node_my_appointments
node_patient_app -->|"routes to"| node_profile
node_doctor_discovery -->|"uses"| node_patient_context
node_booking -->|"uses"| node_patient_context
node_my_appointments -->|"uses"| node_patient_context
node_profile -->|"uses"| node_patient_context
node_patient_context -->|"requests doctor list"| node_doctor_routes
node_patient_context -->|"requests profile"| node_user_routes
node_patient_app -->|"supports records"| node_patient_records
node_patient_app -.->|"supports communication"| node_messaging
node_staff_app -->|"uses"| node_admin_state
node_staff_app -->|"uses"| node_doctor_state
node_staff_app -->|"routes to"| node_doctor_management
node_staff_app -->|"routes to"| node_admin_appointments
node_staff_app -->|"routes to"| node_admin_dashboard
node_staff_app -->|"routes to"| node_doctor_appointments
node_staff_app -->|"routes to"| node_doctor_profile
node_admin_state -->|"requests admin data"| node_admin_routes
node_doctor_state -->|"requests doctor data"| node_doctor_routes
node_server -->|"mounts"| node_user_routes
node_server -->|"mounts"| node_doctor_routes
node_server -->|"mounts"| node_admin_routes
node_user_routes -->|"dispatches"| node_user_controller
node_doctor_routes -->|"dispatches"| node_doctor_controller
node_admin_routes -->|"dispatches"| node_admin_controller
node_admin_routes -->|"dispatches"| node_doctor_controller
node_user_controller -->|"reads and writes"| node_user_model
node_user_controller -->|"reads and updates"| node_doctor_model
node_user_controller -->|"creates and updates"| node_appointment_model
node_doctor_controller -->|"reads and updates"| node_doctor_model
node_doctor_controller -->|"reads and updates"| node_appointment_model
node_admin_controller -->|"reads and writes"| node_doctor_model
node_admin_controller -->|"reads and updates"| node_appointment_model
node_admin_controller -->|"reads"| node_user_model
node_server -->|"connects"| node_mongo
node_admin_controller -.->|"uploads images"| node_cloudinary
node_user_controller -.->|"uploads images"| node_cloudinary
node_user_controller -->|"processes payments"| node_payments

click node_patient_app "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/App.jsx"
click node_patient_context "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/context/AppContext.jsx"
click node_doctor_discovery "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/Doctors.jsx"
click node_booking "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/Appointment.jsx"
click node_my_appointments "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/MyAppointments.jsx"
click node_profile "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/MyProfile.jsx"
click node_patient_records "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/userModel.js"
click node_messaging "https://github.com/meniraj07/prescripto-hospital_management_system/tree/main/backend/controllers"
click node_staff_app "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/App.jsx"
click node_admin_state "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/context/AdminContext.jsx"
click node_doctor_state "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/context/DoctorContext.jsx"
click node_doctor_management "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Admin/AddDoctor.jsx"
click node_admin_appointments "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Admin/AllAppointments.jsx"
click node_admin_dashboard "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Admin/Dashboard.jsx"
click node_doctor_appointments "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Doctor/DoctorAppointments.jsx"
click node_doctor_profile "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Doctor/DoctorProfile.jsx"
click node_server "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/server.js"
click node_user_routes "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/routes/userRoute.js"
click node_doctor_routes "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/routes/doctorRoute.js"
click node_admin_routes "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/routes/adminRoute.js"
click node_user_controller "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/userController.js"
click node_doctor_controller "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/doctorController.js"
click node_admin_controller "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/adminController.js"
click node_mongo "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/config/mongodb.js"
click node_user_model "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/userModel.js"
click node_doctor_model "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/doctorModel.js"
click node_appointment_model "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/appointmentModel.js"
click node_cloudinary "https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/config/cloudinary.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_patient_app,node_patient_context,node_doctor_discovery,node_booking,node_my_appointments,node_profile,node_patient_records,node_messaging toneBlue
class node_staff_app,node_admin_state,node_doctor_state,node_doctor_management,node_admin_appointments,node_admin_dashboard,node_doctor_appointments,node_doctor_profile toneAmber
class node_server,node_user_routes,node_doctor_routes,node_admin_routes,node_user_controller,node_doctor_controller,node_admin_controller toneMint
class node_mongo,node_user_model,node_doctor_model,node_appointment_model,node_cloudinary,node_payments toneRose
class node_patient toneIndigo
```

## Components

### Patient panel

- [Patient web app](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Patient app state](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [Doctor discovery](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/Doctors.jsx): `frontend/src/pages/Doctors.jsx`
- [Appointment booking](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/Appointment.jsx): `frontend/src/pages/Appointment.jsx`
- [My appointments](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/MyAppointments.jsx): `frontend/src/pages/MyAppointments.jsx`
- [Patient profile](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/frontend/src/pages/MyProfile.jsx): `frontend/src/pages/MyProfile.jsx`
- [Patient records](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [Doctor-patient messaging](https://github.com/meniraj07/prescripto-hospital_management_system/tree/main/backend/controllers): `backend/controllers`

### Admin and doctor panels

- [Staff panel](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/App.jsx): `admin/src/App.jsx`
- [Admin state](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/context/AdminContext.jsx): `admin/src/context/AdminContext.jsx`
- [Doctor state](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/context/DoctorContext.jsx): `admin/src/context/DoctorContext.jsx`
- [Doctor management](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Admin/AddDoctor.jsx): `admin/src/pages/Admin/AddDoctor.jsx`
- [Appointment oversight](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Admin/AllAppointments.jsx): `admin/src/pages/Admin/AllAppointments.jsx`
- [Admin analytics](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Admin/Dashboard.jsx): `admin/src/pages/Admin/Dashboard.jsx`
- [Doctor appointments](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Doctor/DoctorAppointments.jsx): `admin/src/pages/Doctor/DoctorAppointments.jsx`
- [Doctor profile](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/admin/src/pages/Doctor/DoctorProfile.jsx): `admin/src/pages/Doctor/DoctorProfile.jsx`

### Backend API

- [API server](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/server.js): `backend/server.js`
- [User routes](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/routes/userRoute.js): `backend/routes/userRoute.js`
- [Doctor routes](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/routes/doctorRoute.js): `backend/routes/doctorRoute.js`
- [Admin routes](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/routes/adminRoute.js): `backend/routes/adminRoute.js`
- [User workflows](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Doctor workflows](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/doctorController.js): `backend/controllers/doctorController.js`
- [Admin workflows](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`

### Persistence and integrations

- [MongoDB](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/config/mongodb.js): `backend/config/mongodb.js`
- [User records](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [Doctor records](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/doctorModel.js): `backend/models/doctorModel.js`
- [Appointment records](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/models/appointmentModel.js): `backend/models/appointmentModel.js`
- [Cloudinary](https://github.com/meniraj07/prescripto-hospital_management_system/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`
- **Payment gateways**

### Other components

- **Patient**

## Connections

- Patient → Patient web app: uses
- Patient web app → Doctor discovery: routes to (evidence: `frontend/src/App.jsx`)
- Patient web app → Appointment booking: routes to (evidence: `frontend/src/App.jsx`)
- Patient web app → My appointments: routes to (evidence: `frontend/src/App.jsx`)
- Patient web app → Patient profile: routes to (evidence: `frontend/src/App.jsx`)
- Doctor discovery → Patient app state: uses
- Appointment booking → Patient app state: uses (evidence: `frontend/src/pages/Appointment.jsx`)
- My appointments → Patient app state: uses (evidence: `frontend/src/pages/MyAppointments.jsx`)
- Patient profile → Patient app state: uses (evidence: `frontend/src/pages/MyProfile.jsx`)
- Patient app state → Doctor routes: requests doctor list (evidence: `frontend/src/context/AppContext.jsx`)
- Patient app state → User routes: requests profile (evidence: `frontend/src/context/AppContext.jsx`)
- Patient web app → Patient records: supports records
- Patient web app → Doctor-patient messaging: supports communication
- Staff panel → Admin state: uses (evidence: `admin/src/App.jsx`)
- Staff panel → Doctor state: uses (evidence: `admin/src/App.jsx`)
- Staff panel → Doctor management: routes to (evidence: `admin/src/App.jsx`)
- Staff panel → Appointment oversight: routes to (evidence: `admin/src/App.jsx`)
- Staff panel → Admin analytics: routes to (evidence: `admin/src/App.jsx`)
- Staff panel → Doctor appointments: routes to (evidence: `admin/src/App.jsx`)
- Staff panel → Doctor profile: routes to (evidence: `admin/src/App.jsx`)
- Admin state → Admin routes: requests admin data (evidence: `admin/src/context/AdminContext.jsx`)
- Doctor state → Doctor routes: requests doctor data (evidence: `admin/src/context/DoctorContext.jsx`)
- API server → User routes: mounts (evidence: `backend/server.js`)
- API server → Doctor routes: mounts (evidence: `backend/server.js`)
- API server → Admin routes: mounts (evidence: `backend/server.js`)
- User routes → User workflows: dispatches (evidence: `backend/routes/userRoute.js`)
- Doctor routes → Doctor workflows: dispatches (evidence: `backend/routes/doctorRoute.js`)
- Admin routes → Admin workflows: dispatches (evidence: `backend/routes/adminRoute.js`)
- Admin routes → Doctor workflows: dispatches (evidence: `backend/routes/adminRoute.js`)
- User workflows → User records: reads and writes (evidence: `backend/controllers/userController.js`)
- User workflows → Doctor records: reads and updates (evidence: `backend/controllers/userController.js`)
- User workflows → Appointment records: creates and updates (evidence: `backend/controllers/userController.js`)
- Doctor workflows → Doctor records: reads and updates (evidence: `backend/controllers/doctorController.js`)
- Doctor workflows → Appointment records: reads and updates (evidence: `backend/controllers/doctorController.js`)
- Admin workflows → Doctor records: reads and writes (evidence: `backend/controllers/adminController.js`)
- Admin workflows → Appointment records: reads and updates (evidence: `backend/controllers/adminController.js`)
- Admin workflows → User records: reads (evidence: `backend/controllers/adminController.js`)
- API server → MongoDB: connects (evidence: `backend/server.js`)
- Admin workflows → Cloudinary: uploads images
- User workflows → Cloudinary: uploads images
- User workflows → Payment gateways: processes payments (evidence: `backend/controllers/userController.js`)
