# mu368651-eng/health-care-using-ml architecture

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

- Interactive diagram: https://gitdiagram.com/mu368651-eng/health-care-using-ml
- Repository: https://github.com/mu368651-eng/health-care-using-ml

## Overview

This repository is an educational seven-disease prediction suite, with a local dashboard as its main user-facing product. A user selects a disease, enters one patient’s data or uploads a CSV, and receives risk predictions and indicators; the dashboard also offers presets and CSV templates. The API dispatches inference through a shared model service to disease-specific model families. Separate project code provides training and deep-learning experiments. The README documents all seven model families, but most disease implementations were not excerpted, so their internal call paths are not asserted.

Main entry points: [`web_app/backend/model_service.py`](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/model_service.py) (Inference service), [`web_app/backend/app.py`](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/app.py) (FastAPI routes), [`web_app/frontend/static/js/app.js`](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/frontend/static/js/app.js) (Dashboard interface), [`copd/src/trainer.py`](https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/trainer.py) (COPD training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard and API"]
  node_frontend["Dashboard interface<br/>[app.js]"]
  node_api["FastAPI routes<br/>[app.py]"]
  node_presets["Patient presets<br/>[sample_presets.py]"]
  node_service["Inference service<br/>[model_service.py]"]
end

subgraph group_inference["Disease inference"]
  node_heart["Heart disease"]
  node_kidney["Kidney disease"]
  node_diabetes["Diabetes progression"]
  node_liver["Liver disease<br/>[trainer.py]"]
  node_stroke["Stroke prediction<br/>[trainer.py]"]
  node_hypertension["Hypertension risk<br/>[trainer.py]"]
  node_copd["COPD prediction<br/>[models.py]"]
end

subgraph group_training["Training projects"]
  node_copd_data["COPD preprocessing<br/>[data_loader.py]"]
  node_copd_train["COPD training<br/>[trainer.py]"]
  node_hypertension_data["Hypertension data<br/>[data_loader.py]"]
  node_liver_data["Liver data<br/>[data_loader.py]"]
end

subgraph group_experiments["Deep learning experiments"]
  node_diabetes_dl["Diabetes neural models"]
  node_kidney_dl["Kidney neural model"]
  node_heart_dl["Heart neural experiments"]
end

node_user(("Dashboard user"))

node_user -->|"enters data"| node_frontend
node_frontend -->|"requests routes"| node_api
node_api -->|"reads presets"| node_presets
node_api -->|"dispatches inference"| node_service
node_service -.->|"loads model"| node_heart
node_service -.->|"loads model"| node_kidney
node_service -.->|"loads model"| node_diabetes
node_service -.->|"loads model"| node_liver
node_service -.->|"loads model"| node_stroke
node_service -.->|"loads model"| node_hypertension
node_service -.->|"loads model"| node_copd
node_copd_data -->|"supplies batches"| node_copd_train
node_copd_train -->|"trains models"| node_copd
node_hypertension_data -->|"prepares training data"| node_hypertension
node_liver_data -->|"prepares training data"| node_liver

click node_frontend "https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/frontend/static/js/app.js"
click node_api "https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/app.py"
click node_presets "https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/sample_presets.py"
click node_service "https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/model_service.py"
click node_heart "https://github.com/mu368651-eng/health-care-using-ml/blob/main/heart%20desease/heart_disease_prediction.py"
click node_kidney "https://github.com/mu368651-eng/health-care-using-ml/blob/main/kidney%20disease/kidney_disease_prediction.py"
click node_diabetes "https://github.com/mu368651-eng/health-care-using-ml/blob/main/diabetes%20progression/diabetes_progression.py"
click node_liver "https://github.com/mu368651-eng/health-care-using-ml/blob/main/liver_disease/src/trainer.py"
click node_stroke "https://github.com/mu368651-eng/health-care-using-ml/blob/main/stroke_prediction/src/trainer.py"
click node_hypertension "https://github.com/mu368651-eng/health-care-using-ml/blob/main/hypertension/src/trainer.py"
click node_copd "https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/models.py"
click node_copd_data "https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/data_loader.py"
click node_copd_train "https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/trainer.py"
click node_hypertension_data "https://github.com/mu368651-eng/health-care-using-ml/blob/main/hypertension/src/data_loader.py"
click node_liver_data "https://github.com/mu368651-eng/health-care-using-ml/blob/main/liver_disease/src/data_loader.py"
click node_diabetes_dl "https://github.com/mu368651-eng/health-care-using-ml/blob/main/diabetes%20progression/diabetes_progression_deep_learning.py"
click node_kidney_dl "https://github.com/mu368651-eng/health-care-using-ml/blob/main/kidney%20disease/kidney_disease_deep_learning.py"
click node_heart_dl "https://github.com/mu368651-eng/health-care-using-ml/blob/main/heart%20desease/heart_disease_deep_learning.py"

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_frontend,node_api,node_presets,node_service,node_user toneBlue
class node_heart,node_kidney,node_diabetes,node_liver,node_stroke,node_hypertension,node_copd toneAmber
class node_copd_data,node_copd_train,node_hypertension_data,node_liver_data toneMint
class node_diabetes_dl,node_kidney_dl,node_heart_dl toneRose
```

## Components

### Dashboard and API

- [Dashboard interface](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/frontend/static/js/app.js): `web_app/frontend/static/js/app.js`
- [FastAPI routes](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/app.py): `web_app/backend/app.py`
- [Patient presets](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/sample_presets.py): `web_app/backend/sample_presets.py`
- [Inference service](https://github.com/mu368651-eng/health-care-using-ml/blob/main/web_app/backend/model_service.py): `web_app/backend/model_service.py`

### Disease inference

- [Heart disease](https://github.com/mu368651-eng/health-care-using-ml/blob/main/heart%20desease/heart_disease_prediction.py): `heart desease/heart_disease_prediction.py`
- [Kidney disease](https://github.com/mu368651-eng/health-care-using-ml/blob/main/kidney%20disease/kidney_disease_prediction.py): `kidney disease/kidney_disease_prediction.py`
- [Diabetes progression](https://github.com/mu368651-eng/health-care-using-ml/blob/main/diabetes%20progression/diabetes_progression.py): `diabetes progression/diabetes_progression.py`
- [Liver disease](https://github.com/mu368651-eng/health-care-using-ml/blob/main/liver_disease/src/trainer.py): `liver_disease/src/trainer.py`
- [Stroke prediction](https://github.com/mu368651-eng/health-care-using-ml/blob/main/stroke_prediction/src/trainer.py): `stroke_prediction/src/trainer.py`
- [Hypertension risk](https://github.com/mu368651-eng/health-care-using-ml/blob/main/hypertension/src/trainer.py): `hypertension/src/trainer.py`
- [COPD prediction](https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/models.py): `copd/src/models.py`

### Training projects

- [COPD preprocessing](https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/data_loader.py): `copd/src/data_loader.py`
- [COPD training](https://github.com/mu368651-eng/health-care-using-ml/blob/main/copd/src/trainer.py): `copd/src/trainer.py`
- [Hypertension data](https://github.com/mu368651-eng/health-care-using-ml/blob/main/hypertension/src/data_loader.py): `hypertension/src/data_loader.py`
- [Liver data](https://github.com/mu368651-eng/health-care-using-ml/blob/main/liver_disease/src/data_loader.py): `liver_disease/src/data_loader.py`

### Deep learning experiments

- [Diabetes neural models](https://github.com/mu368651-eng/health-care-using-ml/blob/main/diabetes%20progression/diabetes_progression_deep_learning.py): `diabetes progression/diabetes_progression_deep_learning.py`
- [Kidney neural model](https://github.com/mu368651-eng/health-care-using-ml/blob/main/kidney%20disease/kidney_disease_deep_learning.py): `kidney disease/kidney_disease_deep_learning.py`
- [Heart neural experiments](https://github.com/mu368651-eng/health-care-using-ml/blob/main/heart%20desease/heart_disease_deep_learning.py): `heart desease/heart_disease_deep_learning.py`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Dashboard interface: enters data (evidence: `README.md`)
- Dashboard interface → FastAPI routes: requests routes (evidence: `web_app/frontend/static/js/app.js`)
- FastAPI routes → Patient presets: reads presets (evidence: `web_app/backend/app.py`)
- FastAPI routes → Inference service: dispatches inference (evidence: `web_app/backend/app.py`)
- Inference service → Heart disease: loads model (evidence: `README.md`)
- Inference service → Kidney disease: loads model (evidence: `README.md`)
- Inference service → Diabetes progression: loads model (evidence: `README.md`)
- Inference service → Liver disease: loads model (evidence: `README.md`)
- Inference service → Stroke prediction: loads model (evidence: `README.md`)
- Inference service → Hypertension risk: loads model (evidence: `README.md`)
- Inference service → COPD prediction: loads model (evidence: `README.md`)
- COPD preprocessing → COPD training: supplies batches (evidence: `copd/run_train.py`)
- COPD training → COPD prediction: trains models (evidence: `copd/src/trainer.py`)
- Hypertension data → Hypertension risk: prepares training data
- Liver data → Liver disease: prepares training data
