# suvam-das-29/healthsync architecture

> Architecture diagram of the GitHub repository suvam-das-29/healthsync, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suvam-das-29/healthsync
- Repository: https://github.com/suvam-das-29/healthsync

## Overview

HealthSync is a role-based healthcare records and practice-management application. Patients and administrators use separate web dashboards; the backend exposes APIs for authentication, appointments, prescriptions, records, doctors, and billing. In the sampled code, API routes dispatch to controllers, which validate requests and read or write MongoDB models; authentication also sends verification and reset emails. The tree and service page indicate broader reporting, insurance, and record-management features, but their specific runtime wiring was not sampled, so those links are omitted.

Main entry points: [`BACKEND/index.js`](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/index.js) (API server), [`FRONTEND/src/App.jsx`](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/App.jsx) (Web router), [`FRONTEND/src/Patient/UserPanel.jsx`](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/UserPanel.jsx) (Patient dashboard), [`BACKEND/Controller/authController.js`](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/authController.js) (Auth controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Web router<br/>[App.jsx]"]
  node_authui["Auth screens<br/>[Login.jsx]"]
  node_patientui["Patient dashboard<br/>[UserPanel.jsx]"]
  node_adminui["Admin dashboard<br/>[AdminPanel.jsx]"]
end

subgraph group_identity["Identity"]
  node_authapi["Auth routes<br/>[authRoutes.js]"]
  node_authctrl["Auth controller<br/>[authController.js]"]
  node_users[("User records<br/>[userModel.js]")]
  node_mailer["Email delivery<br/>[nodeMailer.js]"]
end

subgraph group_care["Care workflows"]
  node_apptui["Appointment screens<br/>[Appointment.jsx]"]
  node_presui["Prescription screens<br/>[Prescription.jsx]"]
  node_apptctrl["Appointment controller"]
  node_patientapptctrl["Patient appointment controller"]
  node_presctrl["Prescription controller"]
  node_patientpresctrl["Patient prescription controller"]
  node_apptdata[("Appointment records")]
  node_patientapptdata[("Patient appointment records")]
  node_presdata[("Prescription records")]
end

subgraph group_operations["Practice operations"]
  node_docui["Health records and documents<br/>[HealthRecords.jsx]"]
  node_billingui["Billing and insurance<br/>[CreateInvoice.jsx]"]
  node_reportui["Reports and analytics<br/>[Overview.jsx]"]
  node_doctors["Doctor management<br/>[DoctorList.jsx]"]
  node_docctrl["Document controller"]
end

subgraph group_runtime["API runtime"]
  node_server["API server<br/>[index.js]"]
  node_authroutes["Authentication endpoints<br/>[authRoutes.js]"]
  node_approutes["Appointment endpoints"]
  node_patientapproutes["Patient appointment endpoints"]
  node_presroutes["Prescription endpoints"]
  node_patientpresroutes["Patient prescription endpoints"]
  node_docroutes["Document endpoints<br/>[documentRoutes.js]"]
end

node_patient(("Patient"))
node_admin(("Administrator"))
node_mongo[("MongoDB")]
node_emailservice["Email service"]

node_patient -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_webapp -->|"routes to"| node_patientui
node_webapp -->|"routes to"| node_adminui
node_authui -->|"authenticates via"| node_authroutes
node_patientui -->|"opens"| node_apptui
node_patientui -->|"opens"| node_presui
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_approutes
node_server -->|"mounts"| node_patientapproutes
node_server -->|"mounts"| node_presroutes
node_server -->|"mounts"| node_patientpresroutes
node_server -->|"mounts"| node_docroutes
node_authroutes -->|"dispatches"| node_authctrl
node_authctrl -->|"reads and writes"| node_users
node_authctrl -->|"sends through"| node_mailer
node_mailer -->|"delivers email"| node_emailservice
node_approutes -->|"dispatches"| node_apptctrl
node_apptctrl -->|"reads and writes"| node_apptdata
node_patientapproutes -->|"dispatches"| node_patientapptctrl
node_patientapptctrl -->|"reads and writes"| node_patientapptdata
node_presroutes -->|"dispatches"| node_presctrl
node_presctrl -->|"reads and writes"| node_presdata
node_patientpresroutes -->|"dispatches"| node_patientpresctrl
node_patientpresctrl -->|"reads"| node_presdata
node_docroutes -->|"dispatches"| node_docctrl
node_users -->|"persists in"| node_mongo
node_apptdata -->|"persists in"| node_mongo
node_patientapptdata -->|"persists in"| node_mongo
node_presdata -->|"persists in"| node_mongo

click node_webapp "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/App.jsx"
click node_authui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Authentication/Login.jsx"
click node_patientui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/UserPanel.jsx"
click node_adminui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/AdminPanel.jsx"
click node_authapi "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/authRoutes.js"
click node_authctrl "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/authController.js"
click node_users "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/userModel.js"
click node_mailer "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Database/nodeMailer.js"
click node_apptui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/Appointment/Appointment.jsx"
click node_presui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/Prescription/Prescription.jsx"
click node_apptctrl "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/appointmentController.js"
click node_patientapptctrl "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/patientAppointmentController.js"
click node_presctrl "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/prescriptionController.js"
click node_patientpresctrl "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/patientPrescriptionController.js"
click node_apptdata "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/appointmentSchema.js"
click node_patientapptdata "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/patientAppointmentSchema.js"
click node_presdata "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/prescriptionSchema.js"
click node_docui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Records/HealthRecords.jsx"
click node_billingui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Billing/CreateInvoice.jsx"
click node_reportui "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Reports/Overview.jsx"
click node_doctors "https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Pages/DoctorList.jsx"
click node_server "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/index.js"
click node_authroutes "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/authRoutes.js"
click node_approutes "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/appointmentRoutes.js"
click node_patientapproutes "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/patientAppointmentRoutes.js"
click node_presroutes "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/prescriptionRoutes.js"
click node_patientpresroutes "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/patientPrescriptionRoutes.js"
click node_docroutes "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/documentRoutes.js"
click node_docctrl "https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/documentController.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_authui,node_patientui,node_adminui toneBlue
class node_authapi,node_authctrl,node_users,node_mailer,node_mongo toneAmber
class node_apptui,node_presui,node_apptctrl,node_patientapptctrl,node_presctrl,node_patientpresctrl,node_apptdata,node_patientapptdata,node_presdata toneMint
class node_docui,node_billingui,node_reportui,node_doctors,node_docctrl toneRose
class node_server,node_authroutes,node_approutes,node_patientapproutes,node_presroutes,node_patientpresroutes,node_docroutes,node_patient,node_admin,node_emailservice toneIndigo
```

## Components

### Web application

- [Web router](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/App.jsx): `FRONTEND/src/App.jsx`
- [Auth screens](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Authentication/Login.jsx): `FRONTEND/src/Authentication/Login.jsx`
- [Patient dashboard](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/UserPanel.jsx): `FRONTEND/src/Patient/UserPanel.jsx`
- [Admin dashboard](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/AdminPanel.jsx): `FRONTEND/src/Admin/AdminPanel.jsx`

### Identity

- [Auth routes](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/authRoutes.js): `BACKEND/Routes/authRoutes.js`
- [Auth controller](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/authController.js): `BACKEND/Controller/authController.js`
- [User records](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/userModel.js): `BACKEND/Schema/userModel.js`
- [Email delivery](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Database/nodeMailer.js): `BACKEND/Database/nodeMailer.js`

### Care workflows

- [Appointment screens](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/Appointment/Appointment.jsx): `FRONTEND/src/Patient/Appointment/Appointment.jsx`
- [Prescription screens](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Patient/Prescription/Prescription.jsx): `FRONTEND/src/Patient/Prescription/Prescription.jsx`
- [Appointment controller](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/appointmentController.js): `BACKEND/Controller/appointmentController.js`
- [Patient appointment controller](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/patientAppointmentController.js): `BACKEND/Controller/patientAppointmentController.js`
- [Prescription controller](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/prescriptionController.js): `BACKEND/Controller/prescriptionController.js`
- [Patient prescription controller](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/patientPrescriptionController.js): `BACKEND/Controller/patientPrescriptionController.js`
- [Appointment records](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/appointmentSchema.js): `BACKEND/Schema/appointmentSchema.js`
- [Patient appointment records](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/patientAppointmentSchema.js): `BACKEND/Schema/patientAppointmentSchema.js`
- [Prescription records](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Schema/prescriptionSchema.js): `BACKEND/Schema/prescriptionSchema.js`

### Practice operations

- [Health records and documents](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Records/HealthRecords.jsx): `FRONTEND/src/Admin/Records/HealthRecords.jsx`
- [Billing and insurance](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Billing/CreateInvoice.jsx): `FRONTEND/src/Admin/Billing/CreateInvoice.jsx`
- [Reports and analytics](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Reports/Overview.jsx): `FRONTEND/src/Admin/Reports/Overview.jsx`
- [Doctor management](https://github.com/suvam-das-29/healthsync/blob/main/FRONTEND/src/Admin/Pages/DoctorList.jsx): `FRONTEND/src/Admin/Pages/DoctorList.jsx`
- [Document controller](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Controller/documentController.js): `BACKEND/Controller/documentController.js`

### API runtime

- [API server](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/index.js): `BACKEND/index.js`
- [Authentication endpoints](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/authRoutes.js): `BACKEND/Routes/authRoutes.js`
- [Appointment endpoints](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/appointmentRoutes.js): `BACKEND/Routes/appointmentRoutes.js`
- [Patient appointment endpoints](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/patientAppointmentRoutes.js): `BACKEND/Routes/patientAppointmentRoutes.js`
- [Prescription endpoints](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/prescriptionRoutes.js): `BACKEND/Routes/prescriptionRoutes.js`
- [Patient prescription endpoints](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/patientPrescriptionRoutes.js): `BACKEND/Routes/patientPrescriptionRoutes.js`
- [Document endpoints](https://github.com/suvam-das-29/healthsync/blob/main/BACKEND/Routes/documentRoutes.js): `BACKEND/Routes/documentRoutes.js`

### Other components

- **Patient**
- **Administrator**
- **MongoDB**
- **Email service**

## Connections

- Patient → Web router: uses
- Administrator → Web router: uses
- Web router → Auth screens: routes to
- Web router → Patient dashboard: routes to
- Web router → Admin dashboard: routes to
- Auth screens → Authentication endpoints: authenticates via
- Patient dashboard → Appointment screens: opens
- Patient dashboard → Prescription screens: opens
- API server → Authentication endpoints: mounts
- API server → Appointment endpoints: mounts
- API server → Patient appointment endpoints: mounts
- API server → Prescription endpoints: mounts
- API server → Patient prescription endpoints: mounts
- API server → Document endpoints: mounts
- Authentication endpoints → Auth controller: dispatches
- Auth controller → User records: reads and writes
- Auth controller → Email delivery: sends through
- Email delivery → Email service: delivers email
- Appointment endpoints → Appointment controller: dispatches
- Appointment controller → Appointment records: reads and writes
- Patient appointment endpoints → Patient appointment controller: dispatches
- Patient appointment controller → Patient appointment records: reads and writes
- Prescription endpoints → Prescription controller: dispatches
- Prescription controller → Prescription records: reads and writes
- Patient prescription endpoints → Patient prescription controller: dispatches
- Patient prescription controller → Prescription records: reads
- Document endpoints → Document controller: dispatches
- User records → MongoDB: persists in
- Appointment records → MongoDB: persists in
- Patient appointment records → MongoDB: persists in
- Prescription records → MongoDB: persists in
