DATABASE_URL is unset, the app uses a fast in-memory store that is seeded with demo data. Add an LLM key only if you want real AI responses; the offline mock works for everything else.
Option A — Python virtualenv (recommended)
Configure your environment
.env. For local development the defaults are fine — you only need to change values if you want a real database or real LLM responses:Start the dev server
make:http://localhost:4000. Hot-reload is on by default with --reload.Option B — Docker (no Python install required)
Available make targets
Run make help to see all targets:
| Target | Description |
|---|---|
make install | Create .venv and install requirements.txt |
make dev | Start dev server with hot reload on $PORT (default 4000) |
make dev-log | Dev server with JSON access logs enabled |
make test | Run pytest test suite |
make lint | Lint with ruff |
make typecheck | Type-check with mypy |
make migrate | Apply forward-only SQL migrations (requires DATABASE_URL) |
make docker-build | Build the Docker image as causeloop-backend:latest |
make docker-run | Run the Docker image using .env |
make docker-run-mock | Run in mock LLM mode (no .env needed) |
make clean | Remove .venv and cache directories |
Dev seed accounts
When running with the in-memory store, the following accounts are pre-seeded and can be used in API requests:| User ID | Role | Notes |
|---|---|---|
usr_seed_admin | admin | Full access |
usr_seed_analyst | analyst | Read + write on analysis resources |
usr_seed_viewer | viewer | Read-only |
X-User-Id header (when auth is relaxed for local dev) or exchange a Clerk session token via POST /v1/auth/exchange.
Connecting a local database
If you want to run against a real Postgres instance during development:Load the schema and reference data