Skip to main content
Two options are available: Docker gives you a production-like environment with no local Python setup required; local Python is faster to iterate with because uvicorn restarts automatically on code changes.
1

Choose a run mode

Pick Docker if you want a self-contained environment, or local Python if you want hot reload during development.
docker build -t risk-monitor .
docker run -p 8000:8000 risk-monitor
2

Wait for the database to initialize

On first startup, main.py calls seed_db(), which creates risk_monitor.db in the working directory and inserts 50 sample businesses with varied creation dates and 3 risk evaluations each. This only runs once — if any businesses already exist, seeding is skipped.
3

Open the app

Visit http://localhost:8000 in your browser. The root URL redirects to /businesses.

Dependencies

All runtime and test dependencies are pinned in requirements.txt:
PackageVersion
fastapi0.115.0
uvicorn[standard]0.30.0
sqlalchemy2.0.35
jinja23.1.4
pydantic2.9.0
python-multipart0.0.9
pytest8.3.3
httpx0.27.2

API docs

FastAPI generates interactive API documentation automatically:

Docker internals

The Dockerfile uses python:3.12-slim as the base image, installs dependencies from requirements.txt, and starts the server with:
uvicorn main:app --host 0.0.0.0 --port 8000
The --host 0.0.0.0 flag binds to all interfaces so the container port can be forwarded to the host.

Build docs developers (and LLMs) love