# djslash9/dengue_web_app architecture

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

- Interactive diagram: https://gitdiagram.com/djslash9/dengue_web_app
- Repository: https://github.com/djslash9/dengue_web_app

## Overview

DEWRS is a Streamlit dengue early-warning application with a separate model-training workflow. Users upload dengue and awareness CSVs, then access predictions, forecasts, dashboards, survey insights, and recommendations. The training script calculates district risk scores, engineers lagged features, trains an XGBoost model, and saves artifacts; the notebook also documents EDA, SARIMA, XGBoost, and evaluation. The README is empty, and excerpts omit some app internals, so only directly supported relationships are shown.

Main entry points: [`app.py`](https://github.com/djslash9/dengue_web_app/blob/main/app.py) (Streamlit App), [`dengue.py`](https://github.com/djslash9/dengue_web_app/blob/main/dengue.py) (CDRI Calculation), [`generate_notebook.py`](https://github.com/djslash9/dengue_web_app/blob/main/generate_notebook.py) (EDA and SARIMA), [`dengue_model.pkl`](https://github.com/djslash9/dengue_web_app/blob/main/dengue_model.pkl) (Trained Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Early Warning App"]
  node_streamlit_app["Streamlit App<br/>[app.py]"]
  node_csv_upload["CSV Upload<br/>[app.py]"]
  node_data_prep["Data Loading<br/>[app.py]"]
end

subgraph group_analytics["Forecast and Insights"]
  node_dashboard["Dashboard<br/>[app.py]"]
  node_forecast["Case Forecast<br/>[app.py]"]
  node_prediction["Case Prediction<br/>[app.py]"]
  node_climate["Climate Charts<br/>[app.py]"]
  node_survey["Survey Insights<br/>[app.py]"]
  node_recommendations["Recommendations<br/>[app.py]"]
end

subgraph group_training["Model Development"]
  node_cdri["CDRI Calculation<br/>[dengue.py]"]
  node_features["Feature Engineering<br/>[dengue.py]"]
  node_xgb_train["XGBoost Training<br/>[dengue.py]"]
  node_research["EDA and SARIMA"]
  node_evaluation["Model Evaluation"]
end

subgraph group_artifacts["Model Artifacts"]
  node_model_file["Trained Model<br/>[dengue_model.pkl]"]
  node_cdri_file["CDRI Reference<br/>[cdri_ref.pkl]"]
end

node_user(("Decision Maker"))

node_user -->|"uses"| node_streamlit_app
node_streamlit_app -->|"presents"| node_csv_upload
node_streamlit_app -->|"loads uploads"| node_data_prep
node_streamlit_app -->|"renders"| node_dashboard
node_streamlit_app -->|"predicts cases"| node_prediction
node_streamlit_app -->|"builds forecast"| node_forecast
node_streamlit_app -->|"plots climate"| node_climate
node_streamlit_app -->|"plots survey"| node_survey
node_streamlit_app -->|"shows guidance"| node_recommendations
node_cdri -->|"provides scores"| node_features
node_features -->|"provides features"| node_xgb_train
node_xgb_train -->|"saves model"| node_model_file
node_cdri -->|"saves reference"| node_cdri_file
node_research -->|"evaluates models"| node_evaluation

click node_streamlit_app "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_csv_upload "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_data_prep "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_dashboard "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_forecast "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_prediction "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_climate "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_survey "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_recommendations "https://github.com/djslash9/dengue_web_app/blob/main/app.py"
click node_cdri "https://github.com/djslash9/dengue_web_app/blob/main/dengue.py"
click node_features "https://github.com/djslash9/dengue_web_app/blob/main/dengue.py"
click node_xgb_train "https://github.com/djslash9/dengue_web_app/blob/main/dengue.py"
click node_research "https://github.com/djslash9/dengue_web_app/blob/main/generate_notebook.py"
click node_evaluation "https://github.com/djslash9/dengue_web_app/blob/main/generate_notebook.py"
click node_model_file "https://github.com/djslash9/dengue_web_app/blob/main/dengue_model.pkl"
click node_cdri_file "https://github.com/djslash9/dengue_web_app/blob/main/cdri_ref.pkl"

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_streamlit_app,node_csv_upload,node_data_prep toneBlue
class node_dashboard,node_forecast,node_prediction,node_climate,node_survey,node_recommendations toneAmber
class node_cdri,node_features,node_xgb_train,node_research,node_evaluation toneMint
class node_model_file,node_cdri_file toneRose
class node_user toneIndigo
```

## Components

### Early Warning App

- [Streamlit App](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [CSV Upload](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [Data Loading](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`

### Forecast and Insights

- [Dashboard](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [Case Forecast](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [Case Prediction](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [Climate Charts](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [Survey Insights](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`
- [Recommendations](https://github.com/djslash9/dengue_web_app/blob/main/app.py): `app.py`

### Model Development

- [CDRI Calculation](https://github.com/djslash9/dengue_web_app/blob/main/dengue.py): `dengue.py`
- [Feature Engineering](https://github.com/djslash9/dengue_web_app/blob/main/dengue.py): `dengue.py`
- [XGBoost Training](https://github.com/djslash9/dengue_web_app/blob/main/dengue.py): `dengue.py`
- [EDA and SARIMA](https://github.com/djslash9/dengue_web_app/blob/main/generate_notebook.py): `generate_notebook.py`
- [Model Evaluation](https://github.com/djslash9/dengue_web_app/blob/main/generate_notebook.py): `generate_notebook.py`

### Model Artifacts

- [Trained Model](https://github.com/djslash9/dengue_web_app/blob/main/dengue_model.pkl): `dengue_model.pkl`
- [CDRI Reference](https://github.com/djslash9/dengue_web_app/blob/main/cdri_ref.pkl): `cdri_ref.pkl`

### Other components

- **Decision Maker**

## Connections

- Decision Maker → Streamlit App: uses (evidence: `app.py`)
- Streamlit App → CSV Upload: presents (evidence: `app.py`)
- Streamlit App → Data Loading: loads uploads (evidence: `app.py`)
- Streamlit App → Dashboard: renders (evidence: `app.py`)
- Streamlit App → Case Prediction: predicts cases (evidence: `app.py`)
- Streamlit App → Case Forecast: builds forecast (evidence: `app.py`)
- Streamlit App → Climate Charts: plots climate (evidence: `app.py`)
- Streamlit App → Survey Insights: plots survey (evidence: `app.py`)
- Streamlit App → Recommendations: shows guidance (evidence: `app.py`)
- CDRI Calculation → Feature Engineering: provides scores (evidence: `dengue.py`)
- Feature Engineering → XGBoost Training: provides features (evidence: `dengue.py`)
- XGBoost Training → Trained Model: saves model (evidence: `dengue.py`)
- CDRI Calculation → CDRI Reference: saves reference (evidence: `dengue.py`)
- EDA and SARIMA → Model Evaluation: evaluates models (evidence: `generate_notebook.py`)
