Skip to content

Wallet LedgerMoving money correctly

A USD wallet backend on a double-entry ledger, built with NestJS and Postgres. No negative balances, no partial writes, no double charges, and a ledger that always reconciles.

What's here ​

SectionWhat you'll find
DemoThe real API in the browser: wallets, ACH deposits, holds, transfers, idempotent replays and a stress test that checks the invariants afterwards
ArchitectureHow the ledger works, with diagrams: accounts, state machines, locking, the request lifecycle inside Nest, and full traces of real operations
DecisionsArchitecture decision records: what was chosen, what was rejected and what it costs
FeaturesOne page per shipped feature: the problem, how it works, commands to try it
RoadmapWhat's done, what's next (a virtual debit card) and what's parked, with every plan sized on a scale calibrated against shipped work

Stack ​

NestJS 12 · TypeScript (ESM) · PostgreSQL 16 with explicit SQL through pg (no ORM) · Vitest against a real database · deployed on Vercel with Neon. The source is on GitHub.

Money is an integer number of cents. Every movement sums to zero.