Real-time multiplayer quiz game. Host creates a room, players join with a code, everyone answers live.
| Layer | Tech |
|---|---|
| Backend | Go, WebSocket (coder/websocket), PostgreSQL (pgx) |
| Frontend | React 19, Zustand, React Router 7, Tailwind CSS 4 |
cd backend
cp .env.template .env
# Optional: add DATABASE_URL=postgres://... to .env for bank management
go run ./cmd/kahoot/cd frontend
npm install
npm run devOpen http://localhost:5173.
Set DATABASE_URL in backend/.env to enable the question bank API:
DATABASE_URL=postgres://user:pass@localhost:5432/kahootTables are created automatically on startup. Without a database the game runs with a built-in demo bank.
All endpoints require DATABASE_URL to be set.
| Method | Path | Description |
|---|---|---|
GET |
/banks |
List all banks |
POST |
/banks |
Create bank {"title":"..."} |
GET |
/banks/{id} |
Get bank with questions |
POST |
/banks/{id}/questions |
Add question {"prompt","answer_bank","correct_answer"} |
DELETE |
/banks/{id} |
Delete bank |
DELETE |
/questions/{id} |
Delete question |
WebSocket endpoints: /host?bankId={id} (host), /player?roomId=X&playerId=Y (player).