How jerwil445/capstone_project_flood_monitoring works
This is a Flask-based campus flood and typhoon monitoring platform. Its central workflow captures and analyzes CCTV frames, publishes camera measurements, persists readings, evaluates flood alerts, and dispatches warning commands to an ESP32 siren controller. The web interface also supports monitoring and administration, while a separate bulletin-analysis capability assesses NDRRMC/PAGASA text. The excerpts establish the camera-to-alert-to-device path; some route-to-service wiring is inferred from documented capabilities and module roles, so uncertain links are omitted.
Main entry points: app.py Flask runtime · models Domain records · esp32_service.py ESP32 dispatcher · camera_manager.py Camera manager
Components 21
Camera monitoring
- Camera manager
services/camera_manager.py - Frame detection
camera/camera.py - Reading service
services/water_level_service.py
Alerts and bulletins
- Flood alert routes
routes/alerts.py - Bulletin routes
routes/ndrrmc.py - Flood alert service
services/alert_service.py - Bulletin analysis
services/ndrrmc_service.py
Siren hardware
- Siren control routes
routes/siren.py - ESP32 dispatcher
services/esp32_service.py
Web application
- Flask runtime
app.py - Dashboard client
static/js/dashboard.js - Water monitor client
static/js/pages/water_level.js - Water level routes
routes/water_level.py - Authentication routes
routes/auth.py - Audit and system logs
services/audit_service.py
Persistence
- Relational database
database/db.py - Domain records
models
Other components
- CCTV camera
- Operator browser
- ESP32 controller
esp32/esp32_code.cpp - NDRRMC/PAGASA bulletin
Connections 31
- CCTV camera → Frame detection: streams frames
- Camera manager → Frame detection: starts workers
- Frame detection → Camera manager: publishes measurements
- Camera manager → Flask runtime: updates primary state
- Flask runtime → Camera manager: configures cameras
- Flask runtime → Reading service: records measurements
- Reading service → Domain records: writes readings
- Reading service → Flood alert service: evaluates readings
- Flood alert service → Domain records: writes alerts and siren events
- Flood alert service → Audit and system logs: logs alert events
- Flask runtime → ESP32 dispatcher: dispatches level commands
- Flask runtime → ESP32 dispatcher: polls device status
- ESP32 dispatcher → ESP32 controller: sends HTTP commands
- ESP32 controller → ESP32 dispatcher: returns status
- ESP32 controller → CCTV camera: controls siren and LEDs
- Operator browser → Dashboard client: opens dashboard
- Operator browser → Water monitor client: opens water monitor
- Dashboard client → Flask runtime: requests dashboard data
- Water monitor client → Water level routes: requests telemetry
- Water level routes → Reading service: queries readings
- Operator browser → Authentication routes: submits credentials
- Authentication routes → Domain records: reads and writes users
- Operator browser → Flood alert routes: views alerts
- Flood alert routes → Domain records: reads alerts
- NDRRMC/PAGASA bulletin → Bulletin routes: submits bulletin text
- Bulletin routes → Bulletin analysis: analyzes bulletin
- Bulletin analysis → Domain records: stores analyzed bulletin
- Bulletin analysis → Audit and system logs: logs analysis
- Operator browser → Siren control routes: requests siren control
- Siren control routes → ESP32 dispatcher: dispatches control command
- Domain records → Relational database: persists records