Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

nickatnight/cookiecutter-fastapi-backend

Repository files navigation

GitHub Actions statusPyPi ShieldLicense Shielduv versionRead The Docs Badge

🍪 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:

fromcookiecutter.mainimportcookiecuttercookiecutter("gh:nickatnight/cookiecutter-fastapi-backend")

Features

  • 🐳Docker & Docker Compose integration and optimization forlocal development. Fast bundles using build stages anduv
  • 💻Production ready Python web server usingFastAPI
  • ✏️SQLModelLibrary for interacting with SQL databases from Python code, with Python objects. It is designed to be intuitive, easy to use, highly compatible, and robust
  • 🚈Alembic Lightweight database migration tool for usage with theSQLAlchemy Database Toolkit for Python
  • 💾postgresql Powerful open sourceobject-relational database
  • 🏪Redis In-memory data structurestore, used as a distributed, in-memory key–value database, cache and message broker
  • ⚙️Common Base models and repository classes for common CRUD operations and database schemas.
  • 🌱CeleryAsynchronous task or job queue
  • 📥Continuous Integration/Deployment ModularGitHub Actions to lint, test, and deploy to your favorite platform-as-a-service. Automatically includesCodecov reporting.
  • ↩️pre-commitGit hooks to maintain code quality using modern tooling (ruff, black, isort)
  • 🚀Sentry Application monitoring and error tracking. You can sign up for free atsentry.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
  • author_email: The authors email...for maintainer info inpyproject.toml
  • py_version: The version of Python to install. Options are3.9,3.10, and3.11
  • db_container_name: The name of the database container. Defaultdb
  • backend_container_name: The name of the backend container. Defaultbackend
  • use_celery: Whether to use Celery and Redis for asynchronous tasks. Defaultno
  • periodic_tasks: Whether to use Celery Beat for periodic tasks. Defaultno
  • use_sentry: Whether to use Sentry for application monitoring and error tracking. Defaultno
  • github_username: The username of the GitHub user. Used for badge display in generated projectREADME.md
  • deployments: Deploy to your favorite platform, Render.com, DigitalOcean, (and more to come). Defaultnone

Documentation

See full documentationhere.


[8]ページ先頭

©2009-2025 Movatter.jp