Fintech / accounting
ClearLedger
Month-end bank reconciliation and cash application for one NZD account, where every match explains itself and a locked close can never drift.
In the demo you import a fictional company's October bank statement (119 lines), confirm the 107 exact matches in one action, resolve the 12 exceptions and lock the period. Underneath: a versioned rule pipeline that explains every match, money in integer cents, invariants enforced by PostgreSQL constraints, and a lock that refuses until bank and book agree.
- My role
- Sole engineer: spec to deployment
- Walkthrough
- 90-second guided scenario
- Focus
- Money-safe matching and period close
Launch guided demo (opens in a new tab)Engineering evidence
Stack: React · TypeScript · PHP/Symfony · PostgreSQL · Playwright + axe
Independently built portfolio showcase · simulated data

The business problem
At month end, finance teams reconcile hundreds of bank lines against open invoices and the cash book. Most match cleanly; short payments, one payment for several invoices, garbled references, fees, reversals and repeated imports eat the close, and spreadsheets hide which decisions were made and why.
Try the workflow
Step 1

Import: 119 lines, opening balance checked against the prior close, a repeated line flagged before anything is written. Step 2

Review: 107 exact, unique matches can be confirmed in one action; 12 exceptions wait with their reasons. The close cannot lock yet. Step 3

Close: every line disposed of, bank and book agree, unexplained difference NZ$0.00. October is locked with an immutable snapshot.
Engineering invariants
Rules the system enforces whatever the user does, and where each one is proven.
| Invariant | Why it matters | Evidence |
|---|---|---|
| Every statement line is in exactly one state: unreconciled, reconciled once, or excluded with a reason. | No bank line can be counted twice or silently dropped from the close. | DB CHECK chk_rc_line_reconciled / chk_rc_line_excluded (opens in a new tab)Integration/ClearLedgerRowSecurityTest.php :: testALineIsReconciledExactlyWhenItBelongsToAReconciliation |
| An allocation never exceeds what is still open on the invoice. The open amount is a CHECK-constrained column, updated under a row lock. | Cash is never applied twice to the same invoice. | chk_rc_item_open in migrations/Version20261122213000.php (opens in a new tab)Integration/ClearLedgerRowSecurityTest.php :: testConstraintsBackTheMoneyInvariants |
| The period locks only when every line is dealt with and the bank balance agrees with the cash book; otherwise the lock API returns 409. The locked period is stored as a snapshot with its SHA-256 hash. | A close that does not reconcile cannot be locked, and a locked close cannot drift. | Close gate + snapshot (opens in a new tab)Functional/ClearLedgerApiTest.php :: testMonthEndCloseFromImportToLockedSnapshot |
System architecture
Key decisions
Keep bank reconciliation (statement vs cash book) separate from cash application (which invoices a receipt pays).
Why: A reconciled bank account does not mean every receipt has been applied. Showing both keeps the close honest.
Rejected: One combined status (my first design, changed after review).
docs/specifications/010-clearledger.md §1 'Two reconciliations, kept apart' and review history
Classify lines before matching, and let only one rule auto-confirm: exact reference, amount, direction and counterparty, and unique.
Why: Reversals, fees and repeated lines can never be matched by accident; bulk confirmation covers only what is provably safe.
Rejected: Auto-confirming tolerance, date or fuzzy-payer matches. They stay suggestions.
docs/specifications/010-clearledger.md §1 Pipeline
Engineering evidence
Tests
PHPUnit — month-end close via API, undo + session isolation, RLS/constraint tests, golden file of the seeded month
API tests of the month-end close, row-security and constraint tests, and a golden file of the seeded month.
End-to-end
Playwright month-end close with axe
The full close from import to lock, plus a 375 px phone check, with no serious or critical axe violations. 2/2 passing on production on 26 Nov 2026.
Conditions: Run against production, desktop project
Decision records
Architecture decisions
ADR 0002 (modular monolith), ADR 0003 (fixture-first AI), ADR 0004 (registered, versioned rules).
Engineering page
“How it's engineered” in the live demo (opens in a new tab)
The full detail: rules, data model, tests and measurements, next to the running product.
I use AI-assisted development for implementation, exploration and review. I remain responsible for architecture, business rules, code quality and deployment. Critical behaviour is verified with deterministic tests, static analysis and reproducible benchmarks.
Trade-offs and limits
- Synthetic data for a fictional company (Harbourline Supply Co.)
- CSV import only; no bank or open-banking connection
- One NZD account and one period; no general ledger, GST or multi-entity
- Not accounting advice and not a certified financial system
My contribution
I built ClearLedger as an independent engineering showcase: product specification, architecture, frontend, backend, data model, automated tests and deployment.
Want to discuss the engineering behind this?
Launch demo (opens in a new tab)Get in touch
Source-code walkthroughs available on request.