A minimal, audited production baseline for Python/FastAPI services.
Technical repository/package name: python-service-foundation.
Informal shorthand: PSF.
A small, domain-neutral foundation for building production-minded Python HTTP services.
Early learning-lab baseline. Public repository; v0.1.0 is the first tagged public release.
- reproducible Python project setup;
- explicit package boundaries;
- automated formatting, linting, type checking, and tests;
- a minimal foundation that can later host an HTTP service;
- clean separation between reusable infrastructure and application domains.
This foundation does not currently include:
- domain-specific models;
- external providers or provider SDKs;
- databases;
- Redis;
- caching policies;
- stale fallback;
- request coalescing;
- frontend code.
Those concerns belong to downstream applications or later milestones.
The canonical project roadmap is maintained in docs/roadmap.md.
- Python 3.12+
- uv
- Ruff
- mypy
- pytest
Runtime HTTP dependencies will be introduced in later milestones.
The local development runtime uses Docker Compose and the production-oriented Dockerfile. It intentionally runs a single application service without database, Redis, reverse proxy, HTTPS, bind mounts, or persistent volumes.
Start the service:
docker compose up --build -dInspect service state:
docker compose psVerify the application:
curl http://127.0.0.1:8000/health/live
curl http://127.0.0.1:8000/health/readyInspect application logs:
docker compose logs appAfter source changes, rebuild and restart with:
docker compose up --build -dStop the local runtime:
docker compose downThe Compose runtime does not define persistent application volumes, so shutdown should not leave persistent application state behind.
Install the locked development environment:
uv sync --frozen --python 3.12Run the validation suite:
uv lock --check
uv run --frozen ruff format --check .
uv run --frozen ruff check .
uv run --frozen mypy
uv run --frozen pytest -W errorStart the local container runtime:
docker compose up --build -dVerify it:
curl http://127.0.0.1:8000/health/live
curl http://127.0.0.1:8000/health/readyStop it:
docker compose downVersioned application API:
/api/v1/
Operational endpoints:
GET /health/live
GET /health/ready
Requests and responses support correlation through the X-Request-ID header.
Detailed documentation is kept under docs/:
- Architecture — application structure, routing, observability, runtime, and CI boundaries;
- Development — setup, quality gates, tests, Docker, and Compose workflow;
- Configuration — environment-variable reference and runtime configuration;
- Design decisions — architecture choices and invariants;
- Roadmap — milestone state and acceptance criteria.
Python Service Foundation is intentionally domain-neutral.
The foundation does not contain:
- sports-domain models;
- external sports-provider integration;
- provider credentials;
- database or Redis infrastructure;
- reverse proxy or TLS configuration;
- customer code, assets, payloads, or proprietary naming.
Those concerns belong to later milestones or downstream projects.
The repository includes a GitHub Actions validation workflow that enforces:
- lockfile consistency;
- frozen dependency installation;
- formatting;
- linting;
- strict static typing;
- tests with warnings treated as errors;
- Compose configuration validation;
- production-container build validation.
Third-party actions are pinned to immutable commit SHAs and the workflow uses read-only repository permissions.