Choose a run mode
Pick Docker if you want a self-contained environment, or local Python if you want hot reload during development.
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.Open the app
Visit http://localhost:8000 in your browser. The root URL redirects to
/businesses.Dependencies
All runtime and test dependencies are pinned inrequirements.txt:
| Package | Version |
|---|---|
fastapi | 0.115.0 |
uvicorn[standard] | 0.30.0 |
sqlalchemy | 2.0.35 |
jinja2 | 3.1.4 |
pydantic | 2.9.0 |
python-multipart | 0.0.9 |
pytest | 8.3.3 |
httpx | 0.27.2 |
API docs
FastAPI generates interactive API documentation automatically:- Swagger UI — http://localhost:8000/docs
- ReDoc — http://localhost:8000/redoc
Docker internals
TheDockerfile uses python:3.12-slim as the base image, installs dependencies from requirements.txt, and starts the server with:
--host 0.0.0.0 flag binds to all interfaces so the container port can be forwarded to the host.