I built a modular platform for courier firms from one core: a panel, a courier app and a ledger that cannot be erased.
Today
The prototype works; tenant isolation passed leak and race tests.
Next
The Kotlin version and a first pilot with kova.co’s couriers.
The night city from the operator’s seat: the radar sweeps, and each order that lights up in gold gets exactly one courier along the streets; no job goes to two couriers. Each business sits inside its own boundary with its own data. Every delivery lands in the ledger as a line that cannot be erased.
Problem
Small courier firms and businesses with their own couriers track parcels, dispatch and cash by hand or with tools that fit no two customers alike. Each customer wants different modules, and background location on a courier’s phone is unreliable.
Solution
A modular platform grown from one core and cut to each customer (Package builder): an operator panel; a courier app with an offer, accept and swipe-to-deliver flow proven by photo and code; tracking without a login; a cash and payout ledger that cannot be erased; an open API with signed webhooks.
Read more
Tenant isolation rests on Supabase RLS and was probed with mutation and race tests. The Telegram courier flow at kova.co today is a small version of the same idea.
Result
A working prototype; there is no pilot (the candidate is the kova.co couriers, planned, not started).
Read more
The working courier app is built with Expo; after measuring, a move to Kotlin was decided on 27 Nov 2026, Expo is frozen and the pilot is planned with Kotlin. No Kotlin code exists yet (plan).
The big pieces05
01
A modular structure: the Package builder
Prototype
A platform grown from one core, with a different module package for each customer. The principle: nobody but me should find it complicated.
02
A money ledger
Prototype
A cash and payout ledger that cannot be erased: reversal by counter-entry, set-off, courier requests, CSV/xlsx and a signed statement.
03
The courier app
Prototype
Offer, accept, swipe to deliver; proof by photo and customer code; location and battery behaviour were measured; a move to Kotlin was then decided and is still at the planning stage.
04
Open API and webhooks
Prototype
Signed webhooks and an integrations panel; outside systems can push orders in.
05
Tenant isolation
Prototype
Each customer sees only their own data; leaks were probed with mutation and race tests.
Annotated drawing
01Order
02Dispatch1
03Courier2
04Proof of delivery3
05Ledger4
The order-dispatch state machine lives in the database; the customer sees only the en-route position on a login-free tracking page.
1
“First accept wins”: proven with a fixed lock order (order → offer → courier) and real multi-session tests.
2
A bug the tests could not see turned up on a real phone: a stationary phone did not stream its location.
3
The photo is shrunk on the device to ≤300 KB without EXIF and waits in a persistent offline queue.
4
No row is deleted or edited and balances are summed; going negative is blocked in both the RPC and a trigger.
Try it
Key details06
01 · Module
A switched-off module is really off
When a module is switched off it does not only vanish from the menu; the server also refuses that module’s write actions. A feature outside a customer’s package is closed, not merely hidden. Dependencies between modules are declared in the catalogue and repaired when a package is applied.
02 · Package
What the preview shows is what happens
Before a package template is applied, what would change is shown, and the preview and the apply give the same result. Template versions are immutable and settings changed by hand are kept. A bulk rollout finishes without locking up even with reverse-ordered customer lists.
03 · Security
A forgotten rule still breaks a test
Separation between customers lives in the database, not the app: row-level security (RLS) is on for every table and writes go only through permission-checked actions. A new table or function that breaks the rule fails the structural tests, which are themselves checked with deliberate faults.
04 · Race
When two couriers accept at once
Single-session tests cannot see simultaneous actions, so real multi-session trials were written. Locks are taken in a fixed order: the first accept wins, the other offers close and double assignment is blocked. Invites, order numbers and money actions were tested the same way.
05 · Money
A delivery is not counted twice
On delivery the money entry is posted automatically; the rule of at most one automatic entry per order in each account lives in the database, and a failed delivery earns no payout. A courier can ask for early payment only up to what has been earned, and only with a manager’s approval.
06 · Field
A bug the tests missed showed up on a phone
With the app open, a stationary phone stopped sending location; the tests missed it because their fake location service produced samples. A real-phone trial found it and it was fixed; the phone then sent regular positions for 4.5 minutes. The courier UI was also simplified after phone feedback.
Decision log03
01
One core, modules cut to each customer
Passed over
A one-size product that is either too heavy or too limited.
Why
Small courier firms and businesses with their own couriers want different things, so variation is held on four axes: roles, customer type, brand and sector. The super-admin console cuts modules, rules, theme, vocabulary and package templates from one place. The principle: nobody but me should find it complicated. It has not been tried with a customer yet; there is no pilot.
02
Measure first, then switch
Passed over
Running the pilot on Expo.
Why
Each part was weighed separately: the database, panel and tracking stayed; only for the courier app a disposable Kotlin trial was built, with success criteria written beforehand. On a single high-end phone, size, startup and memory favoured native; but the foreground service went silent in about 7 minutes in Android’s battery-saving mode (Doze) with the screen off and the phone still. Native alone did not fix location. Decision: measured first on one phone, then on 27 Nov a move to Kotlin was decided; the path given up is a pilot on Expo. The basis is one high-end device and an effort estimate; a low-end device was not measured.
03
Balances are summed, not stored
Passed over
Keeping a balance field per courier.
Why
In cash and payouts the costliest mistakes are drift and after-the-fact edits. So no ledger row is deleted or edited; a mistake is answered with a counter-entry and balances are summed from entries. Going negative is blocked both in the action and in a database trigger, and a per-courier lock puts simultaneous actions in line. It was tested with money races and deliberate fault injection.
Stack
TypeScript
React
Vite
Tailwind
Supabase
PostgreSQL · RLS · pgTAP
Edge Functions
Expo · React Native
MapLibre
Playwright
GitHub Actions
Backstage07
Untied view: raw records from the evidence table, not a live log.
git historyTenant isolation (RLS), invites and the audit log went in; “first accept wins” and double assignment were tested with real multi-session race tests and mutation scripts that inject deliberate faults.
implementation noteThe money ledger was finished: entries cannot be deleted or edited, and a reversal is a counter-entry. 88 deliberate faults were tried; the database tests missed 6 on the first run, and those gaps were closed; CI green.
implementation noteThe Package builder was finished: immutable-versioned package templates, preview equals apply, bulk rollout. Of 16 deliberate faults that escaped on the first run, 11 exposed test gaps, which were closed; CI green.
phone trialA real-phone trial found that a stationary phone stopped sending location (the tests used a fake location service and missed it); it was fixed and the same phone sent regular positions for 4.5 min.
git historyThe open API and signed webhooks (first slice) were merged into main with CI green; the webhook was tested against a fake receiver in a real Edge runtime, and the Panel has an Integrations screen.
decision noteIn the Kotlin trial on a single phone, the foreground service went silent in Doze after about 7 min with the screen off and the phone still; no rewrite was started, there is no pilot, and the plan is to use Expo.
git historyA move of the courier app to Kotlin was decided; Expo is frozen and the pilot is planned with Kotlin. No Kotlin code exists yet.