Jaga has to work on a cheap phone, on a slow connection, in a power cut, at three in the morning, in three languages. And it must never show a stranger where somebody is waiting on a roof. This page is the shape of the thing: how it is put together, what it refuses to do, and what happens when parts of it fail.
No supplier, product or brand is named on this page. Two reasons: what matters is the shape and not our shopping list, and a public page listing every service a safety app depends on is a map for anyone looking for a way in. A test keeps the page that way.
Over 70 tables, each with its own access rules
Over 80 database changes, every one kept
About 1,300 automated checks on every change
Three languages, one source of truth
The architecture, end to end
Five bands, read downwards: where the figures come from, what fetches them, the one place that holds everything and decides who may read each row, what delivers it, and the people at the end of it. What travels between two bands is written on the arrow.
From the agencies' gauges to a phone in a flooded village
Where the figures come fromnone of it ours
Agency telemetryRiver gauges, the dam's hourly figures, rainfall from the national networksWeather, wave and flow modelsRain and river forecasts, waves and sea level off the coastMap layers from the analysisFlood-prone classes, the dam's release zone, safe places: made once, not live
read every few minutes, never written back to
Scheduled readersa few minutes apart, all year
On a timetableEach feed on its own clock, running inside the database rather than on a machine of oursA check on every readingA feed that goes quiet, or a gauge at its level, is noticed the moment it happensStamped with the time it was readNothing is stored without it, so the app can always say how old a figure is
written down with the time they were read
One database, with the rules inside itthe only way in
The dataAlerts, requests for help, reports, teams, areas, gauges and the layers' indexThe rules on the rowsWho may read each row, enforced here and not by the screens: the app, an export and a direct query all meet the same wallThe audit logEvery phone number revealed, every vulnerable-household record read, whoever read it
only the rows the reader is allowed
What delivers itthree paths, each able to fail alone
The app on the phoneInstalls to the home screen, keeps what is needed to work with no signal, queues what it cannot send yetThe notifierAn alert goes to the phones in the area it covers, and nowhere else; a second channel carries it for people who prefer their chat appThe layer filesMap layers served as files and cached close to the reader, so a layer can be replaced without a new version of the app
alerts out, requests in, and a copy kept on the phone for when the signal goes
The people at the enddifferent rules for each
Residents and visitorsTheir own area's alert, the map, the hotlines, and one tap to ask for helpRescue and supply teamsA live board of the requests in the areas they cover, and nothing outside themJaga's adminsThe signals, the alert console, the war room, and the one automatic alarm
The middle band is the whole design: one store, with the rules about who may see what written into it rather than into the screens.
Drawn in general terms on purpose: what matters is the shape, and a public page naming every service a safety app leans on is a map for anyone looking for a way in.
1. Five parts, and one place where the rules live
Five parts, no more: an app that lives on the phone, one database that holds everything and decides who may read each row, scheduled readers that fetch the rivers and the dam, a notifier that sends warnings, and a file store for the map layers. Nearly everything else is a consequence of those five.
The five parts
1Scheduled readers: rivers, dam, rain, sea2One database, with the access rules inside it
3The app on the phone, working offline4Notifications to phones5Map layers as files
1Scheduled readers fetch the river gauges, the dam, the rain, the forecasts and the sea on their own timetable, and write down what they found with the time they read it.
2Everything lands in one database that holds both the data and the rules about who may see each row. There is no second, more trusting way in.
3The app on the phone reads what it is allowed to read, keeps what it needs to work with no signal, and queues what it cannot send yet.
4When a person publishes an alert, the notifier sends it to the phones in the areas that alert covers, and nowhere else.
5The map layers are files, served from a file store and cached close to the reader, so replacing a layer needs no new version of the app.
Five parts, so that there are few places for a mistake to hide.
The public map layers are files rather than questions put to a database, so the map stays fast and cheap and a layer can be replaced without a new version of the app.
Residents' phones ask for their alert status on a timer, not over a live connection: a hundred thousand phones must not become a hundred thousand open connections. The teams' and admins' consoles do get live updates, because there are few of them and seconds matter there.
Nothing in it runs on a machine inside the flood area, and the app itself is a web page, so there is no app store between a fix and the people who need it.
2. The database decides who may see what
A screen can be lied to. So the rules about who may see a phone number or an exact location are written into the database itself, as rules on the rows, and they apply to every way in: the app, an export, a direct query, a mistake in new code.
Every table is closed by default and opens only to a named role. Nothing is private merely because no screen happens to show it.
A rescue team sees requests for help in the areas it covers and nothing outside them. Data about vulnerable households needs a rescue or coordination role as well. Field crew whom the team's owner invites see only the point and phone number of the case handed to them, until that case ends.
The rules are tested like code: a suite of policy tests runs for every role, a visitor, a resident, a team in the wrong district, a team in the right one and an admin, and a change that opens a row it should not opens fails the build.
An admin's console and a team's console are the same database seen through different rules, not a separate, more trusting system.
3. What is never shown, and what is written down
The app carries the most sensitive thing a person can send: where they are, at the moment they are in danger. The design starts from what must never leave.
Never public: the exact location of anyone who asked for help, of a household, or of a person who reported a flood, and every personal phone number.
The public map carries only aggregated or moderated information. No requests for help as points, no rescue teams' positions, no reporter's identity.
One exception, and only one: the number of the unit that has accepted a request is shown to the person who sent it, while their case is open, so they can reach the team on its way. The unit can switch that off.
Every reveal of a phone number or a vulnerable-household record is written to an audit log, whoever read it, admins included.
4. How a request for help travels
A request for help is the one thing in Jaga that must never be blocked, delayed or refused. Everything on this path is built around that sentence.
A request for help, end to end
1One tap. Where you are is the only thing Jaga needs; a phone number helps and is optional.
2No signal: it waits on the phone and keeps trying, and the hotlines are there to call instead.
3It becomes a case the moment it arrives. Nothing can refuse it.
4The verified teams covering that place see it on their board within seconds.
5A team accepts, and the person who sent it sees who is coming and can reach them.
Nothing on this path asks who you are, and nothing on it can turn you away.
The only thing Jaga needs is where you are. No account, no sign-in, no verification step, no puzzle to prove you are human. A phone number is optional, and the form says plainly that rescuers cannot call you without one.
No request is ever rejected, even when something looks like abuse. A repeat from the same phone or device joins the open case as an update; beyond that, a case is flagged for an admin to look at, and still delivered.
With no signal the request waits on the phone and keeps trying, and the screen offers the hotlines to call or text instead.
It reaches the verified teams whose coverage includes that place, on their own board, within seconds.
The person who sent it sees that it was accepted, and by whom.
5. How an alert is published, and why a person publishes it
Jaga carries alerts; it does not invent them. Only a person publishes, with a single exception, and every alert has to answer the same questions.
Every alert states its level, its area, who issued it, when, why, and when the next update is due. Once that time passes it keeps its level and gains a grey marker saying it has not been updated since: stale is a marker, never a lower level.
Alert wording comes only from templates reviewed in all three languages. Nothing in a warning is machine-translated at the moment of sending.
The computed signals, rain, river levels, forecasts, the dam and the seasonal outlook, suggest a level and show their reasons. They never publish.
The one exception is the automatic alarm on a river gauge or reservoir an admin has ticked: when two recent readings reach the level, Jaga publishes at once from a reviewed template, marked as not reviewed by a person and recorded in the audit log, and then tells every admin. A reading that jumps impossibly fast is held for 20 minutes first, while every admin's phone rings.
6. What still works when things break
Floods take out power, mobile data and roads. The app is designed to lose parts of itself and keep the parts that save a life.
Once it is installed on the phone these keep working with no connection at all: the app itself, your area's current alert, the nearest safe places, the hotline numbers, and the queue holding your request for help until there is signal again.
The home screen is usable before the map loads and is built for a low-end phone on a slow connection. The map is an extra, never the way in.
Every live figure carries the time it was read. When a feed goes quiet the app says the figure is old instead of showing a confident number.
Hazards Jaga does not cover yet, and provinces it does not cover yet, are shown as plainly unavailable with the right hotline, never with a colour that could read as all clear.
7. Built to be checked
A life-safety app that nobody can check is only a claim. This is what is written down.
Every database change is a numbered file, applied once and never edited afterwards, so the whole database can be rebuilt from nothing, in order, at any time.
About 1,300 automated checks run on every change: unit tests, tests that drive the real screens end to end, and the access-rule tests above.
The code is public under a permissive licence, so the claims on these pages can be read against the thing itself.
The system has had a written security review, and its findings and fixes sit in the repository beside the code, including the embarrassing ones.
8. What it costs to run
Money decides what a volunteer project can promise. Jaga is built to be cheap enough that nobody has to find money in a hurry to keep it alive.
Out of season it runs for roughly the price of a phone contract, and a few times that in the three months of the flood season.
No paid map service anywhere. Photographs are shrunk on the phone before they are uploaded, voice notes are kept short, and free allowances are watched and warned about before they run out.
The app does not collect money or goods for people affected by a flood: the official relief channels are the place for that. What it spends keeps the app itself running.
Two pages, one app
The science page is the other half of this: what each layer of the map means, where its data came from, and how far to trust it.