Inspiration

A small water system gets one lab report and a lot of jargon. The numbers are there, but the decision is not: which reading is actually above its limit, what the combined PFAS mixture means when no single chemical is, and what to do first. I wanted a field notebook that answers those questions on a laptop with no internet, because the places that need it most are the places with the worst connection. SDG 6 is about clean water and sanitation for everyone, and a lot of that work starts with being able to read your own sample.

What it does

WaterWatch reads a strict CSV of drinking-water measurements, screens every reading against federal benchmarks, and shows which taps are above their reference levels. It compares the inorganic readings with WHO guideline values, points to likely contamination sources, and prints a one-page community water field audit sheet in English or Spanish.

The four synthetic presets each teach a different failure. The School tap has a first-draw lead reading of 24.6 ppb against a 10 ppb action level, and the flushed pair drops to 3.1, which shows why sampling timing matters. The Industrial corridor has no single PFAS above its own limit, but the combined Hazard Index is 1.27, above 1. After the storm has a boil advisory, a positive E. coli result, and nitrate at 13.6 mg/L above the 10 mg/L benchmark. The Municipal baseline is the negative control, with everything inside the screened benchmarks.

The SDG 6 equity lab models the 6.1.1 service ladder, a 6.3.2 exceedance profile, and an illustrative 6.4.2 stress index, then plans low-cost interventions against a grant budget. The mixture and sensitivity lab compares all four presets against every benchmark, runs 32 deterministic self-tests inside the page, and exports a SHA-256 stamped brief that a bookmark link restores.

Everything runs in the browser. The Content-Security-Policy forbids network connections, and every computation is local JavaScript.

How I built it

WaterWatch is plain ES modules, HTML, and CSS with no dependencies and no build step. The engine stores every reading as an exact scaled decimal, so comparisons never depend on floating point, and it never rounds a value before comparing it. Significant-figure rounding from the 2024 PFAS rule is shown as context only.

The import layer is a strict tokenizer and decoder. Uploads are capped at 1 MB and 500 data rows, must include a tap column plus at least one advisory, E. coli, or measurement column, and fail closed with row and field detail. Empty cells stay unreported, and ND or < results are never converted to zero.

The mixture math follows EPA practice: the Hazard Index covers PFHxS, PFNA, GenX, and PFBS, and a mixture needs at least two constituents at or above their practical quantitation levels. Exports are an audit CSV and a fingerprinted JSON bundle, each tagged synthetic or unverified-input based on where the data came from.

I verified it with 784 Node tests, 32 in-page self-tests, a headless Chrome smoke run, and a separate browser audit of the SDG 6 lab with real pointer and keyboard input, reload restore, and a routed download.

Challenges I ran into

The hardest rule was rounding. The PFAS rule uses significant figures, and it is very easy to round a reading into compliance. I ended up comparing the exact stored decimal and showing the rounded value beside it, so a reading like 3.999 ppt can display as 4.0 while the comparison still uses the real number.

The second challenge was advisory logic. During a boil notice or a positive E. coli result, every modeled reduction has to be withheld, because a household filter is not an advisory fix. That meant the models could not be a separate panel with their own assumptions. They had to read the same state as the screen and disable themselves.

The third was honesty about sources. "Likely sources" can sound like a diagnosis, so the diagnostic is built only from the EPA regulations table and simple patterns in the loaded taps, and every hint is labeled as a screening hint that points to where to look.

Accomplishments that I am proud of

  • 784 Node tests pass, plus 32 in-page self-tests that a judge can run with one click.
  • No single PFAS is above its limit in the Industrial corridor, and the app still catches the mixture at 1.27.
  • The print sheet works in two languages on one page, from the same data as the screen.
  • Every export is tagged with its origin, so synthetic data can never be mistaken for a real sample.
  • The app is fully offline under a policy that blocks connections, not just a promise in the README.

What I learned

A screening tool is mostly a communication problem. The math has to be exact, but the value comes from saying clearly what a result does and does not mean. I also learned to design the negative control first. The baseline preset caught more confusion in my own UI than the dramatic cases did.

What is next

Next I want to add more sample provenance fields, a printable Spanish-first version for community meetings, and a way to compare two sampling rounds for the same tap so a community can show change over time. I also want to expand the intervention planner so the budget model can account for maintenance, not just install cost.

SDG alignment

SDG 6, Clean Water and Sanitation. The app maps directly to target 6.1 on safe drinking water, target 6.3 on water quality and contamination, and target 6.4 on water stress. The equity lab makes the 6.1.1 service ladder and the 6.3.2 exceedance picture explicit, then plans low-cost interventions against a grant budget.

AI disclosure

The app makes no model calls and no network requests at runtime. I used AI coding assistants while building and reviewing it, and every change was verified with the local test suites and browser audits listed above.

Built With

Share this project:

Updates

Submission history