Live config loaded — values shown in teal reflect what is currently deployed on this server.
AGS Documentation
Back to Dashboard

Deployment CLAUDE.md

Branch strategy

feature branch  →  PR into staging  →  validate  →  PR staging into main
                        ↓                                     ↓
                  Railway staging                      Railway production

Never commit .env or *.local.*. Secrets are Railway environment variables. GitHub Actions deploys both services automatically on push.

Required environment variables

VariablePurpose
DATABASE_URLPostgreSQL connection string
REDIS_URLRedis connection string
JWT_SECRETParticipant JWT signing key (HS256)
RESEARCHER_JWT_SECRETResearcher JWT. Must be different from JWT_SECRET.
PHONE_HMAC_SECRETHMAC-SHA256 key for phone tokens. Must differ from JWT_SECRET — JWT rotation should not invalidate phone reauth.
MISTRAL_API_KEYRequired for Level 3 (walkthrough) interventions and explicit Level 3 help. Without this key, all L3 responses fall back to scripted content only. L1 and L2 scripted help is unaffected.
DASHBOARD_RESEARCHER_EMAILDefault researcher account seeded on first deploy.
DASHBOARD_RESEARCHER_PASSWORDDefault researcher account password.

Migrations & common commands

# Apply all pending migrations (runs automatically on Railway deploy)
alembic upgrade head

# Generate a new migration after model changes
alembic revision --autogenerate -m "description"

# Roll back one migration
alembic downgrade -1

# Check current migration head
.venv/bin/alembic heads

# Backend dev server
uvicorn src.main:app --reload --port 8000

# Frontend dev server (proxies /v1/* to :8000)
cd dashboard && npm run dev

# Railway logs
railway service AGS && railway logs

Keeping this documentation current

When you change something fundamental, update the matching section.

Each section header has a source file tag showing which file it maps to. The live config fetch (for researchers logged into the dashboard) will automatically flag any threshold values that differ from what's documented here.