This is a sample template with minimal setup of poetry with fast api. go through README and start developing.
run `poetry run sample dev` for streamlit UI.
run `poetry run sample api` and /version` is one endpoint.
run `poetry run lint` to lint the code.
This is a useful to start the development with pre-defined template and best practices and define folder structure.
Python ≥ 3.11 is required. Verify using:
python --version
Use the Makefile command:
make install
This runs poetry install internally.
make dev
This executes poetry run sample dev.
make api
This executes poetry run sample api.
make lint
This runs ruff, black (check mode), and mypy.
make format
This runs black and ruff with auto-fix enabled.
make clean
This removes __pycache__, mypy cache, pytest cache, and build artifacts.
Poetry manages the virtual environment automatically. To inspect:
poetry env info
Only when adding or upgrading dependencies.
poetry lock --no-cache --regenerate
Avoid unnecessary lock file changes in pull requests.
MongoDB support is an optional extra dependency. Install using:
pip install sample[mongo]
If using Poetry:
poetry install --extras "mongo"
No. Never commit secrets. Use environment variables or external secret managers.
Maintain a .env.example file for documentation purposes.