Imported from kipr/colosseum (
AGENTS.md). Install upstream withnpx skills add kipr/colosseum. Copyright stays with the author.
Colosseum - Agent Instructions
Cursor Cloud specific instructions
Project overview
Colosseum is a tournament management and scoring platform (React 19 + Express 5 + TypeScript). See README.md for full details.
Services
| Service | Port | Command |
|---|---|---|
| Express API (backend) | 3000 | npm run dev:server |
| Vite dev server (frontend) | 5173 | npm run dev:client |
| Both together | 3000 + 5173 | npm run dev |
| Playwright e2e stack | 3001 + 5174 | npm run test:e2e |
Key caveats
- PostgreSQL via Docker Compose is required. Cursor Cloud must have Compose. Do not fall back to SQLite. Start it with
npm run db:up && npm run db:waitbeforenpm run dev,npm run test:run, ornpm run test:e2e. - Copy
.env.exampleto.envbefore starting the server:cp .env.example .env.DATABASE_URL(app) andTEST_DATABASE_URL(Vitest + Playwright) are required. UnsetDATABASE_URLdoes not open SQLite; the server fails fast with adb:uphint. - If Postgres is unreachable and config came from
DATABASE_URL, the server wraps the error withnpm run db:up && npm run db:wait. Production usesDB_HOSTorCLOUD_SQL_CONNECTION_NAMEwithDB_USER/DB_PASSWORD/DB_NAMEinstead ofDATABASE_URL;NODE_ENV=productionis not a dialect signal. npm run devusesconcurrently; the Vite client waits for the Express health endpoint to become available before starting. Vite runs withstrictPort, so a taken port is an error rather than a silent move to the next one — that keeps the dev stack from landing on the e2e suite's port.- Google OAuth (
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET) is only needed for admin login. Judge-facing features (score submission via access codes) and public/spectator views work without OAuth. Tests use auth shims and do not require real credentials. - By default, only
@kipr.orgemail addresses can log in as admin. To allow all domains, setALLOWED_EMAIL_DOMAINS=(empty string) in.env. - The Vitest suite requires PostgreSQL. Tests read
TEST_DATABASE_URL(from the environment or.env), defaulting topostgres://colosseum:colosseum@localhost:5432/colosseum_test. Each worker process gets its own schema, truncated between tests.npm run test:runfails fast with adb:uphint if the server is unreachable. - The Playwright suite also requires PostgreSQL.
npm run test:e2estarts its own Express (3001) and Vite (5174) withDATABASE_URLset toTEST_DATABASE_URL, and never reuses a server on 3000/5173, so it can run whilenpm run devis up. It uses thepublicschema ofcolosseum_testand truncates it once at the start of each run; the Vitest suite's per-worker schemas on the same database are unaffected. The specs seed data withpgthroughe2e/helpers/db.tsand log admins in by writing the"session"table viae2e/helpers/session.ts. - The OAuth callback URL is derived from
APP_URL(seesrc/server/config/google.ts). After login, users are redirected to the Vite dev server with?logged_in=1.
Standard commands (see package.json)
- Lint:
npm run lint(ESLint) andnpm run pretty(Prettier check) - Test:
npm run test:run(all tests, single run) ornpm test(watch mode) - Build:
npm run build(cleans, then builds client + server) - Dev:
npm run db:up && npm run db:wait && npm run dev(starts both servers concurrently) - Verify all:
npm run pretty && npm run lint && npm run test:run && npm run build