How prathameshhhhhhh/dam-project works
DAM MONITOR AI PRO is a dam telemetry and flood-risk monitoring platform. Sensor or simulated readings enter the Flask API, are classified by the ML predictor with a time-to-critical estimate, and are persisted with predictions and risk-triggered alerts; the dashboard presents live status, history, and emergency controls. Separate data-preparation and training modules produce the model artifact used for inference. The README documents alert and threshold APIs and dashboard features, but their route implementations and several frontend/API calls were not sampled, so uncertain wiring is omitted.
Main entry points: app.py Flask Application · api.js API Client · sensor.py Sensor API · database.py Database Layer
Components 18
Telemetry Data
- Telemetry Generator
data/generate_data.py - Data Preprocessor
data/preprocess.py - Telemetry Dataset
data/dam_data.csv
Risk Modeling
- Model Trainer
ml/train_model.py - Random Forest Model
ml/model.pkl - Risk Predictor
ml/predict.py
API and Persistence
- Flask Application
backend/app.py - Sensor API
backend/routes/sensor.py - Prediction API
backend/routes/prediction.py - Alerts API
backend/routes/alerts.py - Settings API
backend/routes/settings.py - Database Layer
backend/database.py - Monitoring Database
backend/dam_monitor.db
Dashboard
- Monitoring Dashboard
index.html - Dashboard Logic
js/app.js - API Client
js/api.js
Other components
- Sensors / Simulator
- Dam Operator
Connections 25
- Telemetry Generator → Telemetry Dataset: writes dataset
- Telemetry Dataset → Data Preprocessor: loads data
- Model Trainer → Data Preprocessor: uses preprocessing
- Model Trainer → Random Forest Model: saves model
- Risk Predictor → Random Forest Model: loads model
- Flask Application → Sensor API: registers route
- Flask Application → Prediction API: registers route
- Flask Application → Alerts API: registers route
- Flask Application → Settings API: registers route
- Flask Application → Monitoring Dashboard: serves page
- Sensors / Simulator → Sensor API: posts telemetry
- Sensor API → Risk Predictor: runs inference
- Sensor API → Database Layer: saves and reads
- Prediction API → Risk Predictor: runs inference
- Prediction API → Database Layer: reads latest
- Alerts API → Database Layer: alert operations
- Settings API → Database Layer: threshold operations
- Database Layer → Monitoring Database: reads and writes
- Dam Operator → Monitoring Dashboard: uses dashboard
- Monitoring Dashboard → Dashboard Logic: hosts interface
- Dashboard Logic → API Client: requests data
- API Client → Sensor API: sends telemetry
- API Client → Prediction API: requests prediction
- API Client → Alerts API: alert requests
- API Client → Settings API: threshold requests