Architecture, stack, key decisions and the quality gates DEV3 Pegloom passed before release.
The engineering behind Pegloom: billing after the weigh-in, a kilo ledger that releases revenue exactly, a fixed lock order and card refunds sent only after commit.
The problem it solves
A laundry bills for something it cannot know until the bags are weighed. Customers have plans measured in kilos that roll over and expire, plants have capacity, and every garment must be traceable. Payments arrive late, twice or for a changed order, and a card refund must neither be lost when the gateway fails nor sent twice after a crash. The kilo balance and the money must always agree.
Architecture and approach
Pegloom is a Laravel 12 application with Filament 4 panels at /admin and /plant, a public site and a REST API used by two Flutter apps.
Billing after weigh-in
The card is charged after the weigh-in against a stored card, one charge row per attempt. Money applies only when a payment succeeds; late, stale and duplicate payments are refunded at once.
Kilo ledger
The ledger is append-only: grant, rollover, use, return and expire. Each source carries a value so revenue is released exactly, and rolled value is carved off the grant.
Lock order and deadlines
Locks are taken in one fixed order (order, stop, run, driver, slot, plant day, plan subscription, wallets), and reads that must see other commits are locking reads. Deadlines are applied when a record is read, so every test passes with the scheduler off.
Refunds
Card refunds go to the gateway only after the outermost commit, reserved atomically on the refund row first, and a sweep from the scheduler retries the ones that failed.
Apps
The customer and driver apps share one API contract and test vectors with the server, and start in a demo mode.
Quality gates and results
Pegloom 1.0.0 passed the seven release gates on the final code: 171 Pest tests with 4,248 assertions, 143 pages in a headless browser with 17 race checks on MySQL, the installer test from the zip and a clean secret scan. The customer and driver apps pass analysis and 93 and 226 tests.
Limits are listed on the item page: photo upload sends a reference, password reset uses an email code, and there is no GPS or push plugin.
Tech stack
| Area |
Technologies |
| Application |
Laravel 12, Filament 4, Blade, REST API |
| Laundry |
Weigh-in billing, Garment tags, Kilo plan ledger, Plant floor panel |
| Money |
Card refunds after commit, Late-payment refunds, Partner statements, Driver cash hand-in |
| Apps |
Flutter customer app, Flutter driver app, Shared dev3 Flutter package, Demo mode |
| Quality |
Pest, Larastan level 6, Headless browser smoke, MySQL race checks |
Inside the build
A front-loader drum and a washing line — The landing hero places the drum in the free column beside the headline, with garments swaying on the line.
Spin — Chapter one tumbles shirts in the porthole while the counters tick up.