Project · T-Ledger
Project 06 / 07: T-Ledger
2026 · Personal · Architecture and development
Personal · 2026
You record one movement and the ledger writes the double entry. Personal finances for you, your partner or your family.
Visit the site (opens in a new tab)View the code (opens in a new tab)
The problem
A list of expenses can't answer what matters: when a debt is paid off, how much interest you save by paying ahead, whether you reach a goal in time or whether the month closes. T-Ledger keeps true double-entry books to answer it, and every figure traces back to its source.
What I did
01 / 07
Every movement creates its balanced journal entry.
With the receipt attached. Entries are immutable: a mistake is fixed with a reversing entry, never by editing.
02 / 07
To help decide, it models debts with amortization and compound interest.
Savings goals, investments, bucket budgeting and cash-flow projections.
03 / 07
It keeps the general ledger.
Trial balance, balance sheet, income statement and monthly close. It reconciles against imported CSV bank statements, and net worth is reported in one currency at the central bank's rate.
04 / 07
Each person shares their ledgers by invitation.
As owner, editor or viewer. I isolated ledgers in two layers: a Prisma client that adds the ledger to every query, and fails without it, and a role guard on every endpoint.
05 / 07
I measured serializable transactions.
With four ledgers, 27 of 120 writes ran out of retries. I replaced them with a per-ledger Postgres lock, so two people on one ledger never clash and different ledgers never wait.
06 / 07
The audit log is written in the same transaction as the change.
So no change goes untracked. Sentry never receives any ledger data.
07 / 07
I built 13 NestJS modules on PostgreSQL.
With 37 models, 26 migrations and Better Auth. An OpenAPI contract generates the types for the React 19 and TanStack frontend, and about 1,140 test cases in 146 files cover both sides.
Results
- In production, at version 1.4.0. The source code is published for reference.
- Six documented architecture decisions, including ledger isolation, concurrency and why end-to-end encryption is deferred.
Stack
- React
- TanStack
- NestJS
- PostgreSQL
- Prisma
- Better Auth
- Cloudflare R2