Transaction-safe backend
Banking Ledger System
Independent build00 / Project overview
A ledger-first banking backend where account balances are derived from immutable double-entry records instead of being edited directly.
Directly editing an account balance makes retries, partial failures and duplicate requests difficult to audit safely. The ledger system records every movement as an immutable double-entry transaction so balances remain traceable and consistent.
01 / Challenge
The constraint that shaped the build.
Money movement has to remain correct when requests retry, fail halfway through or arrive more than once. A mutable balance field alone cannot provide that guarantee or a reliable audit trail.
02 / Approach
Make the rules visible.
I centered the architecture on journal entries and transaction boundaries. Idempotency keys protect repeated requests, while database sessions keep each transfer atomic.
Immutable double-entry ledger
Idempotent transfer requests
Atomic MongoDB transaction sessions
JWT authentication and OAuth2 notifications
03 / Solution
The finished system.
The MERN backend uses MongoDB transactions, JWT authentication and bcrypt password hashing. Gmail OAuth2 notifications sit outside the transaction-critical path.
Outcome
The architecture makes the ledger the source of truth and gives every balance a traceable history of entries.