# sukrut10k/smart-water-leak-detection architecture

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

- Interactive diagram: https://gitdiagram.com/sukrut10k/smart-water-leak-detection
- Repository: https://github.com/sukrut10k/smart-water-leak-detection

## Overview

This is a Streamlit water-leak monitoring dashboard backed by machine-learning models. Users can enter sensor readings or upload a CSV, then inspect predictions, risk simulations, geographic views, and analytics; an AI assistant provides dataset-aware insights. The notebook is documented as the model-training and evaluation workflow. The excerpts show much of the dashboard behavior, but omit some surrounding code, including dataset-loading details, so uncertain data wiring is not shown.

Main entry points: [`frontend/app.py`](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py) (Streamlit dashboard), [`ml_model/water_leak_detection.ipynb`](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/ml_model/water_leak_detection.ipynb) (Trained models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard workflows"]
  node_app["Streamlit dashboard<br/>[app.py]"]
  node_single["Leak prediction<br/>[app.py]"]
  node_whatif["What-if analysis<br/>[app.py]"]
  node_batch["Batch prediction<br/>[app.py]"]
  node_geo["Zone map<br/>[app.py]"]
  node_analytics["Analytics insights<br/>[app.py]"]
  node_assistant["AI assistant<br/>[app.py]"]
end

subgraph group_ml["Model workflow"]
  node_models["Trained models"]
end

subgraph group_data["Datasets"]
  node_gisdata["GIS leakage data"]
  node_testdata["Testing data<br/>[testing.csv]"]
end

subgraph group_integrations["External services"]
  node_groq["Groq API"]
end

node_operator(("Dashboard user"))

node_operator -->|"uses"| node_app
node_app -->|"dispatches"| node_single
node_app -->|"dispatches"| node_whatif
node_app -->|"dispatches"| node_batch
node_app -->|"dispatches"| node_geo
node_app -->|"dispatches"| node_analytics
node_app -->|"dispatches"| node_assistant
node_single -->|"predicts with"| node_models
node_whatif -->|"predicts with"| node_models
node_batch -->|"predicts with"| node_models
node_assistant -->|"requests insights"| node_groq

click node_app "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_single "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_whatif "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_batch "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_geo "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_analytics "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_assistant "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py"
click node_models "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/ml_model/water_leak_detection.ipynb"
click node_gisdata "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/data/location_aware_gis_leakage_dataset.csv"
click node_testdata "https://github.com/sukrut10k/smart-water-leak-detection/blob/main/data/testing.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_app,node_single,node_whatif,node_batch,node_geo,node_analytics,node_assistant,node_operator toneBlue
class node_models toneAmber
class node_gisdata,node_testdata toneMint
class node_groq toneRose
```

## Components

### Dashboard workflows

- [Streamlit dashboard](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`
- [Leak prediction](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`
- [What-if analysis](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`
- [Batch prediction](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`
- [Zone map](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`
- [Analytics insights](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`
- [AI assistant](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/frontend/app.py): `frontend/app.py`

### Model workflow

- [Trained models](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/ml_model/water_leak_detection.ipynb): `ml_model/water_leak_detection.ipynb`

### Datasets

- [GIS leakage data](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/data/location_aware_gis_leakage_dataset.csv): `data/location_aware_gis_leakage_dataset.csv`
- [Testing data](https://github.com/sukrut10k/smart-water-leak-detection/blob/main/data/testing.csv): `data/testing.csv`

### External services

- **Groq API**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Streamlit dashboard: uses
- Streamlit dashboard → Leak prediction: dispatches
- Streamlit dashboard → What-if analysis: dispatches
- Streamlit dashboard → Batch prediction: dispatches
- Streamlit dashboard → Zone map: dispatches
- Streamlit dashboard → Analytics insights: dispatches
- Streamlit dashboard → AI assistant: dispatches
- Leak prediction → Trained models: predicts with
- What-if analysis → Trained models: predicts with
- Batch prediction → Trained models: predicts with
- AI assistant → Groq API: requests insights
