Architecture, stack, key decisions and the quality gates DEV3 Refilo passed before release.
The engineering behind Refilo: deposits as a liability checked against container accounts, serial-level cylinder moves, delivery windows with separate gas capacity, a pure load calculator and a fixed lock order.
The problem it solves
A water and gas round is a container problem. Customers hand back fewer empties than promised, a cylinder may be past its test date or not ours at all, a van can be over its legal gas limit, and a window can be full for gas while water is still free. Deposits are money owed back, drivers swap at the door with no signal, and a refund must neither be lost nor sent twice.
Architecture and approach
Refilo is a Laravel 12 application with a Filament 4 admin at /admin, a public website with a customer account and a REST API used by two Flutter apps.
Deposits and containers
A deposit is owed on containers held, not on refills. Pure classes for deposit, load, coupon, cancellation and supply maths are tested against shared vector files, and both apps run Dart ports against the same vectors. A reconciliation command compares the deposit liability with the container accounts.
Cylinders
Every cylinder is a serial with a state, a location and a test date. A swap moves serials between depot, van and customer in one transaction, refuses a cylinder past its test date or missing from the register and has no bypass for typed serials.
Capacity and load
A delivery window reserves unit slots and LPG weight under a row lock, so gas can be full while water is open. The run builder computes the load by stop from product weights and van limits.
One lock order
Every path locks in the same order through one entry point, and deadlines are enforced when a record is read. Card refunds are rows written in the money transaction, sent after commit and retried.
Apps
The customer and driver apps share one API contract with the server, keep swaps, failed stops and cash hand-ins in an offline queue with their own keys, and start in a demo mode that needs no server.
Quality gates and results
Refilo 1.0.0 passed the seven release gates on the final code: 389 Pest tests with 4,215 assertions, 95 pages and races in a headless browser with 21 happy paths, the installer test from the zip and a clean secret scan. The customer and driver apps pass analysis and 368 and 287 tests.
Limits are listed on the item page: payments and push are simulated by default, saved-card auto-refill is not finished for real gateways, Stripe refunds have no idempotency key yet and the package ships a short setup page rather than a full guide.
Tech stack
| Area |
Technologies |
| Application |
Laravel 12, Filament 4, Blade, REST API |
| Delivery |
Delivery windows with LPG capacity, Run builder with load by weight, Swap at the door, Express offers |
| Containers |
Deposit liability check, Cylinder register, Test-date queue, Quarantine |
| Apps |
Flutter customer app, Flutter driver app, Shared dev3 Flutter package, Offline queue and demo mode |
| Quality |
Pest, Static analysis, Headless browser smoke, Shared test vectors |
Inside the build
Refill hero — The headline and refill button beside three flat cards: My Supply with days left, a deposit receipt, and a Van 2 card with its loaded-by-weight bar.
Four beats — Short cards under the hero that say what Refilo tracks: bottles and cylinders, deposits, tested serials and loaded-by-weight vans.