Full-stack banking app with:
client: React + TypeScript + Viteserver: Node.js + Express + TypeScript- PostgreSQL for core data and ledger data
client/- frontend appserver/- backend APIinit_schema.sql- database schema bootstrap
- Auth: register, login, JWT-based session,
GET /auth/me - Accounts:
- account overview for current user
- create account
- delete account
- deposit / withdraw (with no-negative-balance protection)
- Transfers:
- account-to-account transfer
- last transactions per account
- 2PC simulation with failpoints (
IN_DOUBT, recover flow)
- Node.js 20+ (your project currently uses Node 22)
- npm
- PostgreSQL (or Supabase Postgres URLs)
Create server/.env (you can copy from server/.example_env):
PORT=5001
CORE_DB_URL=postgresql://...
LEDGER_DB_URL=postgresql://...
PG_DISABLE_SSL=false
SIMULATE_FAILURE=false
AUTH_SECRET=dev-auth-secret-change-me
AUTH_TOKEN_TTL_SECONDS=86400
BCRYPT_SALT_ROUNDS=12cd server && npm install
cd ../client && npm installStart backend:
cd server
npm run devStart frontend:
cd client
npm run devURLs:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5001
Backend:
cd server
npm run typecheck
npm run build
npm run startFrontend:
cd client
npm run build
npm run previewAuth:
POST /auth/registerPOST /auth/loginGET /auth/me
Accounts:
POST /accountsGET /accounts/overviewGET /accounts/recipient-accounts?username=...GET /accounts/:accId/transactions?limit=5POST /accounts/:accId/transferPOST /accounts/:accId/adjust-balanceDELETE /accounts/:accId
Transactions (2PC simulation):
POST /transactions/transferGET /transactions/:txIdPOST /transactions/:txId/recoverGET /transactions/failpointPOST /transactions/failpoint
- Current client-server API base is
http://localhost:5001. - For simulation flows, transfer may return non-200 with transaction state; use status/recover endpoints to finalize.
- Extra module-level docs are in:
client/README.mdclient/src/README.mdserver/README.mdserver/src/README.md