2025-10-23 16:56:46 -07:00
# CLAUDE.md
2026-04-13 20:58:34 -07:00
Brackt.com is a fantasy sports drafting platform (React Router 7 + SSR, Socket.IO, PostgreSQL/DrizzleORM, Clerk auth).
2025-10-23 16:56:46 -07:00
2026-04-13 20:58:34 -07:00
## Commands
2025-10-23 16:56:46 -07:00
```bash
2026-04-13 20:58:34 -07:00
npm run dev # development with HMR
npm run typecheck # TypeScript check
npm run db:generate # generate Drizzle migration
npm run db:migrate # apply migrations
npm run test:run # unit tests (once)
npm run test:e2e:headless # Cypress E2E
npm run test:all # everything
2025-10-23 16:56:46 -07:00
```
2026-04-13 20:58:34 -07:00
## Critical Rules
2025-10-23 16:56:46 -07:00
2026-04-13 20:58:34 -07:00
**Routes**: Every new route file must also be registered in `app/routes.ts` — React Router 7 does not auto-discover files. Forgetting this causes a silent 404. See [routing guide ](docs/agents/routing.md ).
2026-03-07 22:31:04 -08:00
2026-04-13 20:58:34 -07:00
**Database**: Always query through `app/models/` — never write Drizzle queries directly in route files.
2026-03-07 22:31:04 -08:00
2026-04-13 20:58:34 -07:00
**Tests**: Required for all new features. Do not consider a feature complete until tests pass. See [testing guide ](docs/agents/testing.md ).
2026-04-12 13:52:05 -07:00
2026-04-13 20:58:34 -07:00
**Drizzle migrations**: Never manually create migration SQL or edit `_journal.json` . Always use `npm run db:generate` . See [database guide ](docs/agents/database.md ).
2026-04-12 13:52:05 -07:00
2026-04-13 20:58:34 -07:00
## Reference Docs
2026-04-12 13:52:05 -07:00
2026-04-13 20:58:34 -07:00
- [Architecture ](docs/agents/architecture.md ) — server layout, DB layer, Socket.IO events
- [Domain Models ](docs/agents/domain-models.md ) — draft system and sports data models
- [Database ](docs/agents/database.md ) — migration rules, scoring event date gotcha
- [Routing ](docs/agents/routing.md ) — route registration, admin routes
- [Testing ](docs/agents/testing.md ) — what tests are required and where they live
- [Auth ](docs/agents/auth.md ) — Clerk patterns, ownership validation