sanjayadanushka712/TaskFlow

Public

End-to-end DevOps TaskFlow API — FastAPI, PostgreSQL, SQLAlchemy, Alembic, Docker Compose, Pytest and GitHub Actions CI,Kubernetes,prometheus,Grafana,helm,k9s,kompose,minikube,helmify

  • Stars140+1 tuần này
  • Forks3
  • Watchers0
  • Issues0
  • Ngày tạo25/10/2026
  • Cập nhật gần nhất03/11/2026
  • Ngôn ngữPython
  • Giấy phép—
README.md37.5 KBRaw

TaskFlow

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.

CI Python FastAPI PostgreSQL Docker Ruff


Overview

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.


Features

  • Create, read, update, complete, and delete tasks
  • Strict request validation with Pydantic
  • Idempotent POST /tasks using 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 /docs and /redoc
  • Simple terminal client for local use

Architecture

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

Nội dung README thuộc về sanjayadanushka712 và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/sanjayadanushka712/TaskFlow