How thabawss/cicd-todo-api works
todo-api is a small REST service for managing tasks. A client sends health checks or list, create, and completion requests to the Express app; creation validates and normalizes the title before repository operations. The server wires the app to a PostgreSQL-backed repository, which uses a connection pool to query the database. The repository abstraction also has an in-memory implementation, documented for unit tests. The graph follows relationships shown in the sampled source and README; it omits migration internals because their implementation was not sampled.
Main entry points: pg-repository.ts PostgreSQL Repository · app.ts HTTP Routes · server.ts Server Bootstrap · repository.ts Repository Contract
Components 10
HTTP API
- Server Bootstrap
src/server.ts - HTTP Routes
src/app.ts
Task Domain
- Title Validation
src/todo.ts - Task Model
src/todo.ts
Persistence
- Repository Contract
src/repository.ts - Memory Repository
src/repository.ts - PostgreSQL Repository
src/pg-repository.ts - Connection Pool
src/db.ts
Other components
- API Client
- PostgreSQL
Connections 10
- API Client → HTTP Routes: sends requests
README.md - Server Bootstrap → HTTP Routes: creates
src/server.ts - Server Bootstrap → Connection Pool: creates
src/server.ts - Server Bootstrap → PostgreSQL Repository: configures
src/server.ts - HTTP Routes → Title Validation: validates titles
src/app.ts - HTTP Routes → Repository Contract: calls repository
src/app.ts - PostgreSQL Repository → Repository Contract: implements
src/pg-repository.ts - Memory Repository → Repository Contract: implements
src/repository.ts - PostgreSQL Repository → Connection Pool: queries
src/pg-repository.ts - PostgreSQL Repository → PostgreSQL: reads and writes
src/pg-repository.ts