# kamalhiiny/multi_disease_predictor architecture

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

- Interactive diagram: https://gitdiagram.com/kamalhiiny/multi_disease_predictor
- Repository: https://github.com/kamalhiiny/multi_disease_predictor

## Overview

Medibuddy is a Flask disease-prediction web app. Users open predictor pages, submit clinical measurements or an image, and receive a rendered prediction or an input-error page. The code separates tabular model inference from image preparation and image-model inference. The README confirms the home page and several predictor/result screens; source excerpts show the request handling and model calls. The graph omits unverified template links and image-storage details beyond those visible in app.py.

Main entry points: [`app.py`](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py) (Request routes), [`templates/home.html`](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/home.html) (Home page), [`templates/diabetes.html`](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/diabetes.html) (Diabetes form), [`templates/breast_cancer.html`](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/breast_cancer.html) (Cancer form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web pages"]
  node_flask["Request routes<br/>[app.py]"]
  node_home["Home page<br/>[home.html]"]
  node_diabetes_page["Diabetes form<br/>[diabetes.html]"]
  node_cancer_page["Cancer form<br/>[breast_cancer.html]"]
  node_heart_page["Heart form<br/>[heart.html]"]
  node_kidney_page["Kidney form<br/>[kidney.html]"]
  node_liver_page["Liver form<br/>[liver.html]"]
  node_tabular_result["Prediction result<br/>[predict.html]"]
  node_malaria_page["Malaria form<br/>[malaria.html]"]
  node_pneumonia_page["Pneumonia form<br/>[pneumonia.html]"]
  node_malaria_result["Malaria result"]
  node_pneumonia_result["Pneumonia result"]
end

subgraph group_tabular["Clinical predictions"]
  node_tabular_inference["Tabular inference<br/>[app.py]"]
  node_diabetes_model[("Diabetes model<br/>[diabetes.pkl]")]
  node_cancer_model[("Cancer model<br/>[breast_cancer.pkl]")]
  node_heart_model[("Heart model<br/>[heart.pkl]")]
  node_kidney_model[("Kidney model<br/>[kidney.pkl]")]
  node_liver_model[("Liver model<br/>[liver.pkl]")]
end

subgraph group_imaging["Image predictions"]
  node_image_processing["Image preparation<br/>[app.py]"]
  node_malaria_model[("Malaria model<br/>[malaria.h5]")]
  node_pneumonia_model[("Pneumonia model<br/>[pneumonia.h5]")]
end

node_user(("User"))

node_user -->|"sends request"| node_flask
node_flask -->|"renders"| node_home
node_flask -->|"renders"| node_diabetes_page
node_flask -->|"renders"| node_cancer_page
node_flask -->|"renders"| node_heart_page
node_flask -->|"renders"| node_kidney_page
node_flask -->|"renders"| node_liver_page
node_flask -->|"calls"| node_tabular_inference
node_tabular_inference -->|"loads and predicts"| node_diabetes_model
node_tabular_inference -->|"loads and predicts"| node_cancer_model
node_tabular_inference -->|"loads and predicts"| node_heart_model
node_tabular_inference -->|"loads and predicts"| node_kidney_model
node_tabular_inference -->|"loads and predicts"| node_liver_model
node_flask -->|"renders"| node_tabular_result
node_flask -->|"renders"| node_malaria_page
node_flask -->|"renders"| node_pneumonia_page
node_flask -->|"prepares image"| node_image_processing
node_image_processing -->|"loads and predicts"| node_malaria_model
node_image_processing -->|"loads and predicts"| node_pneumonia_model
node_flask -->|"renders"| node_malaria_result
node_flask -->|"renders"| node_pneumonia_result

click node_flask "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py"
click node_home "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/home.html"
click node_diabetes_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/diabetes.html"
click node_cancer_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/breast_cancer.html"
click node_heart_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/heart.html"
click node_kidney_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/kidney.html"
click node_liver_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/liver.html"
click node_tabular_inference "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py"
click node_diabetes_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/diabetes.pkl"
click node_cancer_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/breast_cancer.pkl"
click node_heart_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/heart.pkl"
click node_kidney_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/kidney.pkl"
click node_liver_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/liver.pkl"
click node_tabular_result "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/predict.html"
click node_malaria_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/malaria.html"
click node_pneumonia_page "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/pneumonia.html"
click node_image_processing "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py"
click node_malaria_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/malaria.h5"
click node_pneumonia_model "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/pneumonia.h5"
click node_malaria_result "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/malaria_predict.html"
click node_pneumonia_result "https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/pneumonia_predict.html"

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_flask,node_home,node_diabetes_page,node_cancer_page,node_heart_page,node_kidney_page,node_liver_page,node_tabular_result,node_malaria_page,node_pneumonia_page,node_malaria_result,node_pneumonia_result,node_user toneBlue
class node_tabular_inference,node_diabetes_model,node_cancer_model,node_heart_model,node_kidney_model,node_liver_model toneAmber
class node_image_processing,node_malaria_model,node_pneumonia_model toneMint
```

## Components

### Web pages

- [Request routes](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py): `app.py`
- [Home page](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/home.html): `templates/home.html`
- [Diabetes form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/diabetes.html): `templates/diabetes.html`
- [Cancer form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/breast_cancer.html): `templates/breast_cancer.html`
- [Heart form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/heart.html): `templates/heart.html`
- [Kidney form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/kidney.html): `templates/kidney.html`
- [Liver form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/liver.html): `templates/liver.html`
- [Prediction result](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/predict.html): `templates/predict.html`
- [Malaria form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/malaria.html): `templates/malaria.html`
- [Pneumonia form](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/pneumonia.html): `templates/pneumonia.html`
- [Malaria result](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/malaria_predict.html): `templates/malaria_predict.html`
- [Pneumonia result](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/templates/pneumonia_predict.html): `templates/pneumonia_predict.html`

### Clinical predictions

- [Tabular inference](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py): `app.py`
- [Diabetes model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/diabetes.pkl): `models/diabetes.pkl`
- [Cancer model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/breast_cancer.pkl): `models/breast_cancer.pkl`
- [Heart model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/heart.pkl): `models/heart.pkl`
- [Kidney model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/kidney.pkl): `models/kidney.pkl`
- [Liver model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/liver.pkl): `models/liver.pkl`

### Image predictions

- [Image preparation](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/app.py): `app.py`
- [Malaria model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/malaria.h5): `models/malaria.h5`
- [Pneumonia model](https://github.com/kamalhiiny/multi_disease_predictor/blob/main/models/pneumonia.h5): `models/pneumonia.h5`

### Other components

- **User**

## Connections

- User → Request routes: sends request (evidence: `app.py`)
- Request routes → Home page: renders (evidence: `app.py`)
- Request routes → Diabetes form: renders (evidence: `app.py`)
- Request routes → Cancer form: renders (evidence: `app.py`)
- Request routes → Heart form: renders (evidence: `app.py`)
- Request routes → Kidney form: renders (evidence: `app.py`)
- Request routes → Liver form: renders (evidence: `app.py`)
- Request routes → Tabular inference: calls (evidence: `app.py`)
- Tabular inference → Diabetes model: loads and predicts (evidence: `app.py`)
- Tabular inference → Cancer model: loads and predicts (evidence: `app.py`)
- Tabular inference → Heart model: loads and predicts (evidence: `app.py`)
- Tabular inference → Kidney model: loads and predicts (evidence: `app.py`)
- Tabular inference → Liver model: loads and predicts (evidence: `app.py`)
- Request routes → Prediction result: renders (evidence: `app.py`)
- Request routes → Malaria form: renders (evidence: `app.py`)
- Request routes → Pneumonia form: renders (evidence: `app.py`)
- Request routes → Image preparation: prepares image (evidence: `app.py`)
- Image preparation → Malaria model: loads and predicts (evidence: `app.py`)
- Image preparation → Pneumonia model: loads and predicts (evidence: `app.py`)
- Request routes → Malaria result: renders (evidence: `app.py`)
- Request routes → Pneumonia result: renders (evidence: `app.py`)
