What is sample?

This is a sample template with minimal setup of poetry with fast api. go through README and start developing.

What are the main packages and libraries?
What are method to run?

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.

How it is different from others?

This is a useful to start the development with pre-defined template and best practices and define folder structure.

Which Python version is supported?

Python ≥ 3.11 is required. Verify using:

python --version
How do I install dependencies?

Use the Makefile command:

make install

This runs poetry install internally.

How do I run the Streamlit app?
make dev

This executes poetry run sample dev.

How do I run the FastAPI server?
make api

This executes poetry run sample api.

How do I run linting and type checks?
make lint

This runs ruff, black (check mode), and mypy.

How do I auto-format the code?
make format

This runs black and ruff with auto-fix enabled.

How do I clean cache and build artifacts?
make clean

This removes __pycache__, mypy cache, pytest cache, and build artifacts.

Where is the virtual environment created?

Poetry manages the virtual environment automatically. To inspect:

poetry env info
When should I regenerate poetry.lock?

Only when adding or upgrading dependencies.

poetry lock --no-cache --regenerate

Avoid unnecessary lock file changes in pull requests.

What if pymongo is not found?

MongoDB support is an optional extra dependency. Install using:

pip install sample[mongo]

If using Poetry:

poetry install --extras "mongo"
Are secrets allowed inside the repository?

No. Never commit secrets. Use environment variables or external secret managers. Maintain a .env.example file for documentation purposes.