📄️ Overview
Contracts must stay in sync with the implementation. If a method signature, exception condition, or behavior changes, update the contract in the same PR.
📄️ Authentication Module
auth — src/lib/auth.ts
📄️ Prisma Client
Singleton PrismaClient using the native PrismaPg adapter. Shared across all server-side code. Requires DATABASE_URL to be set before first import.
📄️ Middleware
Next.js middleware that redirects unauthenticated requests to /login. Currently applied to /dashboard via config.matcher.
📄️ Question API
GET /api/question. Returns one question from an in-memory cache loaded from public/dataset.csv on first call. Filters are ANDed together. Returns a random match from all qualifying rows.
📄️ UI Components
---
📄️ Pages
---
📄️ WebSocket Events
Socket.IO, same origin as Next.js. Client connects with io() (no args). Server defined in server.js. Redis-backed for cluster-aware rooms and code state persistence.