Skip to content

Repository files navigation

Riverviews — Flood Monitoring System

Real-time flood monitoring with two components: flomon_service (Rust daemon) and floml (Python analysis). The reference implementation monitors the Illinois River basin (Peoria, IL) with 7 hydrological zones, 24 sensors, and lead times from 0–120 hours.

For official flood warnings always consult the National Weather Service and local emergency management. This is a personal project, not a certified warning system.


Project Structure

flomon_service/ — Rust ingest daemon + HTTP API (port 8080)
floml/ — Python analysis and terminal dashboard
riverviews.wiki/ — Architecture and implementation docs

Zones — Illinois River Reference Implementation

ZoneNameLead TimeSensorsRole
0Mississippi River12h–5dGrafton, Alton, Hannibal (USACE)Backwater source
1Lower Illinois6–24hLaGrange L&D pool/tailwater, Spoon River, KSPI precipBackwater interface
2Upper Peoria Lake0–6hPeoria L&D, Kingston Mines, KPIA precip, gridded precipProperty zone
3Local Tributaries6–18hMackinaw River, KBMI precip, gridded precipTributary monitoring
4Mid Illinois18–48hStarved Rock L&D, Marseilles, Henry, Vermilion RiverUpstream propagation
5Upper Illinois36–72hDresden Island L&D, Kankakee, Des PlainesConfluence monitoring
6Chicago CAWS3–5dLockport, Brandon Road, CSSC, KORD/KPWK precipLake Michigan drainage

Flood types: top-down (zones 4–6 elevated), bottom-up (zone 0 backwater), local tributary (zone 3), compound (multiple zones).


HTTP API

EndpointDescription
GET /zonesAll zones with metadata
GET /zone/{id}Zone detail with sensor readings
GET /statusOverall basin status, backwater risk, upstream pulse
GET /backwaterGrafton stage, LaGrange differential, pool-loss detection
GET /healthService health check

See riverviews.wiki/Zone-Based-API.md for response schemas.


Build & Run

flomon_service (Rust, Edition 2024)

cd flomon_service
cargo build --release
cargo run --release -- --endpoint 8080 # start daemon
cargo run --release -- verify # verify data sources

TOML config files must be present in cwd. A .env with DATABASE_URL is required when running outside cargo run.

floml (Python 3.8+)

cd floml
source venv/bin/activate
pip install -r requirements.txt
python floml/db.py # verify DB connection
python scripts/zone_dashboard.py # terminal dashboard
python scripts/zone_dashboard.py --api http://HOST:8080 # remote

Docker (recommended for deployment)

cp .env.example .env # fill in passwords
docker compose up -d
docker compose logs -f flomon_service

Database Migrations

psql -U postgres -d flopro_db -f flomon_service/sql/001_initial_schema.sql
# ... through 006_iem_asos.sql

Documentation

FileTopic
riverviews.wiki/Zone-Based-API.mdHTTP API endpoints and response schemas
riverviews.wiki/Data-Sources.mdUSGS, USACE CWMS, IEM/ASOS — what each provides
riverviews.wiki/Illinois-River-Implementation.mdConfigured stations, operational status, thresholds
riverviews.wiki/Database-Architecture.mdSchema design, multi-schema layout
riverviews.wiki/Staleness-Tracking.mdData freshness monitoring
riverviews.wiki/Peak-Flow-Analysis.mdHistorical flood event characterization
flomon_service/docs/TOML_CONFIGURATION.mdAdding stations and zones
flomon_service/docs/ASOS_IMPLEMENTATION.mdPrecipitation monitoring and thresholds
flomon_service/docs/CWMS_INTEGRATION_SUMMARY.mdUSACE CWMS catalog discovery and status
flomon_service/docs/STATION_RESILIENCE.mdFailure handling, backfill strategy
flomon_service/docs/LOGGING_AND_ERROR_HANDLING.mdLog levels, error strategy
flomon_service/docs/DATA_SOURCE_VERIFICATION.mdVerification test suite
floml/QUICKSTART.mdFloML setup and first analysis
TODO.mdOpen work items

About

Generalized flood monitoring system with multi-source data ingestion (USGS, USACE, ASOS), hydrological zone-based spatial analysis, and real-time alerting with dynamic configuration. Built in Rust , supported by Python.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages