ERDMS – Emergency Response & Dispatch
Overview
One incident record shared by everyone in an emergency — the citizen who asks for help, the dispatcher, the field officer who arrives, and the administrator. Built for Liberia and comparable African environments: mobile-first, low-bandwidth, offline-tolerant, and multi-agency.
The problem
Emergency response in low-connectivity environments breaks down across agencies and channels: requests get lost, responders lack a shared picture, and there's no trustworthy record of what happened.
My role
Full-stack design & development
Key features
- Citizen, dispatcher, field-officer & admin experiences on one incident record
- USSD, SMS, voice and web all feed the same incident engine
- PostGIS nearest-unit search as dispatcher decision support
- Offline queueing with sync and conflict handling
- Append-only emergency history and audit trail
- Categories, unit types and agencies configurable without a deploy — fire is the first use case
Architecture
- Citizen · Dispatcher · Field officer · Administrator — web, USSD, SMS & voice
- Next.js frontend (offline queue, realtime via WebSockets)
- FastAPI incident engine — dispatch, auth & MFA, sync, channels
- PostgreSQL + PostGIS (system of record) · Redis pub/sub · Celery
Key decisions
The backend is the authority
Frontend permission checks only hide buttons; every endpoint enforces its own permission and object-level access.
Emergency history is append-only
Corrections add events and never rewrite them — there is no endpoint that edits or deletes an audit record.
Every channel enters the same engine
USSD, SMS, voice and web all call the same incident service. The channel is a field, not a fork.
Offline is not "received"
An action queued on a device shows as queued until the backend has actually persisted it.
WebSockets enhance; they don't replace
Authoritative state always comes from the API and is refetched on every reconnect, so Redis going down degrades realtime but never blocks a write.
The dispatcher decides
Nearest-unit search is decision support. Nothing dispatches itself, and the UI never claims a responder is on the way until one reports en route.
Results & engineering
- Load-tested at 20,000 incidents: a filtered dispatch queue went from 4,578 ms to 88 ms after restructuring a query that was discarding 29.4M rows in a join
- Incident-number search from 355 ms to 35 ms using per-table lookups on GIN trigram indexes
- Concurrency test suite found and fixed four race conditions
- End-to-end smoke suite works one emergency from call to closed record over real HTTP and a live WebSocket, as citizen, dispatcher, crew and admin
- Failure drills take Redis, then PostgreSQL, away from a running server; CI runs dependency audits, static analysis and secret scanning on every push