# saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem architecture

> Architecture diagram of the GitHub repository saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem
- Repository: https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem

## Overview

DocEase is a digital clinic platform with a patient-facing appointment flow and separate admin and doctor portals. Patients browse doctors, manage profiles, book or cancel appointments, and pay; staff manage doctors and appointments, while doctors manage availability and care workflow. The backend controllers coordinate MongoDB-backed records and external image/payment services. Some route, context, and page implementations are not sampled, so links between those areas are shown only where supported by the tree or sampled code.

Main entry points: [`backend/controllers/userController.js`](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/userController.js) (User workflows), [`backend/server.js`](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/server.js) (API server), [`backend/controllers/adminController.js`](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/adminController.js) (Admin workflows), [`backend/models/doctorModel.js`](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/doctorModel.js) (Doctor records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient experience"]
  node_patient_ui["Patient web app"]
  node_patient_context["Patient app context<br/>[AppContext.jsx]"]
  node_patient_pages["Patient pages"]
end

subgraph group_staff["Staff portals"]
  node_staff_ui["Admin and doctor portal"]
  node_staff_context["Portal contexts"]
  node_staff_pages["Portal pages"]
end

subgraph group_api["API workflows"]
  node_api_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_workflow["User workflows<br/>[userController.js]"]
  node_doctor_workflow["Doctor workflows"]
  node_admin_workflow["Admin workflows<br/>[adminController.js]"]
  node_auth["Role authentication"]
end

subgraph group_data["Data and integrations"]
  node_appointments[("Appointment records")]
  node_doctors[("Doctor records<br/>[doctorModel.js]")]
  node_users[("User records<br/>[userModel.js]")]
  node_mongodb[("MongoDB<br/>[mongodb.js]")]
  node_cloudinary["Cloudinary images<br/>[cloudinary.js]"]
  node_razorpay["Razorpay"]
end

node_patient_actor(("Patient"))
node_staff_actor(("Admin or doctor"))

node_patient_actor -->|"uses"| node_patient_ui
node_patient_ui -->|"routes to"| node_patient_pages
node_patient_ui -->|"provides context"| node_patient_context
node_patient_context -->|"requests"| node_api_server
node_staff_actor -->|"uses"| node_staff_ui
node_staff_ui -->|"routes to"| node_staff_pages
node_staff_ui -->|"provides context"| node_staff_context
node_api_server -->|"mounts"| node_user_routes
node_api_server -->|"mounts"| node_doctor_routes
node_api_server -->|"mounts"| node_admin_routes
node_user_workflow -->|"reads and writes"| node_users
node_user_workflow -->|"reads and writes"| node_doctors
node_user_workflow -->|"reads and writes"| node_appointments
node_user_workflow -->|"uploads images"| node_cloudinary
node_user_workflow -->|"creates and verifies orders"| node_razorpay
node_doctor_workflow -->|"reads and writes"| node_doctors
node_doctor_workflow -->|"reads and writes"| node_appointments
node_admin_workflow -->|"reads and writes"| node_doctors
node_admin_workflow -->|"reads"| node_users
node_admin_workflow -->|"reads and writes"| node_appointments
node_admin_workflow -->|"uploads images"| node_cloudinary
node_auth -->|"loads doctor"| node_doctors
node_api_server -->|"connects"| node_mongodb

click node_patient_ui "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/frontend/src"
click node_patient_context "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/frontend/src/context/AppContext.jsx"
click node_patient_pages "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/frontend/src/pages"
click node_staff_ui "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/admin/src"
click node_staff_context "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/admin/src/context"
click node_staff_pages "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/admin/src/pages"
click node_api_server "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/server.js"
click node_user_routes "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/routes/userRoute.js"
click node_doctor_routes "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/routes/doctorRoute.js"
click node_admin_routes "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/routes/adminRoute.js"
click node_user_workflow "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/userController.js"
click node_doctor_workflow "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/doctorController.js"
click node_admin_workflow "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/adminController.js"
click node_auth "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/backend/middlewares"
click node_appointments "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/appointmentModel.js"
click node_doctors "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/doctorModel.js"
click node_users "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/userModel.js"
click node_mongodb "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/config/mongodb.js"
click node_cloudinary "https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/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_ui,node_patient_context,node_patient_pages toneBlue
class node_staff_ui,node_staff_context,node_staff_pages toneAmber
class node_api_server,node_user_routes,node_doctor_routes,node_admin_routes,node_user_workflow,node_doctor_workflow,node_admin_workflow,node_auth toneMint
class node_appointments,node_doctors,node_users,node_mongodb,node_cloudinary,node_razorpay toneRose
class node_patient_actor,node_staff_actor toneIndigo
```

## Components

### Patient experience

- [Patient web app](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/frontend/src): `frontend/src`
- [Patient app context](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [Patient pages](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/frontend/src/pages): `frontend/src/pages`

### Staff portals

- [Admin and doctor portal](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/admin/src): `admin/src`
- [Portal contexts](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/admin/src/context): `admin/src/context`
- [Portal pages](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/admin/src/pages): `admin/src/pages`

### API workflows

- [API server](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/server.js): `backend/server.js`
- [User routes](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/routes/userRoute.js): `backend/routes/userRoute.js`
- [Doctor routes](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/routes/doctorRoute.js): `backend/routes/doctorRoute.js`
- [Admin routes](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/routes/adminRoute.js): `backend/routes/adminRoute.js`
- [User workflows](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Doctor workflows](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/doctorController.js): `backend/controllers/doctorController.js`
- [Admin workflows](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`
- [Role authentication](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/tree/main/backend/middlewares): `backend/middlewares`

### Data and integrations

- [Appointment records](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/appointmentModel.js): `backend/models/appointmentModel.js`
- [Doctor records](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/doctorModel.js): `backend/models/doctorModel.js`
- [User records](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [MongoDB](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/config/mongodb.js): `backend/config/mongodb.js`
- [Cloudinary images](https://github.com/saurabhedict/docease-your-complete-full-stack-digital-hospital-ecosystem/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`
- **Razorpay**

### Other components

- **Patient**
- **Admin or doctor**

## Connections

- Patient → Patient web app: uses
- Patient web app → Patient pages: routes to
- Patient web app → Patient app context: provides context
- Patient app context → API server: requests
- Admin or doctor → Admin and doctor portal: uses
- Admin and doctor portal → Portal pages: routes to
- Admin and doctor portal → Portal contexts: provides context
- API server → User routes: mounts
- API server → Doctor routes: mounts
- API server → Admin routes: mounts
- User workflows → User records: reads and writes
- User workflows → Doctor records: reads and writes
- User workflows → Appointment records: reads and writes
- User workflows → Cloudinary images: uploads images
- User workflows → Razorpay: creates and verifies orders
- Doctor workflows → Doctor records: reads and writes
- Doctor workflows → Appointment records: reads and writes
- Admin workflows → Doctor records: reads and writes
- Admin workflows → User records: reads
- Admin workflows → Appointment records: reads and writes
- Admin workflows → Cloudinary images: uploads images
- Role authentication → Doctor records: loads doctor
- API server → MongoDB: connects
