Inspiration

Inspiration

I am a civil and building engineer from the Mt Elgon region of eastern Uganda, and I have designed and inspected the culverts, low-level crossings and access roads that this system models.

Forecasts are not the failure. In the April 2024 Kenya floods, area-level warnings existed days ahead; the specific settlements in the flow path were never individually warned. The gap is the last mile: a forecast says the river will rise, and nobody translates that into which bridge fails, which villages lose their only road to a clinic, and who does what about it.

That translation is engineering knowledge. It is my native domain, and no early-warning tool in the region models it.

What it does

LIFELINE represents a district as typed objects — river reaches, bridges, roads, settlements, clinics, schools, water points — and typed links recording their physical and service dependencies.

A flood trigger raises a hazard on the river graph. The engine determines which crossings fail under versioned fragility rules, removes them from the road network, and re-tests every settlement's route to every facility that serves it. The output is a per-asset impact state, each carrying a why-chain, each mapped to a pre-agreed playbook action with an owner and a lead time.

On the Manafwa pilot at emergency severity: 77 impacts, 62 settlements isolated from a clinic, 213 actions, 0 uncovered.

How I built it

FastAPI + SQLite + Leaflet on a single VPS, run-rate about zero. Assets come from OpenStreetMap via Overpass. River discharge comes from GloFAS through the Open-Meteo flood API. Thresholds are empirical return periods computed from 29 years of reanalysis at an operator-verified grid cell.

The graph is two SQLite tables and the engine is a plain deterministic BFS. Identical inputs produce identical outputs, including identical why-chains.

Challenges I ran into

The road network did not connect. In OSM a bridge is its own way, so the roads either side share no vertex. The district was two disconnected components and only 10 of 83 settlements had any route to a clinic before a single drop of rain. Roads carrying the same crossing now join through it.

A false all-clear, live. A village whose own access road was severed reported no impact, because a zero-hop path was never tested against the severed set. That is the exact failure this product exists to prevent, and it was in my own engine.

The wrong river. The 4.3 km demo reach straddles three GloFAS cells reading 67.7, 6.1 and 91.5 m³/s — non-monotonic downstream, so two of them model a different river. A dead cell reads zero and screams; a wrong cell reads 91.5 and looks like data. Cells are now signed by an engineer, never auto-snapped.

My own template was refused. I wrote "there is no other road" into a broadcast message and the loader rejected it — the guard matches denials as well as offers, because a substring match cannot read negation. The wording it forced is stronger: "It is the only road."

What I learned

Every serious bug in this build was a false all-clear wearing the costume of a clean result. An unknown structure defaulting to the sturdiest option. A dead feed returning an empty list. A state with no colour inheriting the healthy green. None of them crashed. All of them reassured.

So the rule became: never fail toward all-clear. An unclassified crossing is scored as the most fragile structure. A feed failure raises rather than returning quiet. An impact with no action is reported by name. A gap the officer can see is not the same failure as a gap nobody knows about.

What's next

Co-production with a district disaster committee: officers review the crossings, the fragility assumptions and every playbook row. Then one rainy season with post-event capture of what actually happened per asset. Then anticipatory-action programmes, whose protocols need exactly this trigger-to-action structure.

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for LIFELINE — asset-level flood early warning

Built With

Share this project:

Updates

Submission history