SmartBank Customer Management System
A full-stack banking simulation where the hard parts are the ones real banks care about: two transfers can't spend the same balance, the browser can't change a number, and every sensitive action leaves an audit trail.
- Solo project — data model, API, frontend, tests, docs
- Django REST Framework · Simple JWT · PostgreSQL · React 19 · Vite · React Router · Axios · Bootstrap 5
- Educational simulation · runs locally

What it is
SmartBank simulates the operations side of a retail bank: customers open savings and current accounts, deposit, withdraw, transfer to saved beneficiaries and download statements; staff manage customers and freeze accounts under review; admins see institution-wide numbers and the full audit trail.
It's a simulation, and it says so in its own README. No real bank, payment gateway or money is involved — balances are virtual. What isn't simulated is the engineering: the locking, the permissions and the audit log behave the way they would have to in a real system.
I built it because most beginner banking projects are CRUD apps that update a balance field from a form. I wanted to work on the problems that make financial software hard.
Two requests, one balance
The failure I designed against first was double-spending. If two transfers from the same account arrive at the same moment, a naive implementation reads the balance twice, approves both, and the account goes negative.
Every transfer runs inside transaction.atomic() and locks the account rows with select_for_update() before reading the balance. The second request waits until the first commits, then reads the real, updated balance — and is rejected if the money is no longer there. If anything fails mid-transfer, the whole thing rolls back: no half-debited accounts.
Balances are stored as DECIMAL(15, 2), never floating point.

The server decides
There are three roles — admin, staff and customer — and the API enforces them on every request through Django REST Framework permissions. The React app hides buttons a user can't use, but hiding is cosmetic: a customer who crafts their own HTTP request still can't freeze an account, read someone else's statement or change a balance.
Authentication is JWT with access and refresh tokens. An Axios interceptor renews the access token silently, so a session doesn't drop mid-task, and route guards in the frontend mirror the backend's role rules.

Every sensitive action leaves a record
An immutable audit log records logins, profile changes, account status changes and every transaction — who did it, what it targeted, from which IP, and the details as JSON. Staff can freeze, unfreeze or close accounts; each of those changes lands in the log.
Customers get in-app notifications for deposits, debits, transfers and account status changes, with an unread-count badge. Notifications are isolated per user, and there's a test for that.

Statements that are safe to open
Customers can filter their transactions by date range and download a CSV statement. A CSV opened in Excel or Sheets can execute a cell that starts with a formula character, so a transaction description like =HYPERLINK(...) becomes an attack. The export follows RFC 4180 and guards against spreadsheet formula injection, and a test covers it.

Tests
26 tests, all passing, run with Django's test runner:
- registration and JWT issuance
- role-based access control
- balance constraints and negative-amount rejection
- overdraft prevention and atomic rollback of failed transfers
- concurrency protection with
select_for_update() - beneficiary verification and ownership checks
- notification isolation between users
- CSV statement export security

Structure and documentation
The backend is split into seven Django apps — accounts, customers, banking, transactions, beneficiaries, notifications and audit — so each concern lives in its own app. A seed command creates demo users for each role, and the login page has one-click demo logins so a reviewer can switch roles in seconds.
The repo ships eight design documents — architecture, ERD, schema, relationships and delete rules, API reference, authentication flow, transaction flows and a testing guide — plus Mermaid sources for the diagrams.
What's not in it
- No real payment networks such as ACH or SWIFT — by design.
- Alerts are in-app only; email or SMS would need a provider like SendGrid or Twilio.
- No scheduled interest accrual; that would need a background job runner such as Celery or cron.