Skip to main content

full-stack-dev

How to develop the frontend and backend together. When you want to make changes to the UI, use this.

소스 정보

저장소
METR/hawk
최근 소스 활동
2026년 9월 9일 20:53
감지된 SKILL.md 언어
영어
스타
87
포크
50

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
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 `hawk/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` from the repository root. Log in to Hawk's S3 Pulumi backend, set a stack name once, then generate the environment files from the repository root: ```bash export AWS_PROFILE="<profile-for-the-target-account>" export PULUMI_FALLBACK_TO_STATE_SECRETS_MANAGER=true pulumi login "s3://<state-bucket>?region=<region>&awssdk=v2" export STACK="<stack>" ``` **CLI-only env** (for hawk CLI usage): ```bash uv run python scripts/dev/generate-env.py "$STACK" > .env ``` **Full local dev env** (includes HAWK_API_* vars for running FastAPI locally): ```bash uv run python scripts/dev/generate-env.py "$STACK" --api > hawk/.env ``` The destinations intentionally differ: the Hawk CLI loads `.env` from its current working directory, while `scripts/dev/api` explicitly loads `hawk/.env` before starting the local API. The `--api` flag adds backend `HAWK_API_*` variables for the deployed stack's database, S3 bucket, Middleman, ECR repositories, and other infrastructure. It sets `VITE_API_BASE_URL` so the frontend talks to the local API. Use `stg` or the name of your own `dev-*` stack. ## Running the backend To run FastAPI locally against a deployed stack's DB/S3/etc.: ```bash cd hawk uv run python ../scripts/dev/generate-env.py "$STACK" --api > .env # if not already done 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: ```bash DEPLOYED_API_URL="$(pulumi stack output api_url -s "$STACK")" cd hawk/www VITE_API_BASE_URL="$DEPLOYED_API_URL" pnpm dev ``` ## Running the frontend The frontend uses **pnpm** (specified in `package.json` `packageManager`). `npm run dev` also works. ```bash cd hawk/www pnpm install # if needed set -a && source ../.env && set +a # picks up VITE_* vars 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`). ## Developing embedded viewer libraries Ordinary Hawk frontend work needs only `hawk/www`; do not clone Inspect AI or Inspect Scout unless the change is inside one of their embedded viewer libraries. For that cross-repository workflow, including cloning the relevant repository at Hawk's pinned revision and linking its viewer package locally, follow [hawk/www/README.md](../../../hawk/www/README.md#developing-the-embedded-viewer-libraries).
GitHub에서 보기