# shanmukanukala/smartcare-health-portal architecture

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

- Interactive diagram: https://gitdiagram.com/shanmukanukala/smartcare-health-portal
- Repository: https://github.com/shanmukanukala/smartcare-health-portal

## Overview

Smart Healthcare Portal is a browser-based patient registration and appointment-booking application backed by Express and MongoDB. Patients use the portal to register, browse doctors, check appointment availability, and book consultations; the portal also offers health news and a multilingual AI assistant. The map separates these user-facing capabilities from their server-side routes, persistence models, and external integrations. Several links are supported by README documentation because the relevant source excerpts are incomplete; unsampled implementation details are not inferred.

Main entry points: [`app.js`](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/app.js) (Portal client), [`smart_healthcare.html`](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/smart_healthcare.html) (Healthcare portal), [`server.js`](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js) (REST API server), [`models/Patient.js`](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/models/Patient.js) (Patient model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Portal experience"]
  node_portal_ui["Healthcare portal"]
  node_client["Portal client<br/>[app.js]"]
  node_styles["Responsive design<br/>[style.css]"]
end

subgraph group_care["Patient care workflows"]
  node_registration["Patient registration<br/>[server.js]"]
  node_doctor_catalog["Doctor catalog"]
  node_availability["Slot availability<br/>[server.js]"]
  node_booking["Appointment booking<br/>[server.js]"]
  node_receipt["Booking receipt<br/>[app.js]"]
end

subgraph group_backend["Backend services"]
  node_api["REST API server<br/>[server.js]"]
  node_ai_chat["AI assistant<br/>[server.js]"]
  node_health_news["Health news<br/>[server.js]"]
end

subgraph group_data["Data and integrations"]
  node_patient_model["Patient model<br/>[Patient.js]"]
  node_appointment_model["Appointment model<br/>[Appointment.js]"]
  node_mongo[("MongoDB")]
  node_gemini["Google Gemini"]
  node_newsapi["NewsAPI"]
end

node_patient(("Patient"))

node_patient -->|"uses"| node_portal_ui
node_portal_ui -->|"loads"| node_client
node_client -.->|"uses"| node_styles
node_portal_ui -->|"presents"| node_doctor_catalog
node_client -->|"submits"| node_registration
node_client -->|"checks slots"| node_availability
node_client -->|"submits booking"| node_booking
node_client -->|"creates"| node_receipt
node_api -->|"serves"| node_portal_ui
node_registration -.->|"reads/writes"| node_patient_model
node_api -->|"queries"| node_patient_model
node_availability -.->|"checks capacity"| node_appointment_model
node_booking -->|"stores booking"| node_appointment_model
node_patient_model -.->|"persists records"| node_mongo
node_appointment_model -.->|"persists bookings"| node_mongo
node_client -->|"sends chat"| node_ai_chat
node_ai_chat -->|"requests generation"| node_gemini
node_api -->|"routes news"| node_health_news
node_health_news -->|"fetches headlines"| node_newsapi

click node_portal_ui "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/smart_healthcare.html"
click node_client "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/app.js"
click node_styles "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/style.css"
click node_registration "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js"
click node_doctor_catalog "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/smart_healthcare.html"
click node_availability "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js"
click node_booking "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js"
click node_receipt "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/app.js"
click node_api "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js"
click node_ai_chat "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js"
click node_health_news "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js"
click node_patient_model "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/models/Patient.js"
click node_appointment_model "https://github.com/shanmukanukala/smartcare-health-portal/blob/main/models/Appointment.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_portal_ui,node_client,node_styles toneBlue
class node_registration,node_doctor_catalog,node_availability,node_booking,node_receipt toneAmber
class node_api,node_ai_chat,node_health_news toneMint
class node_patient_model,node_appointment_model,node_mongo,node_gemini,node_newsapi toneRose
class node_patient toneIndigo
```

## Components

### Portal experience

- [Healthcare portal](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/smart_healthcare.html): `smart_healthcare.html`
- [Portal client](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/app.js): `app.js`
- [Responsive design](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/style.css): `style.css`

### Patient care workflows

- [Patient registration](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js): `server.js`
- [Doctor catalog](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/smart_healthcare.html): `smart_healthcare.html`
- [Slot availability](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js): `server.js`
- [Appointment booking](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js): `server.js`
- [Booking receipt](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/app.js): `app.js`

### Backend services

- [REST API server](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js): `server.js`
- [AI assistant](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js): `server.js`
- [Health news](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/server.js): `server.js`

### Data and integrations

- [Patient model](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/models/Patient.js): `models/Patient.js`
- [Appointment model](https://github.com/shanmukanukala/smartcare-health-portal/blob/main/models/Appointment.js): `models/Appointment.js`
- **MongoDB**
- **Google Gemini**
- **NewsAPI**

### Other components

- **Patient**

## Connections

- Patient → Healthcare portal: uses (evidence: `README.md`)
- Healthcare portal → Portal client: loads (evidence: `README.md`)
- Portal client → Responsive design: uses
- Healthcare portal → Doctor catalog: presents (evidence: `README.md`)
- Portal client → Patient registration: submits (evidence: `README.md`)
- Portal client → Slot availability: checks slots (evidence: `app.js`)
- Portal client → Appointment booking: submits booking (evidence: `app.js`)
- Portal client → Booking receipt: creates (evidence: `app.js`)
- REST API server → Healthcare portal: serves (evidence: `server.js`)
- Patient registration → Patient model: reads/writes (evidence: `server.js`)
- REST API server → Patient model: queries (evidence: `server.js`)
- Slot availability → Appointment model: checks capacity (evidence: `server.js`)
- Appointment booking → Appointment model: stores booking (evidence: `server.js`)
- Patient model → MongoDB: persists records
- Appointment model → MongoDB: persists bookings
- Portal client → AI assistant: sends chat (evidence: `README.md`)
- AI assistant → Google Gemini: requests generation (evidence: `server.js`)
- REST API server → Health news: routes news (evidence: `server.js`)
- Health news → NewsAPI: fetches headlines (evidence: `server.js`)
