Skip to main content

Cookiecutter template to build and deploy fastapi backends..batteries included

Project description

GitHub Actions status PyPi Shield License Shield uv version Read The Docs Badge

:cookie: cookiecutter-fastapi-backend

Cookiecutter template to build and deploy fastapi backends to your favorite PaaS..batteries included.

Supported PaaS's:

  • Render
  • DigitalOcean
  • Platform.sh (Coming soon)
  • Fly.io (Coming soon)

Quickstart

Install the latest Cookiecutter if you haven't installed it yet:

# pipx is strongly recommended.
$ pipx install cookiecutter

# If pipx is not an option,
# you can install cookiecutter in your Python user directory.
$ python -m pip install --user cookiecutter

Generate project from GitHub template:

$ pipx run cookiecutter gh:nickatnight/cookiecutter-fastapi-backend

Or from Python code:

from cookiecutter.main import cookiecutter

cookiecutter("gh:nickatnight/cookiecutter-fastapi-backend")

Features

  • :whale: Docker & Docker Compose integration and optimization for local development. Fast bundles using build stages and uv
  • :computer: Production ready Python web server using FastAPI
  • :pencil2: SQLModel Library for interacting with SQL databases from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust
  • :light_rail: Alembic Lightweight database migration tool for usage with the SQLAlchemy Database Toolkit for Python
  • :floppy_disk: postgresql Powerful open source object-relational database
  • :convenience_store: Redis In-memory data structure store, used as a distributed, in-memory key–value database, cache and message broker
  • :gear: Common Base models and repository classes for common CRUD operations and database schemas.
  • :seedling: Celery Asynchronous task or job queue
  • :inbox_tray: Continuous Integration/Deployment Modular GitHub Actions to lint, test, and deploy to your favorite platform-as-a-service. Automatically includes Codecov reporting.
  • :leftwards_arrow_with_hook: pre-commit Git hooks to maintain code quality using modern tooling (ruff, black, isort)
  • :rocket: Sentry Application monitoring and error tracking. You can sign up for free at sentry.io

Input Variables

The generator (cookiecutter) will ask you for some data, you might want to have at hand before generating the project.

The input variables, with their default values (some auto generated) are:

  • project_name: The name of the project
  • project_slug: The development friendly name of the project. By default, based on the project name
  • project_slug_db: The database friendly name of the project. By default, based on the project name
  • author_email: The authors email...for maintainer info in pyproject.toml
  • py_version: The version of Python to install. Options are 3.9, 3.10, and 3.11
  • db_container_name: The name of the database container. Default db
  • backend_container_name: The name of the backend container. Default backend
  • use_celery: Whether to use Celery/Beat and Redis for asynchronous/scheduled tasks. Default no
  • use_sentry: Whether to use Sentry for application monitoring and error tracking. Default no
  • github_username: The username of the GitHub user. Used for badge display in generated project README.md
  • deployments: Deploy to your favorite platform, Render.com, DigitalOcean, (and more to come). Default none

Documentation

See full documentation here.

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

cookiecutter_fastapi_backend-2.4.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

cookiecutter_fastapi_backend-2.4.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file cookiecutter_fastapi_backend-2.4.0.tar.gz.

File metadata

File hashes

Hashes for cookiecutter_fastapi_backend-2.4.0.tar.gz
Algorithm Hash digest
SHA256 f0de2e5563818886fa809eb82d41704b7fcae9243031ec956441a5f91a7bf93d
MD5 140a11d5a09c904461e9cef88ce3daff
BLAKE2b-256 4d6ac81a53847f873a25060e8e57db900128c87f7f01e1240cda3a8dc796be66

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookiecutter_fastapi_backend-2.4.0.tar.gz:

Publisher: main.yml on nickatnight/cookiecutter-fastapi-backend

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

File details

Details for the file cookiecutter_fastapi_backend-2.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cookiecutter_fastapi_backend-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d25c0daa019d3064a50d89c3be1318b7ed756551b24ead7ab07619d0c1c29343
MD5 6ba612e0fe007bc51bb9f58eb2188033
BLAKE2b-256 9fd2d6f10e29a907c4e5a9153a2530d21fff7a61877fafe33a6d77370ebf17ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for cookiecutter_fastapi_backend-2.4.0-py3-none-any.whl:

Publisher: main.yml on nickatnight/cookiecutter-fastapi-backend

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