A Kahoot-style real-time quiz game built entirely on Cloudflare Workers.
- Real-time multiplayer - Players join with a 6-digit PIN and answer questions simultaneously
- WebSocket-powered - Instant updates using Cloudflare Durable Objects
- Save & reuse quizzes - Store your quizzes in KV for future games
- Automatic scoring - Points based on correctness and speed
- Podium reveal - Dramatic 3rd → 2nd → 1st place announcement
- Mobile-friendly - Responsive design for all devices
- Backend: Cloudflare Workers + Durable Objects
- Storage: Cloudflare KV (quiz persistence)
- Frontend: React + TanStack Router + TailwindCSS
- Real-time: WebSockets via Durable Objects
Click the button above to deploy your own instance. Cloudflare will automatically:
- Clone this repository to your GitHub account
- Provision the required Durable Object and KV namespace
- Build and deploy the application
# Install dependencies
npm install
# Generate Cloudflare types
npm run cf-typegen
# Start development server
npm run devThe app will be available at http://localhost:8787.
- Host creates a quiz with multiple-choice questions
- Host starts the game and shares the 6-digit PIN
- Players join by entering the PIN and choosing a nickname
- Questions are displayed with a countdown timer
- Scoring rewards both correctness and speed
- Leaderboard shows rankings between questions
- Podium reveals the top 3 players at the end
cfhoot/
├── src/
│ ├── index.ts # Worker entry point & API routes
│ ├── game.ts # Durable Object game logic
│ └── types.ts # Shared TypeScript types
├── frontend/
│ └── src/
│ ├── pages/ # React page components
│ ├── hooks/ # WebSocket hook
│ └── store/ # Game state management
└── wrangler.jsonc # Cloudflare configuration
The app uses these Cloudflare bindings (auto-provisioned on deploy):
| Binding | Type | Description |
|---|---|---|
GAME |
Durable Object | Manages real-time game sessions |
QUIZZES |
KV Namespace | Stores saved quizzes for reuse |
MIT
