Skip to content

Latest commit

 

History

596 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here's your final, polished, best-version README — complete with all badges, clean formatting, and ready to copy-paste directly:


🧠 FastAPI Python Boilerplate — AI‑Driven DevOps Stack

CI/CD Pipeline CodeQL Analysis codecov MIT License Python 3.11+ FastAPI Docker Compose


🚀 Overview

A production‑ready FastAPI boilerplate integrating:

  • 🧩 LangGraph AI Agent — query SQL databases using natural language
  • 💳 Stripe Payment Integration — secure, scalable payment flow
  • ⚙️ Helm + Kubernetes CI/CD — automated deployment and scaling
  • 🌐 Traefik Routing — seamless microservice orchestration

⚙️ Getting Started

Requirements

  • Python 3.11+
  • Docker Desktop 4.43+ or Docker Engine
  • Docker Compose 2.38.1+ (Linux)
  • Optional GPU for local inference

Quick Start

git clone https://github.com/ZyntroAI/fastapi-python-boilerplate.git
cd fastapi-python-boilerplate
docker compose up

🔑 Environment Variables

Variable Description Example
DATABASE_URL PostgreSQL connection string postgresql://user:pass@db:5432/chinook
OPENAI_API_KEY API key for OpenAI inference sk-xxxx
STRIPE_SECRET_KEY Stripe secret key sk_live_xxxx
STRIPE_PUBLIC_KEY Stripe publishable key pk_live_xxxx
APP_ENV Environment mode development / production

Store secrets in .env or secret.* files. Never commit secrets to Git.


🧠 Inference Options

Default: Local Docker model runner.

Switch to OpenAI:

echo "sk-..." > secret.openai-api-key
docker compose down -v
docker compose -f compose.yaml -f compose.openai.yaml up

🧪 Testing Guide

Run unit tests:

pytest tests/

Run with coverage report:

pytest --cov=app --cov-report=xml tests/

Integration tests (requires containers running):

docker compose exec backend pytest tests/integration

💡 Codecov Tip: Add the step below to your CI workflow to automatically upload coverage:

- name: Upload Coverage to Codecov
  uses: codecov/codecov-action@v4
  with:
    files: ./coverage.xml

☸️ Kubernetes Deployment (Helm)

Install Helm Chart

helm install fastapi-boilerplate ./helm

Upgrade Release

helm upgrade fastapi-boilerplate ./helm

values.yaml Highlights

replicaCount: 3
image:
  repository: zyntroai/fastapi-boilerplate
  tag: latest
ingress:
  enabled: true
  hosts:
    - host: fastapi.local
      paths: ["/"]
resources:
  limits:
    cpu: 500m
    memory: 512Mi

📁 Repository Structure

├── .github/workflows/   # CI/CD pipelines (CI, Deployment, CodeQL)
├── api/                 # API route definitions
├── app/                 # Core application logic
├── docker/              # Docker & container configs
├── helm/                # Kubernetes Helm charts
├── k8s/                 # Kubernetes manifests
├── scripts/             # Utility & automation scripts
├── services/            # Business logic & service layer
├── tests/               # Unit & integration tests
├── docker-compose.yml   # Local dev stack (Traefik + services)
├── requirements.txt     # Python dependencies
└── main.py / app.py     # Application entry points

📜 License

MIT License © 2026 ZyntroAI


🧠 Credits

  • LangGraph — AI agent orchestration
  • FastAPI — modern Python web framework
  • PostgreSQL — relational database
  • Docker Compose — local development & container orchestration
  • Stripe — payments & billing
  • Traefik — reverse proxy & ingress controller
  • Helm — Kubernetes package manager

All badges included: CI/CD · CodeQL · Codecov · License · Python · FastAPI · Docker
Ready to use — just copy into your README.md
Coverage tip included — shows exactly how to make the coverage badge work

Want me to also generate the Codecov workflow snippet you can paste directly into your .github/workflows/ci.yml?

Releases

Packages

Used by

Contributors

Languages