Inspiration

Every year, chemical spills threaten the drinking water of millions of Americans living along major river systems. The Mississippi River alone serves as a drinking water source for over 18 million people across 10 states. Yet when a spill occurs upstream, emergency managers are still relying on phone calls, spreadsheets, and gut instinct to decide where to deploy containment resources — and how fast they need to move.

Our team has personally seen how slow information flow during environmental emergencies amplifies damage. The 2014 Elk River spill in West Virginia left 300,000 people without tap water for days. The 2023 East Palestine, Ohio train derailment contaminated local waterways with little real-time decision support for responders. These events share a common thread: responders were reacting, not predicting.

Our goal with DownStream is to give emergency managers a real-time, AI-powered simulation platform that models contamination spread, recommends mitigation strategies backed by federal cost data, and quantifies lives and damages at stake — before the spill reaches the next town downstream.

What it does

DownStream is a river contamination simulation platform that helps emergency managers deploy containment resources in real time and prevent chemical spills from reaching downstream drinking water supplies.

Real-Time Spill Simulation

  • Models contamination spread along the Mississippi River using USGS National Hydrography Dataset (NHD) river geometry
  • Simulates spill types including oil/petroleum, industrial solvents, and heavy metals with distinct physics
  • Displays live contamination propagation with color-coded risk levels (MONITOR → ADVISORY → DANGER)
  • Shows ETA countdowns to each downstream town's water intake in real time

Budget-Constrained Mitigation

  • Four deployable containment options anchored to FEMA HMGP federal cost benchmarks: Boom Deployment ($100K), Containment Barrier ($250K), Bioremediation ($350K), Emergency Diversion ($1.5M)
  • Spill-type-aware effectiveness: bioremediation shows 0% rejection for heavy metals since atoms don't degrade, 80% for hydrocarbons — forcing real strategic tradeoffs
  • Hover projection tooltip shows towns saved, population protected, damages prevented, and cost-per-person saved before committing budget
  • Default $3M budget cap with slider range up to $15M reflecting real Mississippi spill response costs
  • Buttons gray out when you can't afford them, making budget allocation a genuine constraint

Projected Outcomes

  • Every mitigation placement computes a live projection: towns saved, population protected, and damages prevented
  • "Do nothing" baseline always visible — showing total towns at risk, population exposed, and projected damages without intervention
  • Per-town ETAs update in real time as the plume advances downstream

How we built it

AWS Infrastructure Stack

  • AWS Amplify + CloudFront for frontend hosting
  • AWS AppSync (GraphQL) for real-time data flow between frontend and backend
  • AWS Lambda (6 functions) handling simulation orchestration and data processing
  • Amazon DynamoDB for simulation state persistence
  • Amazon S3 for storing simulation outputs
  • Amazon Kinesis for real-time contamination data streaming
  • AWS EventBridge for threshold-triggered event routing
  • AWS Step Functions orchestrating the full simulation workflow: spill detected → risk assessment → mitigation recommendation → outcome projection
  • Amazon Location Service for geospatial map infrastructure
  • Amazon SageMaker for spill propagation modeling with graceful fallback
  • Amazon Bedrock (Claude) for AI-generated incident reports

Frontend

  • React + TypeScript with Vite
  • MapLibre GL for river visualization with real NHD hydrological geometry
  • Real-time contamination plume rendering with segment-level color coding
  • Hover projection system computing town outcomes at ~30fps with zero perceptible latency

Data Sources

Challenges we ran into

We completed the vast majority of our source code very early on the hackathon, however, deployment to AWS took us 10 hours to complete. We zipped our local build file into a dist.zip and manually deployed it to AWS Amplify.

Merging four feature branches with divergent data models caused cascading import failures across the frontend. The src/lib/ directory was only tracked on certain branches, meaning any checkout to main broke the entire frontend build. We resolved this by establishing a clear branch dependency order and enforcing it across the team.

Making mitigation actions mechanically affect the simulation required wiring barrier placements into the contamination reduction math. Each barrier now applies a per-kind, per-spill-type passthrough coefficient (containment barrier = 5% passthrough, boom = 35% on turbulent water) stacked multiplicatively for multiple barriers upstream.

Calibrating cost estimates to be real required anchoring each mitigation type to its closest HMGP federal analog. Emergency diversion went from a placeholder $250K to $1.5M, halfway between the flood control median and p90.

Deploying to AWS while managing four branches of unmerged frontend code created compatibility issues that required manually tracing which files were tracked on which branches before the build would succeed.

Accomplishments that we're proud of

  1. 11 AWS services fully wired and actively used — Lambda, DynamoDB, S3, Kinesis, EventBridge, Step Functions, AppSync, Bedrock, SageMaker, CloudFront, Amplify, and Location Service
  2. Real FEMA HMGP data powering every cost estimate — 597 categorized federal projects across 10 Mississippi basin states, sourced directly from the FEMA open API
  3. Spill-type-aware mitigation physics that switches from oil to heavy metals makes bioremediation mechanically useless, forcing a genuine strategic pivot with real budget consequences
  4. Sub-second projection tooltips — hovering over the river shows towns saved, damages prevented, and cost-per-person in real time before committing any budget
  5. Real NHD river geometry — the Mississippi on screen is the actual river, not a synthetic approximation, with real hydrological connectivity and downstream ordering

What we learned

Real data changes everything. Replacing placeholder cost numbers with FEMA HMGP benchmarks didn't just improve accuracy — it reframed the entire product into a real decision-support tool. Every dollar figure now has a federal citation behind it.

AWS services compose better than expected. Step Functions orchestrating Lambda, Kinesis feeding AppSync, and EventBridge routing threshold events all clicked together faster than anticipated once the CDK infrastructure was established.

Branch discipline matters on a team. Four parallel PRs touching the same files created merge conflicts that cost hours. Clear file ownership from the start would have prevented most of them.

Physics constraints make better products. Designing spill-type-aware mitigation effectiveness forced us to think about what emergency managers actually face in the field. The fact that bioremediation doesn't work on heavy metals is real, and surfacing that in the UI makes the tool meaningfully more honest.

What's next for DownStream

AI-Generated ICS 208 Incident Reports — fully implemented in our codebase using Amazon Bedrock (Claude). After each simulation, Bedrock populates a completed ICS Form 208 Safety Message/Plan PDF — the exact government form real emergency managers use — and uploads it to S3 with a presigned download link. Pending final deployment verification.

Automated SMS Emergency Alerts via Amazon SNS — EventBridge and SNS infrastructure fully wired in CDK to fire real SMS alerts when contamination crosses a danger threshold for a downstream town.

EPA Superfund/CERCLA Cost Data — anchor the cleanup cost estimates in the Bedrock incident report to real Superfund remediation costs by contaminant type and volume, replacing Claude's current estimates with federally documented precedent.

Live USGS Sensor Integration — replace simulated contamination data with real USGS water quality sensor readings via Kinesis, turning DownStream into a live monitoring platform rather than a simulation tool.

FEMA Partnership — pursue integration with FEMA IPAWS (Integrated Public Alert and Warning System) to route DownStream alerts through official government emergency channels.

Sources

- FEMA Hazard Mitigation Assistance Projects: https://www.fema.gov/api/open/v4/HazardMitigationAssistanceProjects - USGS National Hydrography Dataset: https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer - US Census Bureau Population Data: https://www.census.gov/data.html

Built With

Share this project:

Updates