01 / Project scope
Deposits and transfers,
with their history.
N2Banking is a larger project meant to demonstrate deposit and transfer banking flows. Its implemented foundation is N2BankCore, a Java ledger. The frontend demo is planned. Lending is out of scope.
The core supports deposits, transfers, withdrawals, fees, reversals, balances and statements. The surrounding application will supply its API, authentication and user interface.
02 / My build
Invariants held
at the transaction boundary.
I built the core around explicit monetary values, balanced debit/credit postings and append-only journal entries. PostgreSQL is the source of truth, and database constraints enforce the journal invariants. Redis is a best-effort balance cache.
Each operation claims an idempotency key, locks the affected accounts and persists its result in one transaction. A matching retry returns the original entry, and the core rejects conflicting inputs.
03 / Verification
Tests for the awkward cases.
The repository includes domain and database tests for balanced entries, duplicate commands, insufficient-funds rollback, concurrent spending, fees and reversals. CI runs against PostgreSQL and Redis.
The core is experimental. Current limits include one ledger per database, manual migrations, a cache consistency race and a precision policy that needs further hardening.
Implementation and invariant evidence ↗04 / Frontend roadmap
A demo that shows
the ledger rules at work.
The planned demo will connect the core to user-facing deposit and transfer flows. The walkthrough I want to show: deposit funds, transfer between accounts, inspect balances and history, then retry a transfer without applying it twice.
Current milestone: the ledger core. Next milestone: the API and frontend demo.