# wwwsshivadas053-source/disease_prediction_system architecture

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

- Interactive diagram: https://gitdiagram.com/wwwsshivadas053-source/disease_prediction_system
- Repository: https://github.com/wwwsshivadas053-source/disease_prediction_system

## Overview

MedVisionAI is a Flask skin-image screening web app. Users upload an image, the application predicts a disease, presents explanatory information and a Grad-CAM visualization, saves prediction history, and can generate a PDF report. Authentication, feedback, and admin review are additional product workflows. The sampled app excerpt shows upload handling, prediction, heatmap generation, database writes, and report generation; some route wiring and model-loading details are omitted, so uncertain links are not shown.

Main entry points: [`app.py`](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py) (Flask routes), [`medvision.db`](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/medvision.db) (Application database), [`gradcam.py`](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/gradcam.py) (Heatmap generation), [`report_generator.py`](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/report_generator.py) (PDF reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask routes<br/>[app.py]"]
  node_pages["Web pages"]
  node_auth["Authentication<br/>[app.py]"]
  node_admin["Admin review<br/>[app.py]"]
end

subgraph group_analysis["Image analysis"]
  node_upload["Image upload<br/>[app.py]"]
  node_model["Disease model<br/>[disease_model.h5]"]
  node_predict["Prediction logic<br/>[app.py]"]
  node_disease["Disease guidance<br/>[disease_info.py]"]
  node_gradcam["Heatmap generation<br/>[gradcam.py]"]
  node_uploads[("Uploaded images")]
  node_heatmaps[("Saved heatmaps")]
end

subgraph group_records["Records and reports"]
  node_history["Prediction history<br/>[app.py]"]
  node_db[("Application database<br/>[medvision.db]")]
  node_reports["PDF reports"]
  node_pdf["Generated report<br/>[medical_report.pdf]"]
end

subgraph group_insights["Insights"]
  node_analytics["Disease analytics<br/>[analytics.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_pages
node_app -->|"handles"| node_auth
node_app -->|"dispatches"| node_admin
node_app -->|"dispatches"| node_upload
node_upload -->|"saves image"| node_uploads
node_upload -->|"requests prediction"| node_predict
node_predict -->|"uses model"| node_model
node_upload -->|"looks up guidance"| node_disease
node_upload -->|"requests heatmap"| node_gradcam
node_gradcam -->|"uses model"| node_model
node_gradcam -->|"reads image"| node_uploads
node_gradcam -->|"writes heatmap"| node_heatmaps
node_upload -->|"records result"| node_history
node_history -->|"writes prediction"| node_db
node_auth -->|"reads and writes"| node_db
node_admin -->|"manages records"| node_db
node_app -->|"reads prediction"| node_db
node_app -->|"requests PDF"| node_reports
node_reports -->|"writes report"| node_pdf
node_analytics -->|"reads counts"| node_db

click node_app "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py"
click node_pages "https://github.com/wwwsshivadas053-source/disease_prediction_system/tree/main/templates"
click node_auth "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py"
click node_admin "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py"
click node_upload "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py"
click node_model "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/static/models/disease_model.h5"
click node_predict "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py"
click node_disease "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/disease_info.py"
click node_gradcam "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/gradcam.py"
click node_uploads "https://github.com/wwwsshivadas053-source/disease_prediction_system/tree/main/static/uploads"
click node_heatmaps "https://github.com/wwwsshivadas053-source/disease_prediction_system/tree/main/static/heatmaps"
click node_history "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py"
click node_db "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/medvision.db"
click node_reports "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/report_generator.py"
click node_pdf "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/medical_report.pdf"
click node_analytics "https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/analytics.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_app,node_pages,node_auth,node_admin,node_user toneBlue
class node_upload,node_model,node_predict,node_disease,node_gradcam,node_uploads,node_heatmaps toneAmber
class node_history,node_db,node_reports,node_pdf toneMint
class node_analytics toneRose
```

## Components

### Web application

- [Flask routes](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py): `app.py`
- [Web pages](https://github.com/wwwsshivadas053-source/disease_prediction_system/tree/main/templates): `templates`
- [Authentication](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py): `app.py`
- [Admin review](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py): `app.py`

### Image analysis

- [Image upload](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py): `app.py`
- [Disease model](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/static/models/disease_model.h5): `static/models/disease_model.h5`
- [Prediction logic](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py): `app.py`
- [Disease guidance](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/disease_info.py): `disease_info.py`
- [Heatmap generation](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/gradcam.py): `gradcam.py`
- [Uploaded images](https://github.com/wwwsshivadas053-source/disease_prediction_system/tree/main/static/uploads): `static/uploads`
- [Saved heatmaps](https://github.com/wwwsshivadas053-source/disease_prediction_system/tree/main/static/heatmaps): `static/heatmaps`

### Records and reports

- [Prediction history](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/app.py): `app.py`
- [Application database](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/medvision.db): `medvision.db`
- [PDF reports](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/report_generator.py): `report_generator.py`
- [Generated report](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/medical_report.pdf): `medical_report.pdf`

### Insights

- [Disease analytics](https://github.com/wwwsshivadas053-source/disease_prediction_system/blob/main/analytics.py): `analytics.py`

### Other components

- **User**

## Connections

- User → Flask routes: uses
- Flask routes → Web pages: renders
- Flask routes → Authentication: handles
- Flask routes → Admin review: dispatches
- Flask routes → Image upload: dispatches
- Image upload → Uploaded images: saves image
- Image upload → Prediction logic: requests prediction
- Prediction logic → Disease model: uses model
- Image upload → Disease guidance: looks up guidance
- Image upload → Heatmap generation: requests heatmap
- Heatmap generation → Disease model: uses model
- Heatmap generation → Uploaded images: reads image
- Heatmap generation → Saved heatmaps: writes heatmap
- Image upload → Prediction history: records result
- Prediction history → Application database: writes prediction
- Authentication → Application database: reads and writes
- Admin review → Application database: manages records
- Flask routes → Application database: reads prediction
- Flask routes → PDF reports: requests PDF
- PDF reports → Generated report: writes report
- Disease analytics → Application database: reads counts
