# prathameshkhandare/medislot-sahil architecture

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

- Interactive diagram: https://gitdiagram.com/prathameshkhandare/medislot-sahil
- Repository: https://github.com/prathameshkhandare/medislot-sahil

## Overview

This is a doctor-appointment platform with a patient-facing booking portal, an admin console, and a doctor workspace; it also supports blogs. The main workflow runs from patient discovery and appointment selection through booking/payment and appointment management, with staff and doctors handling schedules and appointments. The backend routes requests to controllers that update MongoDB-backed records. Edges reflect sampled calls, imports listed in the source index, or explicit wiring; unsampled page behavior and some API connections are not inferred.

Main entry points: [`backend/server.js`](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/server.js) (HTTP server), [`backend/controllers/userController.js`](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/userController.js) (Patient workflows), [`frontend/src/App.jsx`](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/App.jsx) (Patient app routes), [`backend/controllers/doctorController.js`](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/doctorController.js) (Doctor workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient portal"]
  node_webapp["Patient app routes<br/>[App.jsx]"]
  node_patientctx["Patient session and data<br/>[AppContext.jsx]"]
  node_booking["Doctor booking<br/>[Appointment.jsx]"]
  node_myappointments["My appointments<br/>[MyAppointments.jsx]"]
  node_blogs["Blog browsing<br/>[Blogs.jsx]"]
  node_blogdetail["Blog details<br/>[BlogDetail.jsx]"]
end

subgraph group_staff["Staff workspaces"]
  node_adminapp["Admin app routes<br/>[App.jsx]"]
  node_adminctx["Admin operations<br/>[AdminContext.jsx]"]
  node_adminappointments["Appointment oversight"]
  node_adminadddoctor["Doctor onboarding<br/>[AddDoctor.jsx]"]
  node_doctorctx["Doctor operations<br/>[DoctorContext.jsx]"]
  node_doctorappointments["Doctor appointments"]
  node_doctorblog["Blog authoring<br/>[AddBlog.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_userroute["Patient API routes<br/>[userRoute.js]"]
  node_doctorroute["Doctor API routes<br/>[doctorRoute.js]"]
  node_adminroute["Admin API routes<br/>[adminRoute.js]"]
  node_blogroute["Blog API routes<br/>[blogRoute.js]"]
  node_usercontroller["Patient workflows<br/>[userController.js]"]
  node_doctorcontroller["Doctor workflows"]
  node_admincontroller["Admin workflows<br/>[adminController.js]"]
  node_blogcontroller["Blog workflows<br/>[blogController.js]"]
end

subgraph group_data["Data and integrations"]
  node_userdb[("User records<br/>[userModel.js]")]
  node_doctordb[("Doctor records<br/>[doctorModel.js]")]
  node_appointmentdb[("Appointment records")]
  node_blogdb[("Blog records<br/>[blog.js]")]
  node_cloudinary["Cloudinary media<br/>[cloudinary.js]"]
  node_mailer["Email notifications<br/>[sendMail.js]"]
end

node_visitor(("Patient"))
node_payment["Payment providers"]

node_visitor -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_booking
node_webapp -->|"routes to"| node_myappointments
node_webapp -->|"routes to"| node_blogs
node_webapp -->|"routes to"| node_blogdetail
node_booking -->|"uses"| node_patientctx
node_myappointments -->|"uses"| node_patientctx
node_patientctx -->|"requests doctor list"| node_doctorroute
node_patientctx -->|"requests profile"| node_userroute
node_patientctx -.->|"calls API"| node_server
node_adminapp -->|"routes to"| node_adminappointments
node_adminapp -->|"routes to"| node_adminadddoctor
node_adminapp -->|"routes to"| node_doctorappointments
node_adminapp -->|"routes to"| node_doctorblog
node_adminappointments -->|"uses"| node_adminctx
node_adminadddoctor -->|"uses"| node_adminctx
node_doctorappointments -->|"uses"| node_doctorctx
node_adminctx -->|"requests admin data"| node_adminroute
node_doctorctx -->|"requests doctor data"| node_doctorroute
node_adminctx -.->|"calls API"| node_server
node_doctorctx -.->|"calls API"| node_server
node_server -->|"mounts"| node_userroute
node_server -->|"mounts"| node_doctorroute
node_server -->|"mounts"| node_adminroute
node_server -->|"mounts"| node_blogroute
node_userroute -->|"dispatches"| node_usercontroller
node_doctorroute -->|"dispatches"| node_doctorcontroller
node_adminroute -->|"dispatches"| node_admincontroller
node_blogroute -->|"dispatches"| node_blogcontroller
node_usercontroller -->|"reads/writes"| node_userdb
node_usercontroller -->|"reads/writes"| node_doctordb
node_usercontroller -->|"reads/writes"| node_appointmentdb
node_doctorcontroller -->|"reads/writes"| node_doctordb
node_doctorcontroller -->|"reads/writes"| node_appointmentdb
node_admincontroller -->|"reads/writes"| node_doctordb
node_admincontroller -->|"reads/writes"| node_appointmentdb
node_admincontroller -->|"reads"| node_userdb
node_blogcontroller -->|"reads/writes"| node_blogdb
node_usercontroller -.->|"uploads images"| node_cloudinary
node_usercontroller -->|"creates payments"| node_payment
node_doctorcontroller -->|"refunds payments"| node_payment
node_doctorcontroller -->|"sends notices"| node_mailer

click node_webapp "https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/App.jsx"
click node_patientctx "https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/context/AppContext.jsx"
click node_booking "https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/Appointment.jsx"
click node_myappointments "https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/MyAppointments.jsx"
click node_blogs "https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/Blogs.jsx"
click node_blogdetail "https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/BlogDetail.jsx"
click node_adminapp "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/App.jsx"
click node_adminctx "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/context/AdminContext.jsx"
click node_adminappointments "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Admin/AllAppointments.jsx"
click node_adminadddoctor "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Admin/AddDoctor.jsx"
click node_doctorctx "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/context/DoctorContext.jsx"
click node_doctorappointments "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Doctor/DoctorAppointments.jsx"
click node_doctorblog "https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Doctor/AddBlog.jsx"
click node_server "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/server.js"
click node_userroute "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/userRoute.js"
click node_doctorroute "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/doctorRoute.js"
click node_adminroute "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/adminRoute.js"
click node_blogroute "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/blogRoute.js"
click node_usercontroller "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/userController.js"
click node_doctorcontroller "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/doctorController.js"
click node_admincontroller "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/adminController.js"
click node_blogcontroller "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/blogController.js"
click node_userdb "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/userModel.js"
click node_doctordb "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/doctorModel.js"
click node_appointmentdb "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/appointmentModel.js"
click node_blogdb "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/blog.js"
click node_cloudinary "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/config/cloudinary.js"
click node_mailer "https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/utils/sendMail.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_webapp,node_patientctx,node_booking,node_myappointments,node_blogs,node_blogdetail toneBlue
class node_adminapp,node_adminctx,node_adminappointments,node_adminadddoctor,node_doctorctx,node_doctorappointments,node_doctorblog toneAmber
class node_server,node_userroute,node_doctorroute,node_adminroute,node_blogroute,node_usercontroller,node_doctorcontroller,node_admincontroller,node_blogcontroller toneMint
class node_userdb,node_doctordb,node_appointmentdb,node_blogdb,node_cloudinary,node_mailer toneRose
class node_visitor,node_payment toneIndigo
```

## Components

### Patient portal

- [Patient app routes](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Patient session and data](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/context/AppContext.jsx): `frontend/src/context/AppContext.jsx`
- [Doctor booking](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/Appointment.jsx): `frontend/src/pages/Appointment.jsx`
- [My appointments](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/MyAppointments.jsx): `frontend/src/pages/MyAppointments.jsx`
- [Blog browsing](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/Blogs.jsx): `frontend/src/pages/Blogs.jsx`
- [Blog details](https://github.com/prathameshkhandare/medislot-sahil/blob/main/frontend/src/pages/BlogDetail.jsx): `frontend/src/pages/BlogDetail.jsx`

### Staff workspaces

- [Admin app routes](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/App.jsx): `admin/src/App.jsx`
- [Admin operations](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/context/AdminContext.jsx): `admin/src/context/AdminContext.jsx`
- [Appointment oversight](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Admin/AllAppointments.jsx): `admin/src/pages/Admin/AllAppointments.jsx`
- [Doctor onboarding](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Admin/AddDoctor.jsx): `admin/src/pages/Admin/AddDoctor.jsx`
- [Doctor operations](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/context/DoctorContext.jsx): `admin/src/context/DoctorContext.jsx`
- [Doctor appointments](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Doctor/DoctorAppointments.jsx): `admin/src/pages/Doctor/DoctorAppointments.jsx`
- [Blog authoring](https://github.com/prathameshkhandare/medislot-sahil/blob/main/admin/src/pages/Doctor/AddBlog.jsx): `admin/src/pages/Doctor/AddBlog.jsx`

### Backend API

- [HTTP server](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/server.js): `backend/server.js`
- [Patient API routes](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/userRoute.js): `backend/routes/userRoute.js`
- [Doctor API routes](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/doctorRoute.js): `backend/routes/doctorRoute.js`
- [Admin API routes](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/adminRoute.js): `backend/routes/adminRoute.js`
- [Blog API routes](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/routes/blogRoute.js): `backend/routes/blogRoute.js`
- [Patient workflows](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Doctor workflows](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/doctorController.js): `backend/controllers/doctorController.js`
- [Admin workflows](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/adminController.js): `backend/controllers/adminController.js`
- [Blog workflows](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/controllers/blogController.js): `backend/controllers/blogController.js`

### Data and integrations

- [User records](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/userModel.js): `backend/models/userModel.js`
- [Doctor records](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/doctorModel.js): `backend/models/doctorModel.js`
- [Appointment records](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/appointmentModel.js): `backend/models/appointmentModel.js`
- [Blog records](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/models/blog.js): `backend/models/blog.js`
- [Cloudinary media](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`
- [Email notifications](https://github.com/prathameshkhandare/medislot-sahil/blob/main/backend/utils/sendMail.js): `backend/utils/sendMail.js`

### Other components

- **Patient**
- **Payment providers**

## Connections

- Patient → Patient app routes: uses
- Patient app routes → Doctor booking: routes to (evidence: `frontend/src/App.jsx`)
- Patient app routes → My appointments: routes to (evidence: `frontend/src/App.jsx`)
- Patient app routes → Blog browsing: routes to (evidence: `frontend/src/App.jsx`)
- Patient app routes → Blog details: routes to (evidence: `frontend/src/App.jsx`)
- Doctor booking → Patient session and data: uses (evidence: `frontend/src/pages/Appointment.jsx`)
- My appointments → Patient session and data: uses (evidence: `frontend/src/pages/MyAppointments.jsx`)
- Patient session and data → Doctor API routes: requests doctor list (evidence: `frontend/src/context/AppContext.jsx`)
- Patient session and data → Patient API routes: requests profile (evidence: `frontend/src/context/AppContext.jsx`)
- Patient session and data → HTTP server: calls API
- Admin app routes → Appointment oversight: routes to (evidence: `admin/src/App.jsx`)
- Admin app routes → Doctor onboarding: routes to (evidence: `admin/src/App.jsx`)
- Admin app routes → Doctor appointments: routes to (evidence: `admin/src/App.jsx`)
- Admin app routes → Blog authoring: routes to (evidence: `admin/src/App.jsx`)
- Appointment oversight → Admin operations: uses (evidence: `admin/src/pages/Admin/AllAppointments.jsx`)
- Doctor onboarding → Admin operations: uses (evidence: `admin/src/pages/Admin/AddDoctor.jsx`)
- Doctor appointments → Doctor operations: uses (evidence: `admin/src/pages/Doctor/DoctorAppointments.jsx`)
- Admin operations → Admin API routes: requests admin data (evidence: `admin/src/context/AdminContext.jsx`)
- Doctor operations → Doctor API routes: requests doctor data (evidence: `admin/src/context/DoctorContext.jsx`)
- Admin operations → HTTP server: calls API
- Doctor operations → HTTP server: calls API
- HTTP server → Patient API routes: mounts (evidence: `backend/server.js`)
- HTTP server → Doctor API routes: mounts (evidence: `backend/server.js`)
- HTTP server → Admin API routes: mounts (evidence: `backend/server.js`)
- HTTP server → Blog API routes: mounts (evidence: `backend/server.js`)
- Patient API routes → Patient workflows: dispatches (evidence: `backend/routes/userRoute.js`)
- Doctor API routes → Doctor workflows: dispatches (evidence: `backend/routes/doctorRoute.js`)
- Admin API routes → Admin workflows: dispatches (evidence: `backend/routes/adminRoute.js`)
- Blog API routes → Blog workflows: dispatches (evidence: `backend/routes/blogRoute.js`)
- Patient workflows → User records: reads/writes (evidence: `backend/controllers/userController.js`)
- Patient workflows → Doctor records: reads/writes (evidence: `backend/controllers/userController.js`)
- Patient workflows → Appointment records: reads/writes (evidence: `backend/controllers/userController.js`)
- Doctor workflows → Doctor records: reads/writes (evidence: `backend/controllers/doctorController.js`)
- Doctor workflows → Appointment records: reads/writes (evidence: `backend/controllers/doctorController.js`)
- Admin workflows → Doctor records: reads/writes (evidence: `backend/controllers/adminController.js`)
- Admin workflows → Appointment records: reads/writes (evidence: `backend/controllers/adminController.js`)
- Admin workflows → User records: reads (evidence: `backend/controllers/adminController.js`)
- Blog workflows → Blog records: reads/writes (evidence: `backend/controllers/blogController.js`)
- Patient workflows → Cloudinary media: uploads images
- Patient workflows → Payment providers: creates payments (evidence: `backend/controllers/userController.js`)
- Doctor workflows → Payment providers: refunds payments (evidence: `backend/controllers/doctorController.js`)
- Doctor workflows → Email notifications: sends notices (evidence: `backend/controllers/doctorController.js`)
