Skip to main content

Scaffold lean, batteries-included FastAPI backends — like django-admin, for FastAPI.

Project description

shaapi

PyPI version Python License: MIT Docs Publish to PyPI Deploy docs Built with FastAPI

Scaffold lean, batteries-included FastAPI backends — like django-admin, for FastAPI.

Beginners shouldn't have to architect a production backend from scratch. shaapi gives you a clean, opinionated FastAPI project — async SQLAlchemy + Alembic, Postgres, Redis, JWT auth, Casbin RBAC, file storage, and a one-command Docker workflow — generated in seconds.

pip install shaapi
shaapi new "my api"
cd my_api
shaapi up

→ API live at http://localhost:8000, Swagger at http://localhost:8000/admin/api/v1/docs.

What you get

  • FastAPI (async) with a clean layered architecture (app/, common/, core/, crud/, models/, schemas/)
  • SQLAlchemy 2 + Alembic migrations, Postgres (auto-create in dev, migrations in prod)
  • Redis cache + rate limiting
  • JWT auth + Casbin RBAC (users, roles, permissions)
  • File storage (MinIO / S3 / GCS)
  • Docker: multi-stage slim image built with uv, hot-reload in dev (source bind-mount), cross-platform shaapi orchestration (no bash)
  • Opt-in observability (--monitoring): Prometheus, Grafana, Tempo, Loki
  • Production tooling (shaapi ops): hardened compose overlay (datastores off the public network), secret generation, VPS provisioning/firewall scripts, and a dev/prod git-branch split (same code, config-only divergence)
  • Security testing (shaapi sec): static audit + black-box probes (default-secret JWT forge, auth, login rate-limit, exposed ports), with a CI-friendly exit code

Generated projects are secure by default: a production fail-fast guard refuses to boot with default secrets, the container runs non-root, and the datastores are never exposed in production.

CLI

shaapi new "my api"                       # interactive scaffold
shaapi new "my api" -y                    # accept defaults
shaapi new "my api" --prod                # + production config on a `prod` git branch
shaapi up / db apply / auth init          # run the stack (cross-platform docker wrapper)
shaapi ops harden / secrets / checklist   # production hardening (shaops)
shaapi sec audit / auth / scan / ports    # security testing (shasec)
shaapi --version

In your generated project

shaapi up                       # build + start everything (dev: hot-reload)
shaapi up --prod                # production: datastores not exposed
shaapi db apply                 # alembic upgrade head
shaapi db generate -m "add posts table"
shaapi auth init                # create the first admin
shaapi logs / shaapi down

On Linux/macOS a bundled ./docker-run.sh offers the same commands if you prefer a plain shell script.

Documentation

📖 Full documentation site (EN/FR): https://shalom-302.github.io/shaapi/

Highlights:

The Markdown sources live in docs/ (English *.md, French *.fr.md).

Example

examples/todolist — a complete authenticated Todo API (JWT, per-user ownership, admin-only endpoint) built on top of shaapi in 5 files.

Status

Alpha. See the repo for roadmap and contribution guidelines.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shaapi-0.3.2.tar.gz (290.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shaapi-0.3.2-py3-none-any.whl (356.1 kB view details)

Uploaded Python 3

File details

Details for the file shaapi-0.3.2.tar.gz.

File metadata

  • Download URL: shaapi-0.3.2.tar.gz
  • Upload date:
  • Size: 290.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shaapi-0.3.2.tar.gz
Algorithm Hash digest
SHA256 43eca6316b478db5331e515de2470bef076524f793b5244347d95af380e3bc47
MD5 9c7d6a85b13b84291acf71f3e52f4560
BLAKE2b-256 492e583accb75a7cd9a79bb33cf4fc542f4845a24f9f1828477217c92b5cd0c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for shaapi-0.3.2.tar.gz:

Publisher: publish.yml on Shalom-302/shaapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shaapi-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: shaapi-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 356.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shaapi-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0704c146de26964fe18fbaa40b93464b455a18695f0e64f83cce36f795fa2cab
MD5 c9650c6f9f3f9828d0416e408511e702
BLAKE2b-256 dbad3335e9222be4f80cfdd646d1e07a3bfb35a53edb28477b081b31208a3acd

See more details on using hashes here.

Provenance

The following attestation bundles were made for shaapi-0.3.2-py3-none-any.whl:

Publisher: publish.yml on Shalom-302/shaapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page