Bank Account Management API — Event Sourcing & CQRS in TypeScript (Postgres, Docker)
Laharika Sabbella
0:00 / 0:00
Bank Account Management API — Event Sourcing & CQRS in TypeScript (Postgres, Docker)
8 просмотров · 6 дней назад
Laharika Sabbella
1 подписчик
8 просмотров · 6 дней назад
Keywords: Event Sourcing, CQRS, TypeScript, Node.js, Express, PostgreSQL, Event Store, Event-Driven Architecture, Bank Account Management System, Ledger API, Database Projections, Snapshotting, Optimistic Concurrency Control, Idempotency, Time-Travel Queries, REST API, Docker, Docker Compose, OpenAPI, Swagger
#EventSourcing #CQRS #TypeScript
🚀 *Project Overview*
A bank account management API implemented with Event Sourcing and CQRS. The system persists an append-only event stream in PostgreSQL (JSONB), builds read-model projections for fast queries, and supports auditable time-travel balance queries and snapshotting to bound replay latency.
✨ *Key Features*
PostgreSQL-backed Event Store (`events` table with JSONB payloads)
CQRS: separate command (write) and query (read) endpoints, with OpenAPI/Swagger specification
Projections: `account_summaries` and `transaction_history` updated from the event stream
Snapshotting to speed aggregate rehydration (snapshots created every 50 events)
Time-travel queries: retrieve an account balance at an arbitrary past timestamp (`/accounts/{id}/balance-at/{timestamp}`)
Idempotency and optimistic concurrency control for event writes
Administrative endpoints to rebuild projections and check projection status (`/projections/rebuild`, `/projections/status`)
Pre-seeded demo data for quick testing (`acc-test-12345`)
Containerized local demonstrations using Docker and Docker Compose; API served at `http://localhost:8080/api` when the stack is running
🛠️ *Technology Stack*
Node.js, TypeScript, Express
PostgreSQL (JSONB, DECIMAL for monetary precision)
node-postgres (`pg`), `uuid`
Swagger UI / OpenAPI (`openapi.yaml`)
Docker, Docker Compose
`ts-node`, TypeScript compiler
📂 *GitHub Repository*
https://github.com/SabbellaLaharika/B...
🎥 *About This Demo*
This video demonstrates an engineering-focused implementation of an event-driven ledger: how commands append typed events to a PostgreSQL event store, how an in-process Projector updates read models, and how snapshots and concurrency safeguards make the system practical for ledger-style workloads. The demo emphasizes architecture and implementation decisions—including event schema design, projection logic, snapshotting, and idempotency—rather than a step-by-step tutorial.
⭐ If you find this project useful, please star the repository on GitHub and subscribe for more software engineering and AI engineering project demonstrations.
#EventSourcing #CQRS #TypeScript #NodeJS #Express #PostgreSQL #Docker #DockerCompose #OpenAPI #Swagger #Snapshots #Projections #Ledger #TimeTravelQueries