# sidsahoo1203/hospital-mis-system architecture

> Architecture diagram of the GitHub repository sidsahoo1203/hospital-mis-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sidsahoo1203/hospital-mis-system
- Repository: https://github.com/sidsahoo1203/hospital-mis-system

## Overview

MediTrack combines a patient-facing hospital website, a staff portal, and an Express/MongoDB backend. The primary workflow runs from appointment booking and admin review through arrival, doctor consultation, medicine prescribing, and payment with a receipt. Separate branches cover online medicine orders, inventory, staff and doctor administration, and website messages. Backend relationships are grounded in excerpts or the source index; unsampled frontend-to-API behavior is linked only where the README documents it.

Main entry points: [`backend/controller/appointmentController.js`](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/appointmentController.js) (Appointment Service), [`backend/controller/medicineController.js`](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/medicineController.js) (Medicine Service), [`backend/app.js`](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/app.js) (Express API), [`dashboard/src/components/Dashboard.jsx`](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Dashboard.jsx) (Admin Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient Website"]
  node_patient_site["Patient Website<br/>[App.jsx]"]
  node_booking["Appointment Booking"]
  node_storefront["Storefront And Cart<br/>[StoreContext.jsx]"]
  node_contact["Contact Messages<br/>[ContactUs.jsx]"]
end

subgraph group_staff["Staff Portal"]
  node_staff_portal["Staff Portal<br/>[App.jsx]"]
  node_admin_ops["Admin Operations<br/>[Dashboard.jsx]"]
  node_doctor_patients["Doctor Patient Queue<br/>[DoctorHome.jsx]"]
  node_doctor_setup["Doctor Management<br/>[AddNewDoctor.jsx]"]
  node_staff_messages["Message Inbox<br/>[Messages.jsx]"]
  node_live_updates["Live Updates<br/>[live.jsx]"]
end

subgraph group_clinical["Appointments And Care"]
  node_consultation["Consultation<br/>[Consultation.jsx]"]
  node_prescription["Prescription Selection"]
  node_receipt["Receipt<br/>[Receipt.jsx]"]
  node_appointment_api["Appointment Service"]
  node_appointment_data[("Appointment Records")]
end

subgraph group_commerce["Medicine Commerce"]
  node_medicine_admin["Inventory And Orders<br/>[MedicineStore.jsx]"]
  node_medicine_api["Medicine Service"]
  node_medicine_data[("Medicine Stock<br/>[medicineSchema.js]")]
  node_order_data[("Sales Orders<br/>[orderSchema.js]")]
end

subgraph group_platform["Backend Platform"]
  node_user_service["Staff Accounts<br/>[userController.js]"]
  node_user_data[("User Records<br/>[userSchema.js]")]
  node_message_service["Message Service"]
  node_message_data[("Message Records<br/>[messageSchema.js]")]
  node_api_app["Express API<br/>[app.js]"]
  node_database[("MongoDB<br/>[dbConnection.js]")]
end

node_patient_actor(("Patient"))
node_staff_actor(("Hospital Staff"))
node_cloudinary["Cloudinary"]

node_patient_actor -->|"uses"| node_patient_site
node_patient_site -->|"routes to"| node_booking
node_patient_actor -->|"books"| node_booking
node_patient_site -->|"routes to"| node_storefront
node_storefront -.->|"fetches inventory"| node_medicine_api
node_patient_actor -->|"orders medicines"| node_storefront
node_patient_site -->|"routes to"| node_contact
node_contact -->|"submits message"| node_message_service
node_staff_actor -->|"uses"| node_staff_portal
node_staff_portal -->|"renders"| node_admin_ops
node_staff_portal -->|"renders"| node_doctor_patients
node_admin_ops -->|"manages visits"| node_appointment_api
node_doctor_patients -->|"opens"| node_consultation
node_consultation -->|"selects medicines"| node_prescription
node_consultation -->|"completes visit"| node_appointment_api
node_appointment_api -->|"reads and writes"| node_appointment_data
node_appointment_api -->|"creates prescription order"| node_order_data
node_appointment_api -->|"issues payment receipt"| node_receipt
node_prescription -.->|"gets stock"| node_medicine_api
node_admin_ops -->|"generates receipt"| node_receipt
node_admin_ops -->|"manages doctors"| node_doctor_setup
node_doctor_setup -->|"registers doctors"| node_user_service
node_user_service -->|"reads and writes"| node_user_data
node_user_service -->|"uploads photos"| node_cloudinary
node_admin_ops -->|"manages stock"| node_medicine_admin
node_medicine_admin -->|"manages inventory"| node_medicine_api
node_medicine_api -->|"reads and writes"| node_medicine_data
node_medicine_api -->|"creates and updates"| node_order_data
node_admin_ops -->|"reviews messages"| node_staff_messages
node_staff_messages -->|"loads inbox"| node_message_service
node_message_service -->|"reads and writes"| node_message_data
node_api_app -->|"connects"| node_database
node_api_app -->|"mounts routes"| node_appointment_api
node_api_app -->|"mounts routes"| node_medicine_api
node_api_app -->|"mounts routes"| node_message_service
node_api_app -->|"mounts routes"| node_user_service
node_api_app -->|"serves event stream"| node_live_updates
node_appointment_api -->|"broadcasts changes"| node_live_updates
node_medicine_api -->|"broadcasts changes"| node_live_updates
node_user_service -->|"broadcasts changes"| node_live_updates

click node_patient_site "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/App.jsx"
click node_booking "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/components/AppointmentForm.jsx"
click node_storefront "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/context/StoreContext.jsx"
click node_contact "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/Pages/ContactUs.jsx"
click node_staff_portal "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/App.jsx"
click node_admin_ops "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Dashboard.jsx"
click node_doctor_patients "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/DoctorHome.jsx"
click node_doctor_setup "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/AddNewDoctor.jsx"
click node_staff_messages "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Messages.jsx"
click node_live_updates "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/live.jsx"
click node_consultation "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Consultation.jsx"
click node_prescription "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/PrescriptionStore.jsx"
click node_receipt "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Receipt.jsx"
click node_appointment_api "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/appointmentController.js"
click node_appointment_data "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/appointmentSchema.js"
click node_medicine_admin "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/MedicineStore.jsx"
click node_medicine_api "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/medicineController.js"
click node_medicine_data "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/medicineSchema.js"
click node_order_data "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/orderSchema.js"
click node_user_service "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/userController.js"
click node_user_data "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/userSchema.js"
click node_message_service "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/messageController.js"
click node_message_data "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/messageSchema.js"
click node_api_app "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/app.js"
click node_database "https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/database/dbConnection.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_site,node_booking,node_storefront,node_contact toneBlue
class node_staff_portal,node_admin_ops,node_doctor_patients,node_doctor_setup,node_staff_messages,node_live_updates toneAmber
class node_consultation,node_prescription,node_receipt,node_appointment_api,node_appointment_data toneMint
class node_medicine_admin,node_medicine_api,node_medicine_data,node_order_data toneRose
class node_user_service,node_user_data,node_message_service,node_message_data,node_api_app,node_database,node_patient_actor,node_staff_actor,node_cloudinary toneIndigo
```

## Components

### Patient Website

- [Patient Website](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Appointment Booking](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/components/AppointmentForm.jsx): `frontend/src/components/AppointmentForm.jsx`
- [Storefront And Cart](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/context/StoreContext.jsx): `frontend/src/context/StoreContext.jsx`
- [Contact Messages](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/frontend/src/Pages/ContactUs.jsx): `frontend/src/Pages/ContactUs.jsx`

### Staff Portal

- [Staff Portal](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/App.jsx): `dashboard/src/App.jsx`
- [Admin Operations](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Dashboard.jsx): `dashboard/src/components/Dashboard.jsx`
- [Doctor Patient Queue](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/DoctorHome.jsx): `dashboard/src/components/DoctorHome.jsx`
- [Doctor Management](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/AddNewDoctor.jsx): `dashboard/src/components/AddNewDoctor.jsx`
- [Message Inbox](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Messages.jsx): `dashboard/src/components/Messages.jsx`
- [Live Updates](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/live.jsx): `dashboard/src/live.jsx`

### Appointments And Care

- [Consultation](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Consultation.jsx): `dashboard/src/components/Consultation.jsx`
- [Prescription Selection](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/PrescriptionStore.jsx): `dashboard/src/components/PrescriptionStore.jsx`
- [Receipt](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/Receipt.jsx): `dashboard/src/components/Receipt.jsx`
- [Appointment Service](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/appointmentController.js): `backend/controller/appointmentController.js`
- [Appointment Records](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/appointmentSchema.js): `backend/models/appointmentSchema.js`

### Medicine Commerce

- [Inventory And Orders](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/dashboard/src/components/MedicineStore.jsx): `dashboard/src/components/MedicineStore.jsx`
- [Medicine Service](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/medicineController.js): `backend/controller/medicineController.js`
- [Medicine Stock](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/medicineSchema.js): `backend/models/medicineSchema.js`
- [Sales Orders](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/orderSchema.js): `backend/models/orderSchema.js`

### Backend Platform

- [Staff Accounts](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/userController.js): `backend/controller/userController.js`
- [User Records](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/userSchema.js): `backend/models/userSchema.js`
- [Message Service](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/controller/messageController.js): `backend/controller/messageController.js`
- [Message Records](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/models/messageSchema.js): `backend/models/messageSchema.js`
- [Express API](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/app.js): `backend/app.js`
- [MongoDB](https://github.com/sidsahoo1203/hospital-mis-system/blob/main/backend/database/dbConnection.js): `backend/database/dbConnection.js`

### Other components

- **Patient**
- **Hospital Staff**
- **Cloudinary**

## Connections

- Patient → Patient Website: uses
- Patient Website → Appointment Booking: routes to (evidence: `frontend/src/App.jsx`)
- Patient → Appointment Booking: books
- Patient Website → Storefront And Cart: routes to (evidence: `frontend/src/App.jsx`)
- Storefront And Cart → Medicine Service: fetches inventory (evidence: `frontend/src/context/StoreContext.jsx`)
- Patient → Storefront And Cart: orders medicines
- Patient Website → Contact Messages: routes to (evidence: `frontend/src/App.jsx`)
- Contact Messages → Message Service: submits message
- Hospital Staff → Staff Portal: uses
- Staff Portal → Admin Operations: renders (evidence: `dashboard/src/App.jsx`)
- Staff Portal → Doctor Patient Queue: renders (evidence: `dashboard/src/App.jsx`)
- Admin Operations → Appointment Service: manages visits
- Doctor Patient Queue → Consultation: opens
- Consultation → Prescription Selection: selects medicines
- Consultation → Appointment Service: completes visit
- Appointment Service → Appointment Records: reads and writes (evidence: `backend/controller/appointmentController.js`)
- Appointment Service → Sales Orders: creates prescription order (evidence: `backend/controller/appointmentController.js`)
- Appointment Service → Receipt: issues payment receipt
- Prescription Selection → Medicine Service: gets stock
- Admin Operations → Receipt: generates receipt
- Admin Operations → Doctor Management: manages doctors
- Doctor Management → Staff Accounts: registers doctors (evidence: `backend/controller/userController.js`)
- Staff Accounts → User Records: reads and writes (evidence: `backend/controller/userController.js`)
- Staff Accounts → Cloudinary: uploads photos (evidence: `backend/controller/userController.js`)
- Admin Operations → Inventory And Orders: manages stock
- Inventory And Orders → Medicine Service: manages inventory
- Medicine Service → Medicine Stock: reads and writes (evidence: `backend/controller/medicineController.js`)
- Medicine Service → Sales Orders: creates and updates (evidence: `backend/controller/medicineController.js`)
- Admin Operations → Message Inbox: reviews messages
- Message Inbox → Message Service: loads inbox
- Message Service → Message Records: reads and writes (evidence: `backend/controller/messageController.js`)
- Express API → MongoDB: connects (evidence: `backend/app.js`)
- Express API → Appointment Service: mounts routes (evidence: `backend/app.js`)
- Express API → Medicine Service: mounts routes (evidence: `backend/app.js`)
- Express API → Message Service: mounts routes (evidence: `backend/app.js`)
- Express API → Staff Accounts: mounts routes (evidence: `backend/app.js`)
- Express API → Live Updates: serves event stream (evidence: `backend/app.js`)
- Appointment Service → Live Updates: broadcasts changes (evidence: `backend/controller/appointmentController.js`)
- Medicine Service → Live Updates: broadcasts changes (evidence: `backend/controller/medicineController.js`)
- Staff Accounts → Live Updates: broadcasts changes (evidence: `backend/controller/userController.js`)
