Well-switching programmes in Bangladesh label each tested tube well "safe" or "unsafe" (Jameel et al. 2021). A household at an "unsafe" well still has to work out the real question on its own: which of my neighbours' wells is actually lower, and is it close enough to walk to every day? NextWell answers that question from the readings the tester already has, and then scores its own answer against lab results. It is a prototype: a recalculation on a 1999 survey of 236 wells, not something tested in a village.

SDGs: 6.1 safe and affordable drinking water; 3.9 illness and death from water contamination.

Inspiration

Arsenic in well water is still a daily exposure in Bangladesh. The MICS 2019 Water Quality Thematic Report (Bangladesh Bureau of Statistics and UNICEF) puts it this way: "11.8 per cent of the population – 17.5 million people – remain exposed to arsenic in their drinking water above Bangladesh's national standard of 50 ppb." Report PDF

A new deep well is not the only answer. Jamil et al. (2019) compared 18 years of arsenic mitigation in Araihazar: testing 48,800 wells and letting households switch reached 220,000 exposed people and reduced exposure for about 132,000 of them, at about $1 per person whose exposure was reduced. Deep tubewells came to $143 per person. (Environmental Science & Technology 53(10), Table 1; the same table is reprinted in Asian Development Review 37(2).) That is one sub-district, and the authors' own cost accounting.

What caught my attention was a modelling result about how readings are communicated. Jameel et al. (2021) simulated well-switching scenarios with Araihazar data and concluded that "providing kit data at the maximum possible resolution rather than merely classifying wells as unsafe or safe would be even better." (GeoHealth, doi:10.1029/2021GH000464) That is a simulation, not an observed change in behaviour, but the logic is simple: a number invites a comparison, and a painted mark does not.

So the idea is small on purpose: keep the numbers, and do the comparison for every well in a village at once.

What it does

NextWell is a static web app for the person who holds a village's test results, such as a health volunteer or an NGO field worker.

1. Wells. You open a real survey or enter your own wells: position, field-kit reading, and whether the owner agrees to share. Each well is drawn at its coordinates on a plain grid, coloured by its reading on a continuous scale with marks at 10 µg/L (WHO guideline) and 50 µg/L (Bangladesh's limit). There is no red/green split.

2. Switching plan. For every well above 50 µg/L, NextWell looks for a candidate and draws an arrow to it. The rules are fixed and short:

  • Only users of a well above 50 µg/L get a candidate.
  • A candidate must be within a straight-line distance (a slider, 50 to 300 m), marked as shared by its owner, and read at most half of your well's reading. Half is my own cautious design choice for imprecise field kits. It is not a validated safety factor.
  • The lowest reading wins; ties go to the nearer well.
  • If nothing qualifies, the well is listed as "no lower well in range". An untested well is never offered to anyone; it is listed as "test first".

3. Lab check. One toggle scores the same plan with laboratory values the plan never saw. A lab result reported as "<30" is counted as 15 in the means.

4. Notice. One page for the households of a single well, in English and Bangla: the candidate well, the direction, the straight-line distance, both readings, a small map, and "ask the owner's permission and check the real path".

What happens on real data

The built-in village is Mandari, Lakshmipur district: 236 tube wells sampled in November 1999 by the British Geological Survey and Bangladesh's Department of Public Health Engineering, each with coordinates, a field-kit reading and a lab value.

With a 200 m straight-line distance (a recalculation on the 1999 survey; every count is wells, not people or households):

Before After
Wells above 50 µg/L, field-kit readings (of 236) 175 80
Mean reading at the well in use, µg/L 118 48
Wells above 50 µg/L, scored with lab values 166 76
Mean at the well in use, lab values, µg/L 121 53
  • 113 wells get a candidate, spread over 39 receiving wells. The median straight-line distance is 135 m.
  • All 113 candidates are lower by lab value too. This is a look-back on the same 1999 sample. It shows the moves point in the right direction; it does not show that the rule is safe or that it would work in a village today.
  • 62 wells have no candidate within 200 m. NextWell lists them instead of guessing.
  • 18 candidates are lower but still above the limit. They get their own colour and the words "lower, still above the limit".
  • 6 receiving wells would take users from 6 or more other wells (one takes 11). They are ringed as crowded. That is a warning from a count of wells; the app knows nothing about households, yield or capacity.
  • At 100 m, 136 wells stay above the limit. At 300 m, 57.

These numbers come from applying the rules to a 1999 survey. They are not a result measured in a village, and the unit is a well, not a number of people. "Lower" is not "safe". Real paths, real permission and today's water quality are all outside the data.

How we built it

I fixed the calculation rules in writing first, ran them once on the survey, and wrote the resulting numbers down. Only then did I write the app, with those numbers as unit tests. If the code ever disagrees with the table above, the build fails.

  • React 19 + TypeScript + Vite, built as a static site. No server, no account, no external API, no analytics.
  • The rules are four pure functions in one file (src/lib/plan.ts): build the plan, score it before and after, summarise it, compare kit with lab. 15 Vitest tests cover the edge cases (exactly half, out of range, ties, unshared wells, untested wells) and lock the Mandari numbers.
  • The map is hand-written SVG. Wells are plotted from their coordinates on a metre grid with a scale bar. No map tiles: nothing to load on a weak connection, and no key that can expire during judging.
  • Colour is a continuous log scale, not categories.
  • What you type stays in the browser (local storage).
  • The repository contains only the processed columns the app needs, with the BGS/DPHE citation. The README links the original CSV and lists the exact columns and the two changes made, so the numbers can be reproduced with npm test.
  • Deployed as a static build on Vercel from the public GitHub repository.

Challenges we ran into

The first version of the idea used an invented village. A review of my outline pointed out that an invented village proves nothing. I threw it out and searched for a real survey with both kit readings and lab values for the same wells. The Mandari survey has exactly that, which is what made the lab check possible.

The data has no people in it. I wanted to say "412 people exposed, now 96". The survey has no household counts, so every figure is in wells, and the app says so next to the numbers.

Being honest about "safe". Halving a reading of 300 gives 150, which is still three times the limit. Those cases are shown separately. The plan uses the word "candidate", never "recommended" or "safe".

Bangla I cannot check. I do not read Bangla and had no native reviewer. The Bangla text appears only on the notice, labelled "Machine-translated, not reviewed by a native speaker", under a "DEMO – not for distribution" watermark.

Accomplishments that we're proud of

  • The plan is checked against independent lab measurements, and the app shows that check to the user rather than keeping it in a README.
  • It says what it does not know: 62 wells with no option, 4 wells where the kit says "under the limit" and the lab disagrees, crowded wells, a 27-year-old survey.
  • The whole decision fits in four rules a field worker can read and argue with.

What we learned

  • A threshold hides the information people need. 175 wells in Mandari were "unsafe"; that word alone tells none of them where to go.
  • A margin is worth having. Requiring half-or-less looks crude, and on this one sample every one of the 113 moves also survived the lab comparison. One village in 1999 is not enough to call the ratio right.
  • Distance is the big lever in this data. Going from 100 m to 300 m moves the result from 136 to 57 wells above the limit.
  • The same data also shows the kit's limits: for 4 of 236 wells the kit reads under 50 µg/L and the lab reads above it. Those households would be told to stay.
  • Fixing the expected numbers before writing code made the tests meaningful.

What's next for NextWell

  • Put it in front of someone who does this work, and have the Bangla reviewed by a native speaker. Until then it is a demo.
  • People, not wells: let the tester enter how many households use each well, and cap how many a receiving well can take.
  • Real paths instead of straight lines, and a way to record that an owner said no.
  • Work offline as an installable app, and export the plan.
  • District and depth context from the national BGS/DPHE survey (3,534 wells) for villages with few tests.

Data and acknowledgement

BGS and DPHE. 2001. Arsenic contamination of groundwater in Bangladesh. Kinniburgh, D G, and Smedley, P L (editors). British Geological Survey Technical Report WC/00/19. (Nottingham, UK: British Geological Survey.)

This material was produced by the British Geological Survey and the Department of Public Health Engineering (Bangladesh) undertaking a project funded by the UK Department for International Development (DFID). Any views expressed are not necessarily those of DFID.

AI use

AI coding assistance was used to write the code, tests and this text. No AI model runs in the app; every result comes from the four fixed rules.

Built With

Share this project:

Updates

Submission history