This is a template to create simple fastapi web apps.
It powered by traefik, both dev and prod.
To run code, just type:
docker-compose -f docker-compose.dev.yml upand then go to http://api.localhost .
The uvicorn will automatically update and restart after changes in files.
To manage dependencies, use poetry .
To add dependencies, just type
poetry add <dep_name>
# or
poetry add <dep_name> --devFor manual installation and using in shell, use
poetry install
poetry shellYou can export requirements manually, using
poetry export -f requirements.txt --output requirements.txtFor adding enviroment variables, edit .env file. It's recommended to add this file to .gitignore to prevent leak of secret variables into repository. For big projects, use vault and hvac library.
For VSCode users, select virtual enviroment created by poetry. Mypy and flake8 will be there.