Skip to main content
Fintech Risk Monitor has no environment variables or config files. All tuneable values are constants in source code, designed to be changed directly before running.

Pagination

PAGE_SIZE = 15 is defined at the top of app/routes.py. It controls the number of businesses returned per page across the list view and all paginated queries.
# app/routes.py
PAGE_SIZE = 15
Change this value and restart the server to apply a different page size.

Database

The SQLite database file is created in the working directory when the app first starts. Two separate files are used:
FileUsed by
risk_monitor.dbApplication (development and production)
test_risk_monitor.dbTest suite (conftest.py)
The test suite overrides the FastAPI database dependency to always connect to test_risk_monitor.db, so the two files never interfere with each other.
SQLite is appropriate for development and demos. If you need to run queries with search, sort, or filtering at scale, PostgreSQL is recommended. The README notes that factors stored as JSON text in SQLite would map cleanly to a native jsonb column in PostgreSQL.

Database seeding

seed_db() in app/seed.py runs automatically at startup (called from main.py). It inserts 50 dummy businesses with varied creation dates spread over the past year, and 3 risk evaluations per business. The function checks for existing data first and exits immediately if any businesses are found, so it only runs once.
# app/seed.py
def seed_db():
    """Insert 50 dummy businesses with varied creation dates and 3 evaluations each."""
    db = SessionLocal()
    try:
        if db.query(Business).first() is not None:
            return
        ...
To reseed from scratch, delete risk_monitor.db and restart the app.

Uvicorn options

The server is started with uvicorn main:app. Useful flags for local development:
FlagEffect
--reloadRestart the server automatically when source files change
--host 0.0.0.0Bind to all network interfaces (used in Docker)
--port 8000Port to listen on (default: 8000)
Use --reload during development to avoid restarting the server manually after every code change:
uvicorn main:app --reload
Do not use --reload in the Docker container or any production-like deployment — the Dockerfile starts uvicorn without it.

Build docs developers (and LLMs) love