A public dashboard built with Next.js that helps Iowans understand local drinking and recreational water quality—starting with nitrate, nitrite, E. coli, PFAS, arsenic, disinfection byproducts, and fluoride trends.
Install dependencies and launch the local dev server:
npm install
npm run devThe app runs at http://localhost:3000.
Generate the initial water JSON cache (rebuild whenever upstream data changes):
npm run water:etlThe shared types for the data/API track live in src/types/water.ts. The core contract is the WaterSeriesResponse JSON shape returned by all water endpoints:
type WaterSeriesResponse = {
contaminant: "nitrate" | "nitrite" | "ecoli" | "pfas" | "arsenic" | "dbp" | "fluoride"
metric: string
unit: string
source: string
sourceUrl?: string
updatedAt: string
region: string
regionType?: "state" | "county" | "system" | "watershed" | "site" | "custom"
systemId?: string
points: Array<{ date: string; value: number | null }>
status: "safe" | "warn" | "alert" | "unknown"
threshold?: WaterThreshold
advisories?: WaterAdvisory[]
notes?: string
}Base thresholds and health copy are defined in src/lib/water/thresholds.ts.
Stubbed JSON responses that power early UI work are stored under public/data/water/.
All routes return the WaterSeriesResponse contract unless noted otherwise.
GET /api/water/nitrate— Optional query params:systemId,zipGET /api/water/nitrite— Optional query params:systemIdGET /api/water/bacteria— Optional query params:systemId,type=ecoliGET /api/water/pfas— Optional query params:systemIdGET /api/water/arsenic— Optional query params:systemId,countyGET /api/water/dbp— Optional query params:systemId,kind=tthm|haa5GET /api/water/fluoride— Optional query params:systemIdGET /api/water/advisories— Optional query params:type=boil|swim|pfas
Routes will hydrate from cached JSON in public/data/water first, then upgrade to live adapters in src/lib/water/iowa-datasources.ts.
src/lib/water— Thresholds, alert logic, data-source adapters (WIP)src/app/api/water/*— Route handlers (to be implemented with ISR)scripts/water-etl— Data fetchers that normalize CSV/API sources intopublic/data/water
- Use feature branches and open PRs for review.
- Keep TypeScript strict by expanding schemas in
src/types/water.ts. - Update stub JSON and tests whenever the contract changes.
This project inherits the upstream UN Climate template license until rebranded assets and copy are finalized.