Host live quizzes freely
This is the code for the website (developed in Svelte). It relies on two other components to function properly:
- Backend game server: Code is under fuiz/game-backend (
game/directory). The urls to it are defined byPUBLIC_BACKEND_URLandPUBLIC_WS_URL. - Backend image server: Code is under fuiz/game-backend (
corkboard/directory). The url to it is defined byPUBLIC_CORKBOARD_URL.
Both have standalone server and Cloudflare Worker implementations. In production, the Cloudflare Workers are hosted at api.fuiz.org and corkboard.fuiz.org.
The website can be built with either the Cloudflare or Node adapter (controlled by the ADAPTER environment variable, defaults to cloudflare). When running outside of Cloudflare, the following services fall back to local alternatives:
| Service | Cloudflare | Self-Hosted |
|---|---|---|
| Database | D1 | SQLite |
| Blob Storage | R2 | Filesystem |
| Key-Value Store | KV | SQLite |
| AI (tag derivation) | Cloudflare AI | Any OpenAI-compatible API |
See fuiz/self-hosted for a ready-to-use Docker Compose setup.
After installing dependencies with bun install, start a development server:
bun run devWhile we use bun ourselves, npm should work just as fine.
You might need the following environment variables (.env.local):
# the link to the current hosted version, production: fuiz.org
PUBLIC_DISPLAY_PLAY_URL="localhost:5173"
# same as above but with the actual protocol, production: https://fuiz.org
PUBLIC_PLAY_URL="http://localhost:5173"
# the game backend, production: https://api.fuiz.org
PUBLIC_BACKEND_URL="http://localhost:8787"
# same as above but a websocket url, production: wss://api.fuiz.org
PUBLIC_WS_URL="ws://localhost:8787"
# image server url, production: https://corkboard.fuiz.org
PUBLIC_CORKBOARD_URL="http://localhost:43907"If you would like to setup backing up to gDrive then you need to create a Google application and set:
# Google Auth Client Id and Secret Key
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
# usually is your domain + /api/gdrive/callback
AUTH_GOOGLE_REDIRECT_URI=Fuiz uses a GitLab-based publishing system where users authenticate with GitLab OAuth, submit fuizzes via pull requests, and maintainers review before merging. Once merged, a webhook automatically syncs the fuiz to the live library.
See GITLAB_PUBLISHING_SETUP.md for complete setup instructions and environment variables.
The live components' status can be accessed on status.fuiz.org.