# devenmundada/healthcare-plus architecture

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

- Interactive diagram: https://gitdiagram.com/devenmundada/healthcare-plus
- Repository: https://github.com/devenmundada/healthcare-plus

## Overview

Healthcare+ is a full-stack Indian healthcare platform: patients browse hospitals and doctors, ask for medical guidance, authenticate, and access appointments and patient features; hospital-facing screens support bed and operational workflows. The README documents a React frontend, Express APIs, PostgreSQL, and local Ollama. The tree contains both a legacy backend and a larger TypeScript backend, so the graph represents both where evidence supports them. Some listed capabilities (including metrics, image analysis, and real-time operations) are represented by their source subsystems, but unsampled implementation details and connections are not assumed.

Main entry points: [`backend/server.js`](https://github.com/devenmundada/healthcare-plus/blob/main/backend/server.js) (Express API), [`frontend/src/App.tsx`](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/App.tsx) (React application), [`backend/controllers/appointment.controller.js`](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/appointment.controller.js) (Appointment booking), [`backend/src/controllers/hospitals.controller.ts`](https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/controllers/hospitals.controller.ts) (Hospital search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Patient and Staff UI"]
  node_webapp["React application<br/>[App.tsx]"]
  node_hospital_finder["Hospital locator<br/>[MapPrediction.tsx]"]
  node_doctor_directory["Doctor directory<br/>[Doctors.tsx]"]
  node_chat_ui["AI chat<br/>[Chat.tsx]"]
  node_image_ui["Image analysis UI<br/>[ImageAnalysis.tsx]"]
  node_patient_portal["Patient portal<br/>[Portal.tsx]"]
  node_staff_dashboard["Hospital dashboard<br/>[index.tsx]"]
end

subgraph group_api["API and Workflows"]
  node_express_api["Express API<br/>[server.js]"]
  node_auth_controller["Authentication<br/>[auth.controller.js]"]
  node_appointments["Appointment booking"]
  node_hospital_search["Hospital search"]
  node_clinical_services["Clinical and operations APIs<br/>[app.ts]"]
  node_legacy_image_analysis["Medical image analysis"]
  node_legacy_voice_analysis["Voice analysis<br/>[voice_analysis.py]"]
end

subgraph group_data["Healthcare Data"]
  node_postgres[("PostgreSQL<br/>[database.config.ts]")]
  node_hospital_entity["Hospital records<br/>[Hospital.entity.ts]"]
  node_doctor_entity["Doctor records<br/>[Doctor.entity.ts]"]
  node_legacy_hospital_model["Indian hospital model<br/>[IndianHospital.js]"]
  node_legacy_doctor_model["Doctor model<br/>[Doctor.js]"]
  node_legacy_user_model["User model<br/>[User.js]"]
  node_legacy_appointment_model["Appointment model<br/>[Appointment.js]"]
end

subgraph group_integrations["AI and External Services"]
  node_ollama["Local Ollama"]
  node_openstreetmap["OpenStreetMap services"]
  node_google_calendar["Google Calendar / Meet"]
end

node_browser(("Browser user"))

node_browser -->|"uses"| node_webapp
node_webapp -->|"requests data"| node_express_api
node_webapp -.->|"fallback AI"| node_ollama
node_webapp -->|"opens"| node_hospital_finder
node_webapp -->|"opens"| node_doctor_directory
node_webapp -->|"opens"| node_chat_ui
node_webapp -->|"opens"| node_image_ui
node_webapp -->|"routes to"| node_patient_portal
node_webapp -->|"routes to"| node_staff_dashboard
node_express_api -->|"registers routes"| node_auth_controller
node_express_api -->|"registers routes"| node_appointments
node_express_api -.->|"registers routes"| node_hospital_search
node_express_api -.->|"serves APIs"| node_clinical_services
node_express_api -.->|"invokes analysis"| node_legacy_image_analysis
node_express_api -.->|"invokes analysis"| node_legacy_voice_analysis
node_auth_controller -->|"creates and looks up"| node_legacy_user_model
node_appointments -->|"checks doctor"| node_legacy_doctor_model
node_appointments -->|"checks and saves"| node_legacy_appointment_model
node_appointments -->|"generates meeting link"| node_google_calendar
node_hospital_search -->|"queries"| node_hospital_entity
node_hospital_search -->|"geocodes and supplements"| node_openstreetmap
node_clinical_services -->|"connects to"| node_postgres
node_clinical_services -.->|"proxies AI"| node_ollama
node_hospital_finder -.->|"searches hospitals"| node_express_api
node_doctor_directory -.->|"requests doctors"| node_express_api
node_chat_ui -.->|"sends prompts"| node_express_api
node_image_ui -.->|"submits images"| node_express_api
node_patient_portal -.->|"requests patient data"| node_express_api
node_staff_dashboard -.->|"requests operations data"| node_express_api
node_postgres -.->|"stores"| node_hospital_entity
node_postgres -.->|"stores"| node_doctor_entity
node_legacy_hospital_model -.->|"used by search"| node_express_api

click node_webapp "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/App.tsx"
click node_hospital_finder "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/MapPrediction.tsx"
click node_doctor_directory "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/Doctors.tsx"
click node_chat_ui "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/Chat.tsx"
click node_image_ui "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/ImageAnalysis.tsx"
click node_patient_portal "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/patient/Portal.tsx"
click node_staff_dashboard "https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/Dashboard/index.tsx"
click node_express_api "https://github.com/devenmundada/healthcare-plus/blob/main/backend/server.js"
click node_auth_controller "https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/auth.controller.js"
click node_appointments "https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/appointment.controller.js"
click node_hospital_search "https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/controllers/hospitals.controller.ts"
click node_clinical_services "https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/app.ts"
click node_legacy_image_analysis "https://github.com/devenmundada/healthcare-plus/blob/main/backend/services/medical_image_analysis.py"
click node_legacy_voice_analysis "https://github.com/devenmundada/healthcare-plus/blob/main/backend/services/voice_analysis.py"
click node_postgres "https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/config/database.config.ts"
click node_hospital_entity "https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/entities/Hospital.entity.ts"
click node_doctor_entity "https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/entities/Doctor.entity.ts"
click node_legacy_hospital_model "https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/IndianHospital.js"
click node_legacy_doctor_model "https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/Doctor.js"
click node_legacy_user_model "https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/User.js"
click node_legacy_appointment_model "https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/Appointment.js"
click node_google_calendar "https://github.com/devenmundada/healthcare-plus/blob/main/backend/services/google-calendar.service.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_hospital_finder,node_doctor_directory,node_chat_ui,node_image_ui,node_patient_portal,node_staff_dashboard,node_browser toneBlue
class node_express_api,node_auth_controller,node_appointments,node_hospital_search,node_clinical_services,node_legacy_image_analysis,node_legacy_voice_analysis toneAmber
class node_postgres,node_hospital_entity,node_doctor_entity,node_legacy_hospital_model,node_legacy_doctor_model,node_legacy_user_model,node_legacy_appointment_model toneMint
class node_ollama,node_openstreetmap,node_google_calendar toneRose
```

## Components

### Patient and Staff UI

- [React application](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Hospital locator](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/MapPrediction.tsx): `frontend/src/pages/MapPrediction.tsx`
- [Doctor directory](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/Doctors.tsx): `frontend/src/pages/Doctors.tsx`
- [AI chat](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/Chat.tsx): `frontend/src/pages/Chat.tsx`
- [Image analysis UI](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/ImageAnalysis.tsx): `frontend/src/pages/ImageAnalysis.tsx`
- [Patient portal](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/patient/Portal.tsx): `frontend/src/pages/patient/Portal.tsx`
- [Hospital dashboard](https://github.com/devenmundada/healthcare-plus/blob/main/frontend/src/pages/Dashboard/index.tsx): `frontend/src/pages/Dashboard/index.tsx`

### API and Workflows

- [Express API](https://github.com/devenmundada/healthcare-plus/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/auth.controller.js): `backend/controllers/auth.controller.js`
- [Appointment booking](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/appointment.controller.js): `backend/controllers/appointment.controller.js`
- [Hospital search](https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/controllers/hospitals.controller.ts): `backend/src/controllers/hospitals.controller.ts`
- [Clinical and operations APIs](https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Medical image analysis](https://github.com/devenmundada/healthcare-plus/blob/main/backend/services/medical_image_analysis.py): `backend/services/medical_image_analysis.py`
- [Voice analysis](https://github.com/devenmundada/healthcare-plus/blob/main/backend/services/voice_analysis.py): `backend/services/voice_analysis.py`

### Healthcare Data

- [PostgreSQL](https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/config/database.config.ts): `backend/src/config/database.config.ts`
- [Hospital records](https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/entities/Hospital.entity.ts): `backend/src/entities/Hospital.entity.ts`
- [Doctor records](https://github.com/devenmundada/healthcare-plus/blob/main/backend/src/entities/Doctor.entity.ts): `backend/src/entities/Doctor.entity.ts`
- [Indian hospital model](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/IndianHospital.js): `backend/controllers/models/IndianHospital.js`
- [Doctor model](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/Doctor.js): `backend/controllers/models/Doctor.js`
- [User model](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/User.js): `backend/controllers/models/User.js`
- [Appointment model](https://github.com/devenmundada/healthcare-plus/blob/main/backend/controllers/models/Appointment.js): `backend/controllers/models/Appointment.js`

### AI and External Services

- **Local Ollama**
- **OpenStreetMap services**
- [Google Calendar / Meet](https://github.com/devenmundada/healthcare-plus/blob/main/backend/services/google-calendar.service.js): `backend/services/google-calendar.service.js`

### Other components

- **Browser user**

## Connections

- Browser user → React application: uses
- React application → Express API: requests data
- React application → Local Ollama: fallback AI
- React application → Hospital locator: opens (evidence: `frontend/src/App.tsx`)
- React application → Doctor directory: opens (evidence: `frontend/src/App.tsx`)
- React application → AI chat: opens (evidence: `frontend/src/App.tsx`)
- React application → Image analysis UI: opens (evidence: `frontend/src/App.tsx`)
- React application → Patient portal: routes to (evidence: `frontend/src/App.tsx`)
- React application → Hospital dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Express API → Authentication: registers routes (evidence: `backend/server.js`)
- Express API → Appointment booking: registers routes (evidence: `backend/server.js`)
- Express API → Hospital search: registers routes
- Express API → Clinical and operations APIs: serves APIs
- Express API → Medical image analysis: invokes analysis
- Express API → Voice analysis: invokes analysis
- Authentication → User model: creates and looks up (evidence: `backend/controllers/auth.controller.js`)
- Appointment booking → Doctor model: checks doctor (evidence: `backend/controllers/appointment.controller.js`)
- Appointment booking → Appointment model: checks and saves (evidence: `backend/controllers/appointment.controller.js`)
- Appointment booking → Google Calendar / Meet: generates meeting link (evidence: `backend/controllers/appointment.controller.js`)
- Hospital search → Hospital records: queries (evidence: `backend/src/controllers/hospitals.controller.ts`)
- Hospital search → OpenStreetMap services: geocodes and supplements (evidence: `backend/src/controllers/hospitals.controller.ts`)
- Clinical and operations APIs → PostgreSQL: connects to (evidence: `backend/src/app.ts`)
- Clinical and operations APIs → Local Ollama: proxies AI
- Hospital locator → Express API: searches hospitals
- Doctor directory → Express API: requests doctors
- AI chat → Express API: sends prompts
- Image analysis UI → Express API: submits images (evidence: `backend/server.js`)
- Patient portal → Express API: requests patient data
- Hospital dashboard → Express API: requests operations data
- PostgreSQL → Hospital records: stores
- PostgreSQL → Doctor records: stores (evidence: `backend/src/services/auth.service.ts`)
- Indian hospital model → Express API: used by search
