Ignore test db.
Setup migrations.
Add and apply linter.
poetry install [--no-dev]
poetry run uvicorn app.main:app [--reload]
docker build -t fastapi-app
docker run -p 8000:80 fastapi-app:latest
# it will then run on localhost:8000
On start up the migrations are automatically applied.
# add a migration
poetry run alembic revision -m "Name of the revision"
# add a migration with autogeneration
poetry run alembic revision --autogenerate -m "Name of the revision"
# more options
poetry run alembic --help
poetry run pytest
poetry run black [--check] .
poetry run flake8 .
poetry run isort . [--check]
poetry run bandit -r app
There is a graphql endpoint on /gql
. Test using:
{
hello(name: "Yolo")
}
The other endpoint are self-documenting using swagger (see /docs
).