Prototype · Feb 2026 –
Offline café POS
My role · I built it and I run it
When the internet drops, a café’s till and sales must not stop; it should also be visible what was wasted and where the money went.
Data lives in a local database on the device (PWA + SQLite); a sale is written to the device and works without the internet; there is no cloud sync, and it runs on one device today.
Twelve modules talk through a manifest and capability contract and cannot import each other (checked by a tool). Money is an integer number of kuruş; the payment, refund, Z, waste and audit ledgers are append-only. Live (1.1): split payment, tabs, encrypted backup, receipt, Z close. On the development branch (1.2, local, unreleased): bill splitting, returns, waste, per-line price change, pre-payment summary.
A prototype: published but not tried in a real business; a pilot is planned and has not started.
Data lives in a local database on the device; sales keep being written when the internet drops. There is no cloud sync, and it is one device today.
Twelve modules talk through a manifest and capability contract and cannot import each other; a tool enforces it.
Money is an integer number of kuruş; the payment, refund, Z, waste and audit ledgers are append-only.
Live (1.1): a cash-register helper, receipt printing and Z closing. Bill splitting is only on the development branch (1.2, local, unreleased).
No second charge after a crash: “same id” and “already paid” convergence.
A bug the unit tests missed: PowerSync fires a watcher only when a table the query reads changes, while the in-memory test database fired on every write, so 1,522 tests let it through.
A refund is a negative entry; resubmitting the same refund id opens no new refund.
An old backup cannot erase later audit entries: the “keep on restore” option adds missing rows and leaves existing ones alone.
Twelve modules, one core
Data sits in a local database in the browser; a sale is written there without needing the network, so the till keeps working when the connection drops. Selling was verified with the server switched off. Limit: one device today; there is no cloud sync.
Local data is tied to the browser address, so the app needed one permanent address. When the default hosting address proved unreachable on the developer’s network, it moved to a custom domain. A new version downloads but waits and takes over when the user taps, so there is no refresh mid-sale.
The 12 modules talk through only three routes: capability contracts, slots and events. They cannot import each other, and a tool checks the rule. The credit-tab and waste modules were added without touching the core or sales; switching a module off does not delete its data.
Discounts, VAT and rounding together can make totals drift. Amounts are kept as whole kuruş; VAT is split from each rate group’s total, and an order discount is spread over the lines by the largest-remainder method. The rule “list = revenue + discount + comp” is tested on random orders.
The payment ledger cannot be deleted or changed, yet refunds are needed: a refund is a set of negative entries tied to the original payment, and sending the same refund twice does not open a second one. Encrypted backups can be taken; restoring an old backup keeps the audit trail.
A final review found the credit-tab permission existed only on screen. It is now checked in the service and the screen only hides; a rejected call writes nothing. The cashier discount limit now follows the combined rate, closing a 19% gap that opened when line and order discounts stack.
Untied view: raw records from the evidence table, not a live log.
Private repository · test-gate record (21 Nov 2026; not rerun)
Private repository: demo on request.