Skip to content

one-zero-eight/fastapi-template

Repository files navigation

FastAPI Template

About

This is the CookieCutter template for FastAPI ASGI application.

Technologies

How to use?

  1. Install Cookiecutter
  2. Run Cookiecutter on this repo:
    pipx run cookiecutter gh:one-zero-eight/fastapi-template
  3. Go to generated project and install dependencies with Poetry
    poetry install
  4. Run Ruff formatting and linting:
    poetry run ruff format
    poetry run ruff check --fix
  5. Generate settings.schema.yaml:
    poetry run python scripts/generate_settings_schema.py

How to update dependencies

Project dependencies

  1. Run poetry update to update all dependencies (it may update nothing, so double-check)
  2. Run poetry show --outdated --all to check for outdated dependencies
  3. Run poetry add <package>@latest [--group <group>] to add a new dependency if needed
  4. Also, copy mongo and sql dependency groups from pyproject.toml to pyproject.toml.jinja

Pre-commit hooks

  1. Run poetry run pre-commit autoupdate

Also, Dependabot will help you to keep your dependencies up-to-date, see dependabot.yml.