# chahak235/heathcare-plus architecture

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

- Interactive diagram: https://gitdiagram.com/chahak235/heathcare-plus
- Repository: https://github.com/chahak235/heathcare-plus

## Overview

Healthcare+ is a React healthcare portal backed by Node/Express services and PostgreSQL. The main user journey is finding Indian hospitals or doctors, consulting the AI assistant, and—where enabled—booking care; authentication supports protected patient and hospital experiences. The repository also contains emergency, bed/admission operations, notifications, voice, and medical-image analysis capabilities. The README documents the frontend-to-backend, backend-to-database, and backend-to-Groq relationships; several additional subsystems are represented from the tree, but their wiring is not established by the excerpts.

Main entry points: [`frontend/src/App.tsx`](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/App.tsx) (Web Application), [`backend/src/app.ts`](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/app.ts) (Express API), [`frontend/src/pages/Home.tsx`](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Home.tsx) (Home & Portal), [`frontend/src/pages/MapPrediction.tsx`](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/MapPrediction.tsx) (Hospital Finder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Patient Web App"]
  node_webapp["Web Application<br/>[App.tsx]"]
  node_home["Home &amp; Portal<br/>[Home.tsx]"]
end

subgraph group_care["Care Discovery"]
  node_hospitalfinder["Hospital Finder<br/>[MapPrediction.tsx]"]
  node_hospitaldata["Hospital Directory"]
  node_doctorfinder["Doctor Directory<br/>[Doctors.tsx]"]
  node_doctorsapi["Doctor Services<br/>[doctors.service.ts]"]
  node_assistant["AI Assistant<br/>[Chat.tsx]"]
  node_aiapi["AI API<br/>[ai.routes.ts]"]
  node_booking["Appointment Booking"]
  node_appointmentapi["Appointment Services"]
  node_imageanalysis["Image Analysis"]
  node_voiceanalysis["Voice Analysis<br/>[voice_analysis.py]"]
end

subgraph group_operations["Care Operations"]
  node_patientprofile["Patient Profile<br/>[Patient.entity.ts]"]
  node_emergency["Emergency Response"]
  node_beds["Beds &amp; Admissions<br/>[beds.controller.ts]"]
  node_triage["Triage"]
  node_notifications["Notifications"]
end

subgraph group_platform["Backend Platform"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_api["Express API<br/>[app.ts]"]
  node_database[("PostgreSQL<br/>[database.config.ts]")]
  node_legacyapi["Legacy API<br/>[server.js]"]
  node_legacydb[("Legacy PostgreSQL<br/>[database.js]")]
end

node_patient(("Patient"))
node_groq{{"Groq AI"}}

node_patient -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_home
node_webapp -->|"requests data"| node_api
node_api -->|"reads and writes"| node_database
node_api -->|"requests AI"| node_groq
node_webapp -->|"routes to"| node_hospitalfinder
node_webapp -->|"routes to"| node_doctorfinder
node_webapp -->|"routes to"| node_assistant
node_webapp -.->|"offers booking"| node_booking
node_api -.->|"parallel API"| node_legacyapi

click node_webapp "https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Home.tsx"
click node_hospitalfinder "https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/MapPrediction.tsx"
click node_hospitaldata "https://github.com/chahak235/heathcare-plus/blob/main/backend/controllers/indian-hospitals.controller.js"
click node_doctorfinder "https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Doctors.tsx"
click node_doctorsapi "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/doctors.service.ts"
click node_assistant "https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Chat.tsx"
click node_aiapi "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/routes/ai.routes.ts"
click node_booking "https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/components/features/appointment/AppointmentBookingModal.tsx"
click node_appointmentapi "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/appointment.service.ts"
click node_auth "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/auth.service.ts"
click node_patientprofile "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/entities/Patient.entity.ts"
click node_emergency "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/routes/emergency.routes.ts"
click node_beds "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/controllers/beds.controller.ts"
click node_triage "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/controllers/triage.controller.ts"
click node_notifications "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/notification.service.ts"
click node_imageanalysis "https://github.com/chahak235/heathcare-plus/blob/main/backend/services/medical_image_analysis.py"
click node_voiceanalysis "https://github.com/chahak235/heathcare-plus/blob/main/backend/services/voice_analysis.py"
click node_api "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/app.ts"
click node_database "https://github.com/chahak235/heathcare-plus/blob/main/backend/src/config/database.config.ts"
click node_legacyapi "https://github.com/chahak235/heathcare-plus/blob/main/backend/server.js"
click node_legacydb "https://github.com/chahak235/heathcare-plus/blob/main/backend/config/database.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_home toneBlue
class node_hospitalfinder,node_hospitaldata,node_doctorfinder,node_doctorsapi,node_assistant,node_aiapi,node_booking,node_appointmentapi,node_imageanalysis,node_voiceanalysis toneAmber
class node_patientprofile,node_emergency,node_beds,node_triage,node_notifications toneMint
class node_auth,node_api,node_database,node_legacyapi,node_legacydb toneRose
class node_patient,node_groq toneIndigo
```

## Components

### Patient Web App

- [Web Application](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Home & Portal](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Home.tsx): `frontend/src/pages/Home.tsx`

### Care Discovery

- [Hospital Finder](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/MapPrediction.tsx): `frontend/src/pages/MapPrediction.tsx`
- [Hospital Directory](https://github.com/chahak235/heathcare-plus/blob/main/backend/controllers/indian-hospitals.controller.js): `backend/controllers/indian-hospitals.controller.js`
- [Doctor Directory](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Doctors.tsx): `frontend/src/pages/Doctors.tsx`
- [Doctor Services](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/doctors.service.ts): `backend/src/services/doctors.service.ts`
- [AI Assistant](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/pages/Chat.tsx): `frontend/src/pages/Chat.tsx`
- [AI API](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/routes/ai.routes.ts): `backend/src/routes/ai.routes.ts`
- [Appointment Booking](https://github.com/chahak235/heathcare-plus/blob/main/frontend/src/components/features/appointment/AppointmentBookingModal.tsx): `frontend/src/components/features/appointment/AppointmentBookingModal.tsx`
- [Appointment Services](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/appointment.service.ts): `backend/src/services/appointment.service.ts`
- [Image Analysis](https://github.com/chahak235/heathcare-plus/blob/main/backend/services/medical_image_analysis.py): `backend/services/medical_image_analysis.py`
- [Voice Analysis](https://github.com/chahak235/heathcare-plus/blob/main/backend/services/voice_analysis.py): `backend/services/voice_analysis.py`

### Care Operations

- [Patient Profile](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/entities/Patient.entity.ts): `backend/src/entities/Patient.entity.ts`
- [Emergency Response](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/routes/emergency.routes.ts): `backend/src/routes/emergency.routes.ts`
- [Beds & Admissions](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/controllers/beds.controller.ts): `backend/src/controllers/beds.controller.ts`
- [Triage](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/controllers/triage.controller.ts): `backend/src/controllers/triage.controller.ts`
- [Notifications](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/notification.service.ts): `backend/src/services/notification.service.ts`

### Backend Platform

- [Authentication](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/services/auth.service.ts): `backend/src/services/auth.service.ts`
- [Express API](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [PostgreSQL](https://github.com/chahak235/heathcare-plus/blob/main/backend/src/config/database.config.ts): `backend/src/config/database.config.ts`
- [Legacy API](https://github.com/chahak235/heathcare-plus/blob/main/backend/server.js): `backend/server.js`
- [Legacy PostgreSQL](https://github.com/chahak235/heathcare-plus/blob/main/backend/config/database.js): `backend/config/database.js`

### Other components

- **Patient**
- **Groq AI**

## Connections

- Patient → Web Application: uses (evidence: `README.md`)
- Web Application → Home & Portal: routes to (evidence: `frontend/src/App.tsx`)
- Web Application → Express API: requests data (evidence: `README.md`)
- Express API → PostgreSQL: reads and writes (evidence: `README.md`)
- Express API → Groq AI: requests AI (evidence: `README.md`)
- Web Application → Hospital Finder: routes to (evidence: `frontend/src/App.tsx`)
- Web Application → Doctor Directory: routes to (evidence: `frontend/src/App.tsx`)
- Web Application → AI Assistant: routes to (evidence: `frontend/src/App.tsx`)
- Web Application → Appointment Booking: offers booking (evidence: `README.md`)
- Express API → Legacy API: parallel API
