# indhumathi2906/medivault-prescription-for-healthcare-systems architecture

> Architecture diagram of the GitHub repository indhumathi2906/medivault-prescription-for-healthcare-systems, 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/indhumathi2906/medivault-prescription-for-healthcare-systems
- Repository: https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems

## Overview

MEDIVAULT is a role-based healthcare platform for patient records, appointments, consultations, prescriptions, and longitudinal health tracking. The principal workflow is a doctor reviewing a patient and recording a progress assessment; the patient then views comparisons and trends. The graph also covers doctor discovery and booking, clinical records, notifications, and administration. Controller/service links are shown where supported by sampled code; other feature branches follow the documented route and module structure, so their internal wiring is not expanded.

Main entry points: [`server.ts`](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server.ts) (API host), [`src/App.tsx`](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/src/App.tsx) (Routes and roles), [`server/config/db.ts`](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/config/db.ts) (Application data store), [`src/services/api.ts`](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/src/services/api.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Role-based client"]
  node_app["Routes and roles<br/>[App.tsx]"]
  node_patient_ui["Patient pages"]
  node_doctor_ui["Doctor pages"]
  node_admin_ui["Admin pages"]
  node_public_ui["Public access"]
  node_api_client["HTTP client<br/>[api.ts]"]
end

subgraph group_api["Healthcare API"]
  node_server["API host<br/>[server.ts]"]
  node_patient_routes["Patient routes<br/>[patientRoutes.ts]"]
  node_doctor_routes["Doctor routes<br/>[doctorRoutes.ts]"]
  node_progress_routes["Progress routes<br/>[progressRoutes.ts]"]
  node_appointment_routes["Appointment routes"]
  node_consultation_routes["Consultation routes"]
  node_prescription_routes["Prescription routes"]
  node_notification_routes["Notification routes"]
  node_admin_routes["Admin routes<br/>[adminRoutes.ts]"]
  node_auth_routes["Auth routes<br/>[authRoutes.ts]"]
end

subgraph group_clinical["Clinical workflow"]
  node_patient_controller["Patient records"]
  node_doctor_controller["Doctor directory"]
  node_appointment_controller["Appointment booking"]
  node_consultation_controller["Consultations"]
  node_prescription_controller["Prescriptions"]
  node_progress_controller["Progress reviews"]
  node_progress_service["Metric analysis<br/>[progressService.ts]"]
  node_notifications_controller["Notifications"]
end

subgraph group_platform["Identity and oversight"]
  node_auth_controller["Authentication<br/>[authController.ts]"]
  node_middleware["Access controls<br/>[auth.ts]"]
  node_admin_controller["Platform oversight<br/>[adminController.ts]"]
  node_store[("Application data store<br/>[db.ts]")]
end

node_patient(("Patient"))
node_doctor(("Doctor"))
node_admin(("Administrator"))
node_supabase[("Supabase PostgreSQL")]

node_patient -->|"opens"| node_app
node_doctor -->|"opens"| node_app
node_admin -->|"opens"| node_app
node_app -->|"routes"| node_patient_ui
node_app -->|"routes"| node_doctor_ui
node_app -->|"routes"| node_admin_ui
node_app -->|"routes"| node_public_ui
node_patient_ui -->|"requests"| node_api_client
node_doctor_ui -->|"requests"| node_api_client
node_admin_ui -->|"requests"| node_api_client
node_public_ui -->|"requests"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_patient_routes
node_server -->|"mounts"| node_doctor_routes
node_server -->|"mounts"| node_progress_routes
node_server -->|"mounts"| node_appointment_routes
node_server -->|"mounts"| node_consultation_routes
node_server -->|"mounts"| node_prescription_routes
node_server -->|"mounts"| node_notification_routes
node_server -->|"mounts"| node_admin_routes
node_server -->|"mounts"| node_auth_routes
node_patient_routes -->|"dispatches"| node_patient_controller
node_doctor_routes -->|"dispatches"| node_doctor_controller
node_progress_routes -->|"dispatches"| node_progress_controller
node_appointment_routes -->|"dispatches"| node_appointment_controller
node_consultation_routes -->|"dispatches"| node_consultation_controller
node_prescription_routes -->|"dispatches"| node_prescription_controller
node_notification_routes -->|"dispatches"| node_notifications_controller
node_admin_routes -->|"dispatches"| node_admin_controller
node_auth_routes -->|"dispatches"| node_auth_controller
node_progress_controller -->|"calculates"| node_progress_service
node_patient_controller -->|"compares progress"| node_progress_service
node_doctor_controller -->|"reads progress"| node_progress_service
node_patient_controller -->|"reads records"| node_store
node_appointment_controller -->|"reads and writes"| node_store
node_progress_controller -->|"appends reviews"| node_store
node_progress_service -->|"reads reviews"| node_store
node_auth_controller -->|"reads and writes"| node_store
node_middleware -->|"guards"| node_auth_routes
node_middleware -->|"guards"| node_patient_routes
node_middleware -->|"guards"| node_progress_routes
node_store -.->|"optional persistence"| node_supabase

click node_app "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/src/App.tsx"
click node_patient_ui "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/patient"
click node_doctor_ui "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/doctor"
click node_admin_ui "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/admin"
click node_public_ui "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/public"
click node_api_client "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/src/services/api.ts"
click node_server "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server.ts"
click node_patient_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/patientRoutes.ts"
click node_doctor_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/doctorRoutes.ts"
click node_progress_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/progressRoutes.ts"
click node_appointment_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/appointmentRoutes.ts"
click node_consultation_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/consultationRoutes.ts"
click node_prescription_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/prescriptionRoutes.ts"
click node_notification_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/notificationRoutes.ts"
click node_admin_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/adminRoutes.ts"
click node_patient_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/patientController.ts"
click node_doctor_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/doctorController.ts"
click node_appointment_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/appointmentController.ts"
click node_consultation_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/consultationController.ts"
click node_prescription_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/prescriptionController.ts"
click node_progress_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/progressController.ts"
click node_progress_service "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/services/progressService.ts"
click node_notifications_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/notificationController.ts"
click node_auth_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/authController.ts"
click node_auth_routes "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/authRoutes.ts"
click node_middleware "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/middleware/auth.ts"
click node_admin_controller "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/adminController.ts"
click node_store "https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/config/db.ts"

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_app,node_patient_ui,node_doctor_ui,node_admin_ui,node_public_ui,node_api_client toneBlue
class node_server,node_patient_routes,node_doctor_routes,node_progress_routes,node_appointment_routes,node_consultation_routes,node_prescription_routes,node_notification_routes,node_admin_routes,node_auth_routes,node_supabase toneAmber
class node_patient_controller,node_doctor_controller,node_appointment_controller,node_consultation_controller,node_prescription_controller,node_progress_controller,node_progress_service,node_notifications_controller toneMint
class node_auth_controller,node_middleware,node_admin_controller,node_store toneRose
class node_patient,node_doctor,node_admin toneIndigo
```

## Components

### Role-based client

- [Routes and roles](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/src/App.tsx): `src/App.tsx`
- [Patient pages](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/patient): `src/pages/patient`
- [Doctor pages](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/doctor): `src/pages/doctor`
- [Admin pages](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/admin): `src/pages/admin`
- [Public access](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/tree/main/src/pages/public): `src/pages/public`
- [HTTP client](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/src/services/api.ts): `src/services/api.ts`

### Healthcare API

- [API host](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server.ts): `server.ts`
- [Patient routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/patientRoutes.ts): `server/routes/patientRoutes.ts`
- [Doctor routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/doctorRoutes.ts): `server/routes/doctorRoutes.ts`
- [Progress routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/progressRoutes.ts): `server/routes/progressRoutes.ts`
- [Appointment routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/appointmentRoutes.ts): `server/routes/appointmentRoutes.ts`
- [Consultation routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/consultationRoutes.ts): `server/routes/consultationRoutes.ts`
- [Prescription routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/prescriptionRoutes.ts): `server/routes/prescriptionRoutes.ts`
- [Notification routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/notificationRoutes.ts): `server/routes/notificationRoutes.ts`
- [Admin routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/adminRoutes.ts): `server/routes/adminRoutes.ts`
- [Auth routes](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/routes/authRoutes.ts): `server/routes/authRoutes.ts`

### Clinical workflow

- [Patient records](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/patientController.ts): `server/controllers/patientController.ts`
- [Doctor directory](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/doctorController.ts): `server/controllers/doctorController.ts`
- [Appointment booking](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/appointmentController.ts): `server/controllers/appointmentController.ts`
- [Consultations](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/consultationController.ts): `server/controllers/consultationController.ts`
- [Prescriptions](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/prescriptionController.ts): `server/controllers/prescriptionController.ts`
- [Progress reviews](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/progressController.ts): `server/controllers/progressController.ts`
- [Metric analysis](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/services/progressService.ts): `server/services/progressService.ts`
- [Notifications](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/notificationController.ts): `server/controllers/notificationController.ts`

### Identity and oversight

- [Authentication](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/authController.ts): `server/controllers/authController.ts`
- [Access controls](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/middleware/auth.ts): `server/middleware/auth.ts`
- [Platform oversight](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/controllers/adminController.ts): `server/controllers/adminController.ts`
- [Application data store](https://github.com/indhumathi2906/medivault-prescription-for-healthcare-systems/blob/main/server/config/db.ts): `server/config/db.ts`

### Other components

- **Patient**
- **Doctor**
- **Administrator**
- **Supabase PostgreSQL**

## Connections

- Patient → Routes and roles: opens
- Doctor → Routes and roles: opens
- Administrator → Routes and roles: opens
- Routes and roles → Patient pages: routes
- Routes and roles → Doctor pages: routes
- Routes and roles → Admin pages: routes
- Routes and roles → Public access: routes
- Patient pages → HTTP client: requests
- Doctor pages → HTTP client: requests
- Admin pages → HTTP client: requests
- Public access → HTTP client: requests
- HTTP client → API host: HTTP requests
- API host → Patient routes: mounts
- API host → Doctor routes: mounts
- API host → Progress routes: mounts
- API host → Appointment routes: mounts
- API host → Consultation routes: mounts
- API host → Prescription routes: mounts
- API host → Notification routes: mounts
- API host → Admin routes: mounts
- API host → Auth routes: mounts
- Patient routes → Patient records: dispatches
- Doctor routes → Doctor directory: dispatches
- Progress routes → Progress reviews: dispatches
- Appointment routes → Appointment booking: dispatches
- Consultation routes → Consultations: dispatches
- Prescription routes → Prescriptions: dispatches
- Notification routes → Notifications: dispatches
- Admin routes → Platform oversight: dispatches
- Auth routes → Authentication: dispatches
- Progress reviews → Metric analysis: calculates
- Patient records → Metric analysis: compares progress
- Doctor directory → Metric analysis: reads progress
- Patient records → Application data store: reads records
- Appointment booking → Application data store: reads and writes
- Progress reviews → Application data store: appends reviews
- Metric analysis → Application data store: reads reviews
- Authentication → Application data store: reads and writes
- Access controls → Auth routes: guards
- Access controls → Patient routes: guards
- Access controls → Progress routes: guards
- Application data store → Supabase PostgreSQL: optional persistence
