| name | full-stack-dev |
| description | How to develop the frontend and backend together. When you want to make changes to the UI, use this. |
Frontend application
We have a frontend React app in www/. It is pretty lightweight for the moment. It has some views to list eval sets, scans, and samples, from the data warehouse DB.
It embeds the inspect_ai and inspect_scout frontend components.
If you want to make changes to inspect_ai and inspect_scout, you can link them to this project.
It's perfectly okay to make changes to inspect_ai and inspect_scout. We can contribute changes upstream.
Environment files
Env files are generated from Pulumi stack outputs using scripts/dev/generate-env.py (run from the repo root, i.e. ~/dev/hawk).
CLI-only env (for hawk CLI usage):
uv run python scripts/dev/generate-env.py <stack> > hawk/.env
Full local dev env (includes HAWK_API_* vars for running FastAPI locally):
uv run python scripts/dev/generate-env.py <stack> --api > hawk/.env
The --api flag adds HAWK_API_* vars (database URL, S3 bucket, middleman, ECR repos, etc.) plus VITE_* vars for the frontend, all pointing at the deployed stack's infrastructure.
Available stacks: stg, dev-mish1, dev-faber, etc.
Running the backend
To run FastAPI locally against a deployed stack's DB/S3/etc.:
cd hawk
uv run python ../scripts/dev/generate-env.py dev-mish1 --api > .env
set -a && source .env && set +a
uv run fastapi dev hawk/api/server.py --port 8080
The backend takes ~15-20 seconds to start due to heavy imports. If port 8080 is in use, pick another port and update VITE_API_BASE_URL.
Alternatively, to skip running the backend locally and point the frontend at a deployed API:
VITE_API_BASE_URL=https://api-mish1.hawk.staging.metr-dev.org pnpm dev
Running the frontend
The frontend uses pnpm (specified in package.json packageManager). npm run dev also works.
cd www
pnpm install
set -a && source ../.env && set +a
pnpm dev
The dev server runs on http://localhost:3000/. The backend API URL is configured via VITE_API_BASE_URL (defaults to http://localhost:8080).
Running dependencies
cd ~/dev/inspect_ai/src/inspect_ai/_view/www
pnpm install
pnpm build:lib --watch
For Scout:
cd ~/dev/inspect_scout/src/inspect_scout/_view/www
pnpm install
pnpm build:lib --watch