# rutikbajad/heathcare-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/rutikbajad/heathcare-dashboard
- Repository: https://github.com/rutikbajad/heathcare-dashboard

## Overview

This is a healthcare records and clinical-management web application with a browser UI and Flask backend. The main user workflow is sign-in, then role- and page-authorized access to patient records, appointments, disease references, and analytics; users can also search records and submit heart-risk assessments. The sampled backend shows account/session checks and MongoDB operations, while the frontend excerpt shows API requests and UI features. Backend and model internals are only partially sampled, so some subsystem boundaries and links remain unverified.

Main entry points: [`frontend/src/main.js`](https://github.com/rutikbajad/heathcare-dashboard/blob/main/frontend/src/main.js) (Portal interface), [`backend/app.py`](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py) (Accounts and access), [`ml/preprocessing.py`](https://github.com/rutikbajad/heathcare-dashboard/blob/main/ml/preprocessing.py) (Feature preprocessing), [`ml/heart_model.pkl`](https://github.com/rutikbajad/heathcare-dashboard/blob/main/ml/heart_model.pkl) (Heart model artifact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Portal interface<br/>[main.js]"]
  node_charting["Charts<br/>[main.js]"]
end

subgraph group_server["Application backend"]
  node_auth["Accounts and access<br/>[app.py]"]
  node_patient_api["Patient records<br/>[app.py]"]
  node_appointment_api["Appointments<br/>[app.py]"]
  node_disease_api["Disease records<br/>[app.py]"]
  node_user_api["Staff and users<br/>[app.py]"]
  node_analytics_api["Analytics metrics<br/>[app.py]"]
end

subgraph group_clinical["Clinical data"]
  node_mongo[("MongoDB")]
  node_health_data["Health datasets<br/>[diabetes.csv]"]
  node_heart_data["Heart dataset<br/>[heart.csv]"]
end

subgraph group_intelligence["Search and risk"]
  node_search_api["Record search<br/>[app.py]"]
  node_assessment_api["Risk assessments<br/>[app.py]"]
  node_preprocessor["Feature preprocessing<br/>[preprocessing.py]"]
  node_heart_model["Heart model artifact<br/>[heart_model.pkl]"]
end

node_user(("Healthcare user"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"requests API"| node_auth
node_webapp -.->|"requests API"| node_patient_api
node_webapp -.->|"requests API"| node_appointment_api
node_webapp -.->|"requests API"| node_disease_api
node_webapp -->|"posts search"| node_search_api
node_webapp -.->|"submits assessment"| node_assessment_api
node_webapp -->|"renders charts"| node_charting
node_auth -->|"reads sessions"| node_mongo
node_auth -->|"reads accounts"| node_mongo
node_patient_api -->|"writes patients"| node_mongo
node_appointment_api -->|"writes appointments"| node_mongo
node_disease_api -->|"checks diseases"| node_mongo
node_analytics_api -->|"reads metrics"| node_mongo
node_search_api -.->|"searches records"| node_mongo
node_assessment_api -.->|"stores assessments"| node_mongo
node_preprocessor -.->|"prepares features"| node_heart_model

click node_webapp "https://github.com/rutikbajad/heathcare-dashboard/blob/main/frontend/src/main.js"
click node_auth "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_patient_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_appointment_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_disease_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_user_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_analytics_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_search_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_assessment_api "https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py"
click node_charting "https://github.com/rutikbajad/heathcare-dashboard/blob/main/frontend/src/main.js"
click node_preprocessor "https://github.com/rutikbajad/heathcare-dashboard/blob/main/ml/preprocessing.py"
click node_heart_model "https://github.com/rutikbajad/heathcare-dashboard/blob/main/ml/heart_model.pkl"
click node_health_data "https://github.com/rutikbajad/heathcare-dashboard/blob/main/data/diabetes.csv"
click node_heart_data "https://github.com/rutikbajad/heathcare-dashboard/blob/main/data/heart.csv"

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_charting,node_user toneBlue
class node_auth,node_patient_api,node_appointment_api,node_disease_api,node_user_api,node_analytics_api toneAmber
class node_mongo,node_health_data,node_heart_data toneMint
class node_search_api,node_assessment_api,node_preprocessor,node_heart_model toneRose
```

## Components

### Web client

- [Portal interface](https://github.com/rutikbajad/heathcare-dashboard/blob/main/frontend/src/main.js): `frontend/src/main.js`
- [Charts](https://github.com/rutikbajad/heathcare-dashboard/blob/main/frontend/src/main.js): `frontend/src/main.js`

### Application backend

- [Accounts and access](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Patient records](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Appointments](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Disease records](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Staff and users](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Analytics metrics](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`

### Clinical data

- **MongoDB**
- [Health datasets](https://github.com/rutikbajad/heathcare-dashboard/blob/main/data/diabetes.csv): `data/diabetes.csv`
- [Heart dataset](https://github.com/rutikbajad/heathcare-dashboard/blob/main/data/heart.csv): `data/heart.csv`

### Search and risk

- [Record search](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Risk assessments](https://github.com/rutikbajad/heathcare-dashboard/blob/main/backend/app.py): `backend/app.py`
- [Feature preprocessing](https://github.com/rutikbajad/heathcare-dashboard/blob/main/ml/preprocessing.py): `ml/preprocessing.py`
- [Heart model artifact](https://github.com/rutikbajad/heathcare-dashboard/blob/main/ml/heart_model.pkl): `ml/heart_model.pkl`

### Other components

- **Healthcare user**

## Connections

- Healthcare user → Portal interface: uses (evidence: `frontend/src/main.js`)
- Portal interface → Accounts and access: requests API
- Portal interface → Patient records: requests API
- Portal interface → Appointments: requests API
- Portal interface → Disease records: requests API
- Portal interface → Record search: posts search (evidence: `frontend/src/main.js`)
- Portal interface → Risk assessments: submits assessment
- Portal interface → Charts: renders charts (evidence: `frontend/src/main.js`)
- Accounts and access → MongoDB: reads sessions (evidence: `backend/app.py`)
- Accounts and access → MongoDB: reads accounts (evidence: `backend/app.py`)
- Patient records → MongoDB: writes patients (evidence: `backend/app.py`)
- Appointments → MongoDB: writes appointments (evidence: `backend/app.py`)
- Disease records → MongoDB: checks diseases (evidence: `backend/app.py`)
- Analytics metrics → MongoDB: reads metrics (evidence: `backend/app.py`)
- Record search → MongoDB: searches records
- Risk assessments → MongoDB: stores assessments
- Feature preprocessing → Heart model artifact: prepares features
