Ledger Demo

Inspired by Stripe’s ledger system

A double-entry ledger you can break.

Trigger flows like authorize, capture, dispute, and cross-currency FX. Watch T-accounts post in real time. Then click Break it and watch the database refuse an unbalanced transaction.

The SQL is the demo.

Invariants live in Postgres CHECK constraints, deferred constraint triggers, and REVOKE UPDATE/DELETE — not in JavaScript. Open the demo and click 'how it works' to see the actual schema.

Click to break it.

Send a deliberately unbalanced transaction. The database raises and refuses. The literal RAISE EXCEPTION text shows up in the toast. Proof, not theatre.

Three live views.

T-accounts, money-flow Sankey, and a transaction stream — all subscribed to the same store, all updated by polling /api/transactions every 750ms.