Flood and extreme-rainfall intelligence for communities.
Live demo: https://watermark.works
Status: EvoHacks 2.0 hackathon build (deployed on GitHub Pages + Supabase)
Theme: Projects for Social Good
Planning source: EvoHacks2.0 Planning (team Google Doc)
Developer instructions: AGENTS.md
Safety and honesty: WaterMark is a prototype for exploring environmental data, not an official warning service, certified flood model, evacuation system, or guarantee of safe conditions. Follow authoritative government warnings and local emergency instructions. A lack of data is not a lack of risk.
Flooding and extreme rainfall affect homes, schools, public infrastructure, and emergency response, yet critical context is scattered across weather forecasts, government flood maps, tide gauges, local sensors, and historical incident datasets. Many residents and volunteer responders cannot quickly reconcile those sources for a block they care about.
WaterMark brings that evidence together on a fast, accessible 2D map (https://watermark.works/map) with global baseline coverage and enriched NYC/US layers. A visitor can explore without signing in, search any location or zoom straight down from the globe to a single city block, scrub ten years of historical flood episodes and causes, inspect a deterministic Flood Outlook with a grounded AI block summary, ask questions by text or voice, switch into tailored audience views, and review screened official alert emails.
The initial motivation comes from coastal and flood-prone communities such as Coney Island, the Rockaways, and Red Hook in New York City, while keeping the 2D map useful anywhere in the world and clearly disclosing where local datasets are unavailable.
- Homeowners and residents: Active NWS warnings, local rainfall forecasts, stormwater exposure, ZIP-level OpenFEMA NFIP insurance claims context, and the Move Your Car higher-ground elevation lookup.
- Schools: Campus flood exposure, nearest modeled river and elevation approach bearing, and active warnings ahead of arrival or dismissal.
- Community Emergency Response Teams (CERT): Priority flood blocks ranked from historical episodes, FloodNet sensors, and 311 calls, plus the screened
/alertsinbox. - Volunteer fire departments: Check-first streets and blocks, FloodNet street sensors, NOAA tide gauges, and hands-free voice-assisted queries.
- Interactive 2D Map (
MapLibre GL JS v6): Light and dark map styles, global NASA GPM IMERG rainfall & 30-day GDACS flood layers, Photon/OpenStreetMap place search, and Back/breadcrumb/Escape/open-water navigation. - Automatic zoom-to-focus selection: Zooming smoothly steps from World → Country → State/Province → US County → Grid Block under your cursor with hysteresis thresholds so exploration requires zero manual clicking.
- Flood timeline & NOAA cause analytics: Play/pause year-by-year timeline slider (
2016–2025+All years) built from deduplicated NOAA Storm EventsEPISODE_IDrecords and GDACS history, with flood-cause breakdowns (heavy rain, flash floods, coastal surge, tropical systems, snowmelt, dams/levees, lakes). - Evidence-labeled point & circle-area reports: Official NWS alerts, Open-Meteo rainfall forecasts and ERA5 rain history, Copernicus GloFAS v4 river discharge, static NYC Stormwater vector tiles (
Limited,Moderate,Extreme), FEMA NFHL flood zones, FloodNet NYC street sensors, NOAA tide gauges, USGS stream gauges, NYC 311, and OpenFEMA NFIP v3 claims—queried with Turf.js and Supabase PostGIS. - Flood Outlook & AI block summaries: Deterministic flood recurrence and busiest-season analysis paired with an AI block/region summary (
outlook-summaryEdge Function) verified to quote only computed figures. - Voice-enabled Flood Assistant: Grounded Google Gemini assistant (
assistantEdge Function) using function-calling tools over WaterMark's own data lookups, browserSpeechRecognitionmic input, budgeted ElevenLabs read-aloud (watermark-tts) with browserspeechSynthesisfallback, plus per-client and global rate-limit safeguards. - Agentboxd alert inbox (
/alerts) & optional sign-in: Screened USGS/NWS/FEMA alert email digests with positive sender authentication and quarantine, alongside optional guest-first MojoAuth email-code and Agentboxd OIDC + PKCE login (auth-verify). - Five-language localization: English, Spanish (
es), Chinese (zh-Hans), Russian (ru), and Hindi (hi) UI and voice language contract.
- Drought, lake/reservoir depletion, and groundwater depletion.
- Predicting an exact home's flood depth, guaranteed safe driving routes, or replacing official NWS, NYC, NOAA, or FEMA warnings.
- Fabricated flood probabilities or hiding missing data as "low risk".
- Landing page (
/): Interactive glass droplet hero, continuous scroll-driven 2D flooding city parallax (#how) with live interactive previews for all 10 capabilities, underwaterEvidenceSeaexplaining the 7 evidence types, public dataset catalog (#data), tailored audience cards (#audiences), team credits (#team), and footer. - Flood map (
/map): Opens directly in guest mode. Search any place, zoom into a block, draw a circle, scrub the flood timeline, switch audience views (Homeowner,School,Fire & CERT), inspect Flood Outlook + AI summaries, or open the voice-enabledAsk WaterMarkassistant. - Alert inbox (
/alerts): Screened official alert email summaries via Agentboxd with links to the authoritative agency record. - Optional account (
/login,/signup): Guest-first access never blocks/map; sign-in supports MojoAuth email codes and Agentboxd OIDC when configured.
| Data type | Example | What it can support | What it does not prove |
|---|---|---|---|
| Official active warning | NWS flood warning | An authority issued a warning covering an area | Precise water depth at an individual property |
| Forecast precipitation | Open-Meteo hourly/daily rain | Predicted amount and timing of rain | That a particular street will flood |
| Modeled river discharge | Open-Meteo / Copernicus GloFAS | Expected river flow at supported river points | Coastal storm surge or urban storm-drain flooding |
| Scenario-based exposure | NYC stormwater flood maps | Areas modeled to flood under specified rain scenarios | That flooding is occurring now |
| Regulatory mapped hazard | FEMA NFHL flood zones | Designated mapped flood hazard areas | A live flood observation or deterministic short-term forecast |
| Sensor / satellite observation | FloodNet, NOAA tides, USGS, NASA IMERG | Measurements at the sensor's place/time or satellite granule | Conditions at every nearby street or home |
| Historical record | NOAA Storm Events, GDACS, NYC 311, NFIP claims | Prior episodes, causes, reports, or claims in an area | Current flooding or proof an unreported area is safe |
- Global baseline: Map navigation, Photon place search, NASA GPM IMERG rainfall, GDACS global floods, Open-Meteo rainfall forecasts & ERA5 history, Copernicus DEM elevation, and GloFAS river discharge forecasts.
- US baseline: NWS active alerts, NOAA Storm Events episodes & flood causes, FEMA NFHL flood zones, NOAA Tides & Currents, USGS stream gauges, US Census TIGERweb ZCTAs, and OpenFEMA NFIP v3 claims.
- NYC enriched demo: Static NYC Stormwater Flood Map vector tiles (
public/data/stormwater/), FloodNet street sensors, NYC 311 street-flooding reports, and NYC hurricane evacuation zones.
| Provider / dataset | Use in WaterMark | Geography / interpretation |
|---|---|---|
| NWS alerts API | Active official warnings | United States; authoritative agency wording and timestamps |
| Open-Meteo weather & historical ERA5 | Forecast & historical daily precipitation | Global gridded model/reanalysis, not a rain gauge |
| Open-Meteo Flood API / GloFAS v4 | Modeled river discharge forecasts | Global modeled river cells (~5 km), not coastal surge |
| Open-Meteo Elevation (Copernicus DEM) | Ground elevation & Move Your Car / School bearings | Global ~90 m DEM; elevation alone does not set risk |
| NASA GPM IMERG (via GIBS) | Near-real-time global precipitation overlay | Global (~0.1°, fades past native zoom) |
| GDACS | 30-day active flood alerts & 2001–2025 country archive | Global international flood events |
| NOAA Storm Events Database | 2016–2025 US flood episodes & causes | US; deduplicated by EPISODE_ID per state/county/square |
| NYC Stormwater Flood Maps | Static vector tiles (Limited, Moderate, Extreme) |
NYC scenario/exposure, not live events |
| FloodNet NYC | Street-flooding sensors & depth events | NYC sensor footprint |
| NYC 311 service requests | Historical street-flooding reports | NYC historical public reports |
| FEMA NFHL | Regulatory flood-hazard polygons | US mapped hazard context |
| OpenFEMA NFIP claims v3 | ZIP-level historical flood insurance claims | US; aggregate historical context only |
| NOAA Tides & Currents | Coastal water-level measurements | US tide stations (e.g. The Battery, Sandy Hook) |
| USGS Water Data APIs | Stream gauge observations & screened alerts | Selected US stream gauges |
| NYC Hurricane Evacuation Zones | Coastal emergency planning zones | NYC reference zones |
| US Census TIGERweb / ACS | ZCTA lookup & neighborhood context | United States |
| Photon (komoot) / OpenStreetMap | Global place, ZIP & address search | Global geocoding |
WaterMark runs as a static React + Vite frontend on GitHub Pages (https://watermark.works, built by .github/workflows/deploy-pages.yml with per-route 200 SPA HTML indexes) backed by Supabase PostgreSQL + PostGIS and Supabase Edge Functions:
Browser (React 19 + TypeScript + Vite + Astryx + MapLibre GL JS v6 + Turf.js)
├── / Landing page, droplet hero, 2D city parallax, EvidenceSea, team credits
├── /map 2D map, zoom-to-focus, flood timeline, role views, voice Gemini assistant, Flood Outlook
├── /alerts Screened Agentboxd official alert email inbox
└── /login Optional guest-first MojoAuth / Agentboxd OIDC sign-in
│
├── Public APIs (NWS, Open-Meteo, GloFAS, FloodNet, FEMA, OpenFEMA, NASA GIBS, GDACS, Photon)
│
└── Supabase Edge Functions (Deno / TypeScript) + PostgreSQL / PostGIS
├── watermark-v1 Normalized flood data API & PostGIS area queries
├── assistant Rate-limited Google Gemini proxy (grounded tool calls)
├── outlook-summary Verified AI block/region summary generator
├── watermark-tts Budgeted ElevenLabs text-to-speech proxy
├── alert-inbox Agentboxd alert email ingestion & sender-auth quarantine
└── auth-verify MojoAuth & Agentboxd OIDC + PKCE verification
- Frontend technologies: React 19, TypeScript, Vite 8, React Router 7, Astryx (
@astryxdesign/core), MapLibre GL JS v6, Turf.js, Lenis, Vitest, ESLint. - Backend technologies: Supabase Edge Functions, PostgreSQL + PostGIS, Google Gemini API, ElevenLabs TTS API, Agentboxd, MojoAuth.
- Deployment & CI: GitHub Pages (
https://watermark.works), PR frontend quality gates (.github/workflows/frontend-ci.yml), TTS CI (.github/workflows/tts-ci.yml), and Cloudflare Pages PR previews.
| Priority | Feature | Status | Implementation notes |
|---|---|---|---|
| P0 | Public, responsive 2D map & place search | Built | MapLibre v6 light/dark styles + Photon geocoding (PR #6, #38) |
| P0 | Automatic zoom-to-focus selection | Built | Drills World → Country → State → US County → Block under cursor (PR #39) |
| P0 | Flood timeline & NOAA cause breakdown | Built | Play/pause 2016–2025 slider, deduplicated EPISODE_ID counts, flood causes (PR #25) |
| P0 | Official alerts, rainfall, river & sensor layers | Built | NWS, Open-Meteo, GloFAS, FloodNet, NOAA tides, USGS, NASA IMERG, GDACS (PR #4, #6, #36) |
| P0 | NYC stormwater vector tiles & FEMA zones | Built | Static vector tiles (public/data/stormwater/) + FEMA NFHL (PR #6, #9) |
| P0 | GitHub Pages production deployment | Built | Live at https://watermark.works with 200 SPA route indexes (PR #10, #11, #35) |
| P1 | Circle-area report & PostGIS queries | Built | Turf.js area report & Supabase PostGIS backend (PR #4, #6, #36) |
| P1 | Flood Outlook & AI block summaries | Built | Recurrence & seasonality + verified AI summary (PR #28) |
| P1 | Voice-enabled Gemini flood assistant | Built | Grounded tool calls, mic voice input, rate limits & kill switch (PR #23, #26) |
| P1 | Agentboxd alert inbox (/alerts) |
Built | Screened official alert emails with sender-auth quarantine (PR #21, #31, #33) |
| P2 | Budgeted ElevenLabs voice read-aloud | Built | watermark-tts Edge Function with character budget & browser fallback (PR #29) |
| P2 | Tailored role views & Move Your Car | Built | Homeowner (NFIP + Move Your Car), School, Fire & CERT + Back/Esc (PR #24, #27) |
| P2 | 5-language localization & optional login | Built | en, es, zh-Hans, ru, hi + MojoAuth & Agentboxd OIDC (PR #1, #7, #20) |
| Planned / Unused | OpenRouter Llama fallback, Decodo scraping, SMS alerts, .xyz domain, AWS Amplify |
Not used | Replaced by Gemini, official public APIs, and GitHub Pages (watermark.works) |
- Google Gemini (
assistant&outlook-summary): Powers both the grounded flood chat assistant and block/region Flood Outlook summaries. The browser performs public data lookups and passes tool/figure context to the Edge Function; responses are checked for grounding and rate-limited (PR #23,#26,#28). - ElevenLabs (
watermark-tts): Budgeted text-to-speech output for assistant replies with automatic browserspeechSynthesisfallback (PR #29). - Agentboxd (
alert-inbox&auth-verify): Ingests and screens official USGS/NWS/FEMA alert emails with sender-auth quarantine (PR #21,#31,#33) and provides optional AI-agent OIDC + PKCE sign-in (PR #20). - MojoAuth (
auth-verify): Optional passwordless email-code authentication without blocking guest map exploration (PR #7).
Note: Earlier planning doc notes evaluated OpenRouter Llama fallback, Decodo web scraping, AWS Amplify, SSOJet, SMS alerts, and a .xyz domain; none of those were needed because Gemini, official public APIs, GitHub Pages (watermark.works), MojoAuth, and Agentboxd covered the shipped stack.
Cross-referenced against the Google Doc Assignments tab and merged pull requests / commits on main:
- Landing page, 2D flooding city parallax & Astryx design system (
PR #9,#30): Vite + React 19 setup, custom Astryx theme (themes/watermark/), interactive droplet hero with title scramble, continuous scroll-driven flooding city parallax (FloodStory),EvidenceSea,TeamSection,Footer, Photon place search, and mobile sticky/overlap fixes (c26127b,f949e61,9996572,6ce43fd,4d96a28,97626e7,688e5e3). - Voice-enabled Gemini flood assistant (
PR #23): BuiltAssistant.tsx,useAssistant.ts,scripting/assistant.ts,services/assistant/tool-calling client, browserSpeechRecognitionmic input & read-aloud controls, and thesupabase/functions/assistant/Gemini proxy (1c9900f). - AI summaries for blocks & areas + Flood Outlook (
PR #28): BuiltFloodOutlook.tsx,useFloodOutlook.ts,scripting/outlook.ts,services/outlook/, and theoutlook-summaryEdge Function for deterministic recurrence/seasonality plus grounded AI block summaries (be1fa1b). - Automatic zoom-to-focus selection (
PR #39): BuiltzoomFocus.tsand map zoom tracking so zooming drills seamlessly from World → Country → State/Province → US County → Grid Block under the cursor (6686101,e8e03cb,4dee83a). - Flood timeline & NOAA episode cause analytics (
PR #25): Built the year-by-year play/pause flood slider, deduplicated NOAA Storm Events byEPISODE_ID, added Storm Surge/Tide & Seiche records, and added flood-cause bars (6d4710b,74fea57). - Map performance, stormwater vector tiles & GitHub Pages CI/CD (
PR #10,#11,#38): Restyled/map, built static NYC stormwater vector tile pipeline (scripts/stormwater/), wired live NFIP claims, fixed MapLibre v6 worker loading (0e0fbd3), and configured GitHub Pages auto-deployment towatermark.works(f2c90eb,0c836db,c3a396f,26cdbf0).
- Supabase PostGIS & Edge Function flood data API (
PR #4,#36): Builtwatermark-v1with NWS, Open-Meteo, GloFAS, FloodNet, PostGIS spatial queries, provider health, and missing-data safety (dbd2922,820f811,06fcddf,7f46ac9). - Budgeted ElevenLabs voice read-aloud (
PR #29): Built thewatermark-ttsEdge Function with character budgets, concurrency guards, andservices/voice/output.tsbrowser fallback (3b5f9fc). - Agentboxd alert inbox (
PR #21,#31,#33): Built/alertsandalert-inboxEdge Function for screened USGS/NWS/FEMA alert emails with positive sender authentication and quarantine (329c1b0,5dc739d,948bcb0,380be18). - Optional guest-first authentication (
PR #7,#20): Built MojoAuth email-code login, Agentboxd OIDC + PKCE sign-in, andauth-verifyEdge Function (f9064c8,e3fdef5,8735137). - Five-language localization, landing scaffold & CI (
PR #1,#3,#8,#35): Builten/es/zh-Hans/ru/hilocalization and voice contract, initial landing/theme scaffold, frontend quality gates, and 200 SPA route HTML indexes (3a5d3f5,b249ef5,f456e1e).
- Interactive 2D MapLibre flood map (
PR #6): Built and ported/mapwith light and dark OpenFreeMap styles and layer re-attachment (0dce0bd,dda6f4d,2b89372). - Draggable data panel & Turf.js circle-area report (
PR #6): BuiltDataPanel.tsx,useDraggablePanel.ts,AreaReport.tsx, anduseAreaReport.ts(2b89372). - Global hazard layers (
PR #6): Added NASA GPM IMERG rainfall overlay and 30-day GDACS global flood events (133f9e8,2b89372). - FloodNet / NFIP starter data & sources bibliography (
PR #6): Built starter data pipeline (scripts/watermark_data.py) and toggleableSourcesListbibliography (b2d300e,2b89372). - Move Your Car concept: Originated the parking/exposure concept in the planning doc, realized on
/mapas an informational lookup.
- Audience role views & Move Your Car (
PR #24): Built Homeowner (insurance claims), School (campus flood approach), and Fire & CERT (priority flood areas) views, Move Your Car elevation/parking lookup, and finer high-zoom detail (152cf8c). - Flood assistant hardening (
PR #26): Added per-client and global rate limits, kill switch, bounded Gemini requests, and untrusted browser-data safeguards (b117bbe). - Map selection navigation (
PR #27): Added Back button, breadcrumb trail, Escape key support, and World reset clearing selection (997cab0). - Cross-branch merge resolution (
PR #32): Resolved merge conflicts for PRs #21, #24, and #28 and reviewed/merged PR #23 (c340955).
WaterMark/
├── README.md # Project brief, architecture, sources, credits
├── AGENTS.md # Agent rules, ownership boundaries, safety gates
├── .github/workflows/ # deploy-pages.yml, frontend-ci.yml, tts-ci.yml
├── docs/ # Auth, voice, and alert integration docs
├── supabase/
│ ├── config.toml # Edge Function configuration (verify_jwt=false)
│ ├── functions/ # watermark-v1, assistant, outlook-summary, watermark-tts, auth-verify, alert-inbox
│ ├── migrations/ # PostGIS & feature schema migrations
│ └── tests/ # Deno/SQL backend unit & concurrency tests
└── WaterMark/ # Vite + React 19 + TypeScript web app
├── .env.example # Public VITE_* placeholder env names
├── public/data/ # Static stormwater vector tiles & NOAA/GDACS flood archives
├── scripts/ # stormwater/ tile builder, floods/ NOAA+GDACS builder
├── src/ # App.tsx, components/, context/, hooks/, scripting/, services/, styling/, themes/
└── tests/ # Vitest unit & component tests
cd WaterMark
npm ci # install locked dependencies
cp .env.example .env.local # optional: configure Supabase function URLs & local dev keys
npm run dev # local Vite dev server (includes /api/assistant & /api/outlook-summary dev proxies)
npm test # Vitest unit tests
npm run lint # ESLint
npm run build # tsc -b && vite build -> dist/Deployment runs automatically on pushes to main via .github/workflows/deploy-pages.yml, publishing WaterMark/dist/ to GitHub Pages at https://watermark.works. Never commit secrets; VITE_* public endpoints live in GitHub Actions repository variables and server API keys (WATERMARK_GEMINI_API_KEY, ELEVENLABS_API_KEY, etc.) live in Supabase secrets.
WaterMark is a prototype, not an emergency alert authority. Confirm all time-sensitive conditions with official sources.