# gireesh2658/rising-water architecture

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

- Interactive diagram: https://gitdiagram.com/gireesh2658/rising-water
- Repository: https://github.com/gireesh2658/rising-water

## Overview

Rising Waters is a Flask flood-risk prediction application with account-based access, model inference, and prediction history. Users register or log in, submit meteorological inputs, and receive a risk classification and confidence score; authenticated predictions are persisted for later review. Offline training and synthetic-data generation support the deployed model, while evaluation reports are available through the application. Source excerpts are partial, so links for some documented capabilities rely on the README; unsampled implementation details are not inferred.

Main entry points: [`app.py`](https://github.com/gireesh2658/rising-water/blob/main/app.py) (Prediction endpoint), [`train.py`](https://github.com/gireesh2658/rising-water/blob/main/train.py) (Training pipeline), [`static/main.js`](https://github.com/gireesh2658/rising-water/blob/main/static/main.js) (Form interactions), [`data/flood_dataset_expanded.csv`](https://github.com/gireesh2658/rising-water/blob/main/data/flood_dataset_expanded.csv) (Expanded flood dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_ui["Web interface"]
  node_clientjs["Form interactions<br/>[main.js]"]
  node_auth["Account authentication<br/>[app.py]"]
  node_predict["Prediction endpoint<br/>[app.py]"]
  node_history["History endpoints<br/>[app.py]"]
  node_evalreports["Evaluation dashboard<br/>[app.py]"]
end

subgraph group_ml["Machine learning"]
  node_model["Flood classifier<br/>[floods.save]"]
  node_scaler["Feature scaler<br/>[transform.save]"]
  node_featureorder["Feature names<br/>[feature_names.pkl]"]
  node_training["Training pipeline<br/>[train.py]"]
  node_evaloutput["Model evaluation reports"]
end

subgraph group_data["Data preparation"]
  node_synthetic["Synthetic data generation"]
  node_exploration["Dataset analysis<br/>[analyze_dataset.py]"]
  node_expanded["Expanded flood dataset"]
end

subgraph group_persistence["Persistence"]
  node_database[("PostgreSQL database")]
end

node_visitor(("Browser user"))

node_visitor -->|"opens pages"| node_ui
node_ui -->|"loads interactions"| node_clientjs
node_visitor -->|"registers and logs in"| node_auth
node_auth -->|"reads and writes accounts"| node_database
node_visitor -->|"submits weather"| node_predict
node_clientjs -->|"posts inputs"| node_predict
node_predict -->|"scales features"| node_scaler
node_predict -->|"uses feature order"| node_featureorder
node_predict -->|"classifies risk"| node_model
node_predict -->|"logs prediction"| node_database
node_predict -->|"returns risk result"| node_clientjs
node_visitor -->|"reviews or clears history"| node_history
node_history -->|"queries and deletes records"| node_database
node_visitor -->|"views evaluation"| node_evalreports
node_evalreports -->|"serves report files"| node_evaloutput
node_training -->|"exports classifier"| node_model
node_training -->|"exports scaler"| node_scaler
node_training -->|"generates evaluations"| node_evaloutput
node_synthetic -->|"generates dataset"| node_expanded
node_exploration -.->|"analyzes dataset"| node_expanded
node_training -.->|"trains from data"| node_expanded

click node_ui "https://github.com/gireesh2658/rising-water/tree/main/templates"
click node_clientjs "https://github.com/gireesh2658/rising-water/blob/main/static/main.js"
click node_auth "https://github.com/gireesh2658/rising-water/blob/main/app.py"
click node_predict "https://github.com/gireesh2658/rising-water/blob/main/app.py"
click node_history "https://github.com/gireesh2658/rising-water/blob/main/app.py"
click node_evalreports "https://github.com/gireesh2658/rising-water/blob/main/app.py"
click node_model "https://github.com/gireesh2658/rising-water/blob/main/models/floods.save"
click node_scaler "https://github.com/gireesh2658/rising-water/blob/main/models/transform.save"
click node_featureorder "https://github.com/gireesh2658/rising-water/blob/main/models/feature_names.pkl"
click node_training "https://github.com/gireesh2658/rising-water/blob/main/train.py"
click node_evaloutput "https://github.com/gireesh2658/rising-water/tree/main/reports"
click node_synthetic "https://github.com/gireesh2658/rising-water/blob/main/data/generate_synthetic_data.py"
click node_exploration "https://github.com/gireesh2658/rising-water/blob/main/data/analyze_dataset.py"
click node_expanded "https://github.com/gireesh2658/rising-water/blob/main/data/flood_dataset_expanded.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_ui,node_clientjs,node_auth,node_predict,node_history,node_evalreports,node_visitor toneBlue
class node_model,node_scaler,node_featureorder,node_training,node_evaloutput toneAmber
class node_synthetic,node_exploration,node_expanded toneMint
class node_database toneRose
```

## Components

### Web application

- [Web interface](https://github.com/gireesh2658/rising-water/tree/main/templates): `templates`
- [Form interactions](https://github.com/gireesh2658/rising-water/blob/main/static/main.js): `static/main.js`
- [Account authentication](https://github.com/gireesh2658/rising-water/blob/main/app.py): `app.py`
- [Prediction endpoint](https://github.com/gireesh2658/rising-water/blob/main/app.py): `app.py`
- [History endpoints](https://github.com/gireesh2658/rising-water/blob/main/app.py): `app.py`
- [Evaluation dashboard](https://github.com/gireesh2658/rising-water/blob/main/app.py): `app.py`

### Machine learning

- [Flood classifier](https://github.com/gireesh2658/rising-water/blob/main/models/floods.save): `models/floods.save`
- [Feature scaler](https://github.com/gireesh2658/rising-water/blob/main/models/transform.save): `models/transform.save`
- [Feature names](https://github.com/gireesh2658/rising-water/blob/main/models/feature_names.pkl): `models/feature_names.pkl`
- [Training pipeline](https://github.com/gireesh2658/rising-water/blob/main/train.py): `train.py`
- [Model evaluation reports](https://github.com/gireesh2658/rising-water/tree/main/reports): `reports`

### Data preparation

- [Synthetic data generation](https://github.com/gireesh2658/rising-water/blob/main/data/generate_synthetic_data.py): `data/generate_synthetic_data.py`
- [Dataset analysis](https://github.com/gireesh2658/rising-water/blob/main/data/analyze_dataset.py): `data/analyze_dataset.py`
- [Expanded flood dataset](https://github.com/gireesh2658/rising-water/blob/main/data/flood_dataset_expanded.csv): `data/flood_dataset_expanded.csv`

### Persistence

- **PostgreSQL database**

### Other components

- **Browser user**

## Connections

- Browser user → Web interface: opens pages (evidence: `README.md`)
- Web interface → Form interactions: loads interactions (evidence: `README.md`)
- Browser user → Account authentication: registers and logs in (evidence: `README.md`)
- Account authentication → PostgreSQL database: reads and writes accounts (evidence: `README.md`)
- Browser user → Prediction endpoint: submits weather (evidence: `README.md`)
- Form interactions → Prediction endpoint: posts inputs (evidence: `README.md`)
- Prediction endpoint → Feature scaler: scales features (evidence: `README.md`)
- Prediction endpoint → Feature names: uses feature order (evidence: `README.md`)
- Prediction endpoint → Flood classifier: classifies risk (evidence: `README.md`)
- Prediction endpoint → PostgreSQL database: logs prediction (evidence: `app.py`)
- Prediction endpoint → Form interactions: returns risk result (evidence: `README.md`)
- Browser user → History endpoints: reviews or clears history (evidence: `README.md`)
- History endpoints → PostgreSQL database: queries and deletes records (evidence: `app.py`)
- Browser user → Evaluation dashboard: views evaluation (evidence: `README.md`)
- Evaluation dashboard → Model evaluation reports: serves report files (evidence: `app.py`)
- Training pipeline → Flood classifier: exports classifier (evidence: `README.md`)
- Training pipeline → Feature scaler: exports scaler (evidence: `README.md`)
- Training pipeline → Model evaluation reports: generates evaluations (evidence: `train.py`)
- Synthetic data generation → Expanded flood dataset: generates dataset (evidence: `data/generate_synthetic_data.py`)
- Dataset analysis → Expanded flood dataset: analyzes dataset
- Training pipeline → Expanded flood dataset: trains from data
