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.0.tar.gz (290.0 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.0-py3-none-any.whl (356.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shaapi-0.3.0.tar.gz
  • Upload date:
  • Size: 290.0 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.0.tar.gz
Algorithm Hash digest
SHA256 e3347dd6eeb7f6d18c3bbd2bf00f7b92c8149f33f8f6af6a31350fb238fc52a3
MD5 34d4f05138383855b0d438f32481b26c
BLAKE2b-256 eb29a5f4b6970f0c6fed0ed91c0dcc2d5607ec2066e35c89d83ce3c8f6f8a61c

See more details on using hashes here.

Provenance

The following attestation bundles were made for shaapi-0.3.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: shaapi-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 356.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 705a36fbb33a41f3fbd18cedebde3a5f260630f34598b9fb67f830b1af8ce1de
MD5 7e63782e4666e4485d9563f74f6fbf94
BLAKE2b-256 ae185e0ec4584789243b118e0d16675e2177a358d9150aabcfd30a72c694a4c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for shaapi-0.3.0-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