A minimal, production‑leaning FastAPI template with testing (coverage), linting/formatting, Docker, and CI. Ships with a root endpoint and a health check.
- FastAPI + Uvicorn
- Pydantic Settings for configuration management
- Custom logging with TRACE level support
- Testing with pytest + pytest-cov (HTML/XML coverage, 85% threshold)
- Ruff for linting and formatting; optional mypy typing
- Dockerfile and GitHub Actions CI (Python 3.13)
GET /→{ "message": "the server is now active" }GET /health→{ "ok": true }
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements-dev.txt
cp .env.example .env # Optional: customize your environment variables
uvicorn app.main:app --reload --port 8000Open http://localhost:8000 and http://localhost:8000/health
pytest
# Outputs: htmlcov/ (HTML), coverage.xml (XML), threshold enforced via pyproject.tomlruff check .
ruff format .
# Optional typing
mypy appdocker build -t fastapi-starter .
docker run -p 8000:8000 fastapi-starterGitHub Actions workflow runs linting and tests with coverage on Python 3.13. See .github/workflows/ci.yml.
MIT. See LICENSE.