Demonstration · public artifact
inventory-ledger
The general-reviewer showcase, shown rather than just linked. Client repos are private; this one is public, so the engineering is legible. It's the same class of offline-sync work that keeps Esto's POS taking orders through a connection drop, extracted into a runnable proof.
How it works
Stock is never stored as a number; it's derived by folding an append-only log of movements (in / out / adjust). The ledger is the single source of truth, so every quantity is auditable and every change reversible. The browser client queues movements in IndexedDB while offline and flushes on reconnect, running the same pure merge in the browser that the server runs. Each operation reports its own outcome (applied, superseded, duplicate, or rejected) instead of throwing.
Conflicts & overdraw
Movements are conflict-free: appending to a log has no winner, so concurrent offline edits just merge, deduplicated by movement ID. Item metadata (names, SKUs) uses last-write-wins by updatedAt, reporting stale edits as superseded. Overdraw is caught at merge time: two offline withdrawals that are each valid alone but together overdraw will fold in all known movements, detect the overdraw, and reject the second. On Postgres that guarantee is additionally enforced inside a single Serializable transaction so concurrent withdrawals can't both pass.
Trade-offs
The project deliberately defers multi-user/organization scoping, multiple warehouse locations, and double-entry accounting, spending its depth on offline-sync safety rather than feature breadth.