This is a condensed version of the fastapi cookier cutter found here
This is intended to be the minimum necessary to start building a larger project with no opinion on deployment or databases
Create a new python environment:
conda create -n fastapi python=3.9
Install poetry and packages
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
make install
Install development version
make install-dev
create database fastapi_db;
create user thatsyou with password 'changethis';
ALTER ROLE thatsyou SET client_encoding TO 'utf8';
ALTER ROLE thatsyou SET default_transaction_isolation TO 'read committed';
ALTER ROLE thatsyou SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE fastapi_db to thatsyou;
export POSTGRES_SERVER="localhost"
export POSTGRES_USER="thatsyou"
export POSTGRES_PASSWORD="changethis"
export POSTGRES_DB="fastapi_db"
export POSTGRES_TEST_DB="nameoftestdatabase"
make migrations
make build
make test
Serve the application
make serve