Architecture, stack, key decisions and the quality gates DEV3 Waybrook passed before release.
The engineering behind Waybrook: every status change through one transition table under a parcel lock, a fixed lock order for run sheets and cash, and a cash-on-delivery chain that ends in a weekly payout.
The problem it solves
A parcel network is a chain of custody. A parcel changes hands many times, and each hand must be recorded once and in order. A courier carries cash that belongs to a sender, and the hub must count it, hold it and pay it out without losing or doubling a cent. Failed deliveries, returns and reschedules must not leave a run sheet that cannot close. Several people can act on the same parcel, run or payout at once, and the numbers still have to add up.
Architecture and approach
Waybrook is a Laravel 12 application with Filament 4 panels at /admin, /hub and /account, a public booking and tracking site and a REST API used by two Flutter apps.
One transition table
Parcel status changes only through a state machine that applies a transition table under a row lock on the parcel. The lock order everywhere is parcel, run sheet (by id), then stop, with the courier before the run in cash counts and the payout before the collection in a COD reversal.
Custody rules
Declaring or counting cash is refused while a run has pending stops, failed stops must be scanned back before a run closes, and hubs can close, reassign, scan back and declare for a courier who has vanished. Returns finish end to end, through a return bag or same-hub return, a return stop on a run and a hand-over back to the sender.
Cash on delivery
The courier collects the exact amount, the hub counts it as exact, short or over, short counts wait for a controller and over counts go to suspense. Collections are held for a set number of days and paid weekly. The payout and settlement jobs run as scheduled commands, and the race checks on MySQL found and fixed a numbering deadlock and a counter clash in the seed.
Apps
The sender and courier apps share one API contract and a shared Flutter package, and start in a demo mode.
Quality gates and results
Waybrook 1.0.0 passed the seven release gates on the final code: 279 Pest tests with 2,263 assertions, 163 pages in a headless browser with 9 race checks on MySQL, the installer test from the zip and a clean secret scan. The courier and sender apps pass analysis and 115 and 130 tests. A review of the money and custody code fixed 15 findings.
Limits are listed on the item page: the scanner is simulated, there is no GPS plugin, and a COD parcel lost after collection is not wired into claim approval.
Tech stack
| Area |
Technologies |
| Application |
Laravel 12, Filament 4, Blade, REST API |
| Parcels |
Parcel state machine, Transition table under lock, Run sheets, Bags and manifests |
| Money |
COD collections, Cash counts, Weekly payouts, Credit-account invoices |
| Apps |
Flutter sender app, Flutter courier app, Shared dev3 Flutter package, Demo mode |
| Quality |
Pest, Larastan level 6, Headless browser smoke, MySQL race checks |
Inside the build
Hero — A parcel rides onto a platform scale in a cutaway hub, with the read-out settling on its weight.
Weigh — Priced on the scale: the chargeable weight is the higher of real and volumetric.