shaapi¶
Scaffold lean, batteries-included FastAPI backends — like django-admin, for FastAPI.
shaapi gives you a clean, production-shaped FastAPI project in seconds: async
SQLAlchemy + Alembic, PostgreSQL, Redis, JWT auth, Casbin RBAC, file storage and
a cross-platform shaapi CLI that wraps docker compose. Stop wiring
infrastructure — start building features.
-
Instant start
pip install shaapi→shaapi new→shaapi up→ a working API in under a minute. -
Clean architecture
Models · schemas · CRUD · services · routers. The same layering used in serious production codebases — ready to learn from.
-
Docker-first
Multi-stage slim image, hot-reload in dev, migrations in prod, driven by the cross-platform
shaapiCLI (Windows/macOS/Linux, no bash). -
Learn by reading
A real, well-organized backend. Students learn FastAPI the production way by exploring a project that actually runs.
Quick start¶
Then optionally create an admin user with shaapi auth init.
→ API at http://localhost:8000 · Swagger at http://localhost:8000/admin/api/v1/docs
What's inside¶
- FastAPI (async) with a layered architecture
- SQLAlchemy 2 + Alembic — auto-create in dev, migrations in prod
- PostgreSQL + Redis (cache & rate limiting)
- JWT auth + Casbin RBAC — users, roles, permissions
- File storage — MinIO / S3 / GCS
- Docker — slim multi-stage image built with uv, hot-reload, driven by the cross-platform
shaapiCLI (./docker-run.shremains as an optional Unix shell alternative) - Opt-in observability — Prometheus, Grafana, Tempo, Loki
Built on the latest stack: SQLAlchemy 2.0 · Pydantic v2 · FastAPI.
Where to next?¶
-
Install, create a project, run it.
-
Understand the architecture — and why it scales.
-
The layers, the lifespan, the config.
-
A full authenticated Todo API, step by step.
-
What it buys you, and how to scale up.
-
Ship to production on a VPS with TLS.