An end-to-end DevOps learning project: a FastAPI task management API backed by PostgreSQL, containerized with Docker Compose, published to Docker Hub, deployed to Kubernetes with Helm, and validated by a GitHub Actions CI/CD pipeline.
TaskFlow is a small but complete CRUD service built to demonstrate the full lifecycle of a modern Python application:
- Application: FastAPI + Pydantic request validation
- Persistence: PostgreSQL + SQLAlchemy 2
- Schema management: Alembic migrations
- Runtime: Docker + Docker Compose with health checks
- Quality: Ruff linting/formatting and Pytest
- Automation: GitHub Actions for migrations, tests, and Docker Hub image publishing
- Orchestration: Kubernetes manifests and a Helm chart with Postgres, Prometheus, and Grafana
- Client: A Python CLI (
main.py) and a REST API (api.py)
The API includes idempotent task creation through the Idempotency-Key header, which prevents duplicate work when clients retry requests.
- Create, read, update, complete, and delete tasks
- Strict request validation with Pydantic
- Idempotent
POST /tasksusing a persisted idempotency key and request hash - PostgreSQL-backed idempotency records
- Alembic migration history for reproducible schemas
- Docker Compose stack with a private network, named volume, and health checks
- Non-root application container
- Automated linting, formatting checks, migrations, tests, and Docker Hub image publishing in CI
- Kubernetes deployment manifests with liveness/readiness probes and a database init container
- Helm chart with configurable API image, replicas, resources, and monitoring stack
- Interactive OpenAPI docs at
/docsand/redoc - Simple terminal client for local use
flowchart LR
Client[Client / curl / Swagger] --> API[FastAPI API]
CLI[Python CLI] --> Service[Taskflow service]
API --> Service
Service --> ORM[SQLAlchemy]
ORM --> DB[(PostgreSQL 17)]
Compose[Docker Compose] -.-> API
Compose -.-> DB
Dev[Developer] -->|push / pull request / tag| CI[GitHub Actions]
CI --> Lint[Ruff]
CI --> Tests[Pytest against PostgreSQL]
CI -->|push image| Hub[(Docker Hub)]
Hub --> K8s[Kubernetes / Helm]
K8s --> API
K8s --> DB