:cookie: Cookiecutter template to build and deploy fastapi backends..batteries included
:cookie: Cookiecutter template to build and deploy fastapi backends..batteries included.
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install cookiecutter
Generate project:
cookiecutter https://github.com/nickatnight/cookiecutter-fastapi-backend.git
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 projectproject_slug
: The development friendly name of the project. By default, based on the project nameproject_slug_db
: The database friendly name of the project. By default, based on the project nameauthor_email
: The authors email...used for certbotpy_version
: The version of Python to install. Options are 3.8
, 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
nginx_container_name
: The name of the nginx web server container. Default nginx
doctl_version
: The version name of DigitalOcean Command Line Interface to use. Default 1.92.0
github_username
: The username of the GitHub user. Used for badge display in generated project README.md
include_example_api
: Include example API, models, schemas, and script to init db data. Options are y
or n
deployments
: Include docker-compose
files needed for deployment step in GitHub Action. Options are y
or n
After using this generator, your new project (the directory created) will contain an extensive README.md
with instructions for development, deployment, etc. You can view it here
This project uses Poetry to manage dev environment. Once installed:
poetry install
poetry run pytest tests
Pre-commit:
pre-commit install
pre-commit run --all-files