The full engineering story
The problem
Unattended parcel lockers in Kenya have to take a payment, open the right door and stay in sync with the back office. They do it over slow, metered GSM connections that drop without warning. Every failure happens in public: “I paid and the door didn’t open.”
Rule 1: fast
- Four steps maximum. Every customer flow (store, collect, send) is four steps or fewer, with large targets, so it’s done in under 30 seconds.
- On-premise SMS gateway. Pickup PINs go out from the kiosk’s own SMS modem, with no third-party queue in the way.
- RPC and protobuf. The kiosk and the Go backend exchange compact, typed protobuf messages over RPC and AMQP instead of chatty JSON.
- M-Pesa payments in the same flow, without leaving the screen.
Rule 2: resilient
- Lock-jam and open-door detection on every lock command, with lock-board commands guarded by a watchdog.
- Offline-first. The kiosk keeps serving customers without a network, queues events in a SQLite inbox that drops duplicates, and syncs when it reconnects.
- HMAC-signed messages, so the back office only acts on messages it can trust.
- Self-healing connections. Lockers redeclare their AMQP reply queue and come back on their own after a network drop.
How it’s built
- Kiosk app: Qt 6 and QML on a Raspberry Pi. Business logic lives in C++ controllers with explicit state machines; QML only draws the screen.
- Hardware: drivers for four serial lock-board models, each with a mock for testing, plus a touch settings app for field technicians.
- Platform: a Go backend with PostgreSQL for bookings, parcels, payments and devices, and an admin dashboard for web and Android.
- Deployment: cross-compiled for ARM64 in Docker and run as a systemd service.
Fixing what matters in the field
- Three production freezes, caused by re-entrant QFuture continuations.
- “Paid but the door didn’t open,” traced to a stuck lock-board command and now caught by the watchdog.
- Lockers that never came back online after a network drop, fixed by redeclaring the AMQP reply queue on reconnect.
The project is about 17,700 lines of C++ and 8,600 lines of QML across 961 commits.



