Skip to content

About

Host and play selfmade quizes in person with your friends. All in one solution for display, host "remote" and player buzzers

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

Custom Quiz Host

A web-based Quiz game hosting application built with ASP.NET Core and React. This application allows you to create and host interactive quiz games with multiple players, custom categories, questions, and multimedia support including images, audio, and video.

Features

  • Real-time Gameplay: Powered by SignalR for instant synchronization across all connected devices
  • Multiple Views:
    • Display View (/ or /display): Main game board for the audience/projector screen
    • Remote Control View (/remote): Host interface for managing every aspect of the game
    • Buzzer View (/buzzer): Player interface for buzzing in and submitting answers
    • Planner View (/plan): Offline, browser-only editor for preparing quiz boards (categories, questions, media) without touching the live game session — export a ZIP and import it on the Remote Control when you're ready to play
    • Merge View (/merge): Offline, browser-only tool for combining two or more quiz ZIPs (exported from /plan or as "Questions only" from /remote) into a single ZIP, letting you pick exactly which categories to take from each uploaded file and merging categories that share the same name
  • Player Management: Add, remove, and track player scores in real-time; click a score to edit it directly
  • Player Avatars: Players can take a selfie or upload a photo from the Buzzer page — avatars appear on their buzz button and on the Display
  • Custom Categories & Questions: Create your own categories with customizable point values (200–1000)
  • Question Ordering: Reorder questions within a category by dragging or using the ▲/▼ buttons; sort all questions by points with one click
  • Multiple Question Types:
    • Standard text questions
    • Image questions
    • Image Mozaik (progressively un-blur the image with adjustable speed)
    • Audio questions (play/pause with volume control)
    • Video questions (play/pause with volume control and fullscreen support)
  • Answer Images: Optionally attach a reveal image to any question that is shown alongside the text answer on the Display
  • Buzzer System: Track player buzz-in order with accurate timestamps; highlight the active buzzer; move to the next buzzer with one click; optionally preserve the queue so each player can buzz only once per activation
  • Pause on Buzz: Automatically pause audio, video, or mozaik reveal when a player buzzes in
  • Question Timer: Start a per-question countdown (1–999 seconds, default 10) from the Remote Control; an animated timer appears on the Display without covering the question text. While the timer runs the host can pause/resume it manually or cancel it outright. The countdown also pauses automatically when a player buzzes in and resumes once the buzzer queue is cleared. When the countdown reaches zero the buzzer is deactivated and the "Allow answer input" toggle is unchecked (if it was active)
  • Buzzer Sync (experimental): NTP-like time synchronisation across devices for fair latency-compensated buzz ordering
  • Player Answer Input: Optionally enable a text-answer field on the Buzzer page so players can type their answers, which the host can then reveal on the Display
  • Disable Player Selection: Lock the player picker on the Buzzer page so players can't change which account/team they are playing as once the game has started (auto-restoring a previously selected player on page refresh still works)
  • Media Controls: Show/hide media (image, audio, video) independently of revealing the question; toggle fullscreen for images and videos; adjust volume with a slider
  • Display Controls: Hide the game board from the Display, or show a large QR code overlay that links players straight to the Buzzer page — both toggled from the Remote Control's Setup tab
  • Score Tracking: Award or deduct the current question's points per player; set any score manually; double or halve all remaining unanswered question values in one click
  • Category Selector Highlight: The player who picks the next category is highlighted with an orange border on the Display and Remote Control. The selector is the last player to receive points in the previous round, or the next player in the list if nobody scored. The host can manually override the selector for any player from the Scoreboard (★ button) and can toggle the highlight on or off from the Setup screen.
  • Random Player Wheel: Spin a fortune-style wheel of all players (with names and avatars) from the Board section of the Remote to randomly pick a player on the Display. The wheel decelerates and reveals the chosen player; dismiss the overlay with a single click.
  • Winner Declaration: Declare the winner at the end of the game to show a winner screen on the Display
  • High Score & Low Score Boards: Persistent halls of fame/shame across game sessions and server restarts, shown alongside the winner screen; can be shown/hidden or cleared independently
  • Remote Access Guard (Anti-Cheating): Only one device can host at a time. If a second device opens /remote it lands on a waiting screen while the device already in control gets a "Potential cheating detected" prompt and 30 seconds to let the other device in or block it. If nobody decides within 30 seconds the second device is let in automatically, so a stale or crashed host device can never lock you out
  • Event History: Full log of points awarded/deducted and questions asked, viewable from the Remote Control (History tab) and from the Buzzer page
  • Persistent State: Game state is auto-saved to localStorage and automatically restored when the Remote Control reconnects to an empty server
  • Import/Export: Export questions-only or the full game state (including all media files) as a ZIP archive; import a previously exported ZIP to restore everything
  • Offline Quiz Planner: A dedicated /plan page lets you build complete quiz boards in the browser without affecting any live session. Categories, questions, and uploaded media are persisted locally (localStorage + IndexedDB) and can be exported as a Questions only ZIP that imports cleanly into the Remote Control's Setup tab
  • Offline Quiz Merger: A dedicated /merge page lets you combine two or more previously exported quiz ZIPs (from /plan or /remote "Questions only" exports) into a single merged ZIP. You can select exactly which categories to include from each uploaded file. Categories with the same name are merged together and their questions are concatenated. The page runs entirely in your browser and never touches a running game
  • Soundboard: Upload custom sound effects on the /admin page and give each one a name; the host can then fire them from the Remote Control's Sounds tab and they play through the Display. Sounds are layerable (even the same sound multiple times) and every running instance is listed under "Currently playing" so it can be stopped before it finishes. Each playing sound has its own volume slider (the last used volume is remembered as that sound's default for the next time it is played) and a master volume slider scales all sounds at once while keeping their ratios. The whole soundboard can be exported as a ZIP (audio files plus a soundboard.json with the button names) and imported again on another server
  • Media Admin: A dedicated /admin page lists every media file stored on the server with its size and last-modified date. Download files individually, or select multiple files (with select all) to download them as a ZIP archive or delete them from the server. Files referenced by the current live game (question media, answer images, player avatars) are marked "In use" and protected from deletion — they can still be downloaded. The page and its API endpoints are password protected; configure the password via the ADMIN_PAGE_PASSWORD environment variable (an unsafe built-in default is used if unset, so always set your own)

Technology Stack

Backend

  • Framework: ASP.NET Core 10.0
  • Real-time Communication: SignalR
  • Language: C#
  • Containerization: Docker

Frontend

  • Framework: React 19.2
  • Language: TypeScript
  • Build Tool: Vite
  • Routing: React Router
  • Styling: CSS
  • Real-time Communication: @microsoft/signalr

Quickstart (Docker Compose)

The easiest way to get started is with Docker Compose using the pre-built image from the GitHub Container Registry:

  1. Download the docker-compose.yml from this repository (or create it with the content below):

    services:
      custom-quiz-host:
        image: ghcr.io/michamican/custom-quiz-host:latest
        ports:
          - "8080:8080"
        environment:
          - ADMIN_PAGE_PASSWORD=changeMe # password for the /admin page
        volumes:
          - uploads:/app/uploads
          - highscores:/app/highscores
        restart: unless-stopped
    
    volumes:
      uploads:
      highscores:
  2. Start the application

    docker compose up -d
  3. Access the application

    • Display View: http://localhost:8080/
    • Remote Control: http://localhost:8080/remote
    • Buzzer: http://localhost:8080/buzzer
    • Planner: http://localhost:8080/plan
    • Merger: http://localhost:8080/merge

Uploaded media files (images, audio) are persisted in the uploads Docker volume and survive container restarts. Highscores are stored separately in the highscores volume for independent persistence. The soundboard definition is kept in the soundboard subfolder of the uploads volume, next to the sound files it references, so no extra volume is needed.

The /admin page (media management and soundboard) is password protected. Set the ADMIN_PAGE_PASSWORD environment variable to configure the password; if it is not set, an unsafe built-in default password is used, so you should always configure your own.

Prerequisites

  • .NET SDK 10.0 or later
  • Node.js 20.x or later
  • npm (comes with Node.js)

Getting Started

Development Setup

  1. Clone the repository

    git clone https://github.com/MichaMican/custom-quiz-host.git
    cd custom-quiz-host
  2. Install frontend dependencies

    cd customquizhost.client
    npm install
    cd ..
  3. Run the application

    Option A: Using .NET CLI (runs both frontend and backend through the ASP.NET Core SPA proxy)

    cd CustomQuizHost.Server
    dotnet run

    This starts the ASP.NET Core backend and launches the Vite development server automatically.

  4. Access the application

    • Display View: https://localhost:5173/ or https://localhost:5173/display
    • Remote Control: https://localhost:5173/remote
    • Buzzer: https://localhost:5173/buzzer
    • Planner: https://localhost:5173/plan
    • Merger: https://localhost:5173/merge
    • Backend API and SignalR hub (proxied by Vite): https://localhost:7135/ or http://localhost:5200/

Docker Deployment

  1. Build the Docker image

    docker build -f CustomQuizHost.Server/Dockerfile -t custom-quiz-host .
  2. Run the container

    Option A: Without a volume mount (uploads are not persisted)

    docker run -p 8080:8080 custom-quiz-host

    Option B: With a volume mount (uploads including the soundboard, and highscores are persisted)

    docker run -p 8080:8080 -v custom-quiz-host-uploads:/app/uploads -v custom-quiz-host-highscores:/app/highscores custom-quiz-host
  3. Access the application

    • Navigate to http://localhost:8080

Usage

Setting Up a Game

  1. Open the Remote Control (/remote) and go to the Setup tab.
  2. Players – Add each player by name and press Enter or click "Add".
  3. Categories – Create one or more categories (e.g. "History", "Science").
  4. Questions – For each category, add questions with:
    • Question type (Standard, Image, Image Mozaik, Audio, Video)
    • Question text (required for Standard; optional caption for media types)
    • Media file upload (required for Image / Mozaik / Audio / Video types)
    • Optional answer image (shown on the Display when the answer is revealed)
    • Answer text
    • Point value (200, 400, 600, 800, or 1000)
  5. Use ▲/▼ to reorder questions or Sort by Points ↑ to sort a category automatically.
  6. Import – You can import a previously exported .zip file (questions-only or full game state) instead of entering questions manually.

Hosting a Game

  1. Open the Display View (/ or /display) on a screen visible to all players (e.g. a projector or TV).
  2. Open the Remote Control (/remote) on the host's device.
  3. Open the Buzzer View (/buzzer) on each player's device.
    • Players select their name from the dropdown.
    • Players can optionally take a selfie or upload a photo as their avatar.

Playing the Game

Switch to the Host tab on the Remote Control.

  1. Select a question on the board (click the point value cell).
  2. Reveal the question to the Display:
    • Standard: click "Show Question".
    • Media types: click "Show Image / Display Audio / Show Video" to display the media; use play/pause and the volume slider to control playback; use "Fullscreen" to fill the screen.
    • Image Mozaik: click "Show Image" then "▶ Start Reveal" to progressively un-blur; adjust speed with the reveal-speed slider.
  3. Activate the Buzzer to open it for players; enable "Pause actions on buzz" to automatically pause audio/video/mozaik when someone buzzes in.
  4. Player answers – If "Enable answer input for players" is checked, players can type their answer in the Buzzer view. Use "Show Answers on Display" to reveal them.
  5. Award or deduct points using the +/− buttons next to each player's name in the Scoreboard section.
  6. Show the answer with "Show Answer on Display" (and the optional answer image).
  7. Dismiss the question to return to the board, or Return to Board to go back without marking it answered.
  8. Repeat until all questions are answered.

Ending the Game

  1. Click 🏆 Declare Winner to show a winner screen on the Display.
  2. Use ⭐ Show/Hide Highscores to display the all-time high score and low score boards alongside the winner.
  3. Use ↩ Revert Winner if you need to continue playing.

Import / Export

In the Setup tab, under Import / Export:

  • Choose Questions only or Full Game State from the dropdown.
  • 📤 Export – Downloads a .zip file containing the JSON data and all referenced media files.
  • 📥 Import – Uploads a previously exported .zip and restores it (media files are re-uploaded automatically).

Keyboard Shortcuts (Remote Control)

Key Action
Enter Add player / category; confirm score edit
Escape Cancel score edit

Project Structure

custom-quiz-host/
├── CustomQuizHost.Server/       # ASP.NET Core backend
│   ├── Controllers/                 # API controllers (upload, buzzer, game)
│   ├── Hubs/                       # SignalR hub
│   ├── Middleware/                  # Custom middleware
│   ├── Models/                     # Data models and GameState
│   ├── Services/                   # Business logic (game engine, highscores)
│   └── Program.cs                  # Application entry point
├── customquizhost.client/       # React frontend
│   ├── src/
│   │   ├── components/             # Shared UI components (Avatar, modals, etc.)
│   │   ├── hooks/                  # Custom React hooks (SignalR, wake lock, …)
│   │   ├── pages/                  # Page components (Display, RemoteControl, Buzzer)
│   │   ├── types/                  # TypeScript type definitions
│   │   └── utils/                  # Utility functions (localStorage, timeSync, upload)
│   └── package.json
├── docs/                        # Documentation assets (screenshots)
└── README.md

Development

Frontend Development

cd customquizhost.client
npm run dev          # Start development server
npm run build        # Build for production
npm run lint         # Run ESLint

Backend Development

cd CustomQuizHost.Server
dotnet build         # Build the project
dotnet run          # Run the application

Configuration

Backend Configuration

Configuration can be modified in CustomQuizHost.Server/appsettings.json:

  • Logging levels
  • CORS settings (if needed)
  • SignalR configuration

Frontend Configuration

Vite configuration in customquizhost.client/vite.config.ts:

  • Proxy settings for API calls
  • Build optimization settings

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

About

Host and play selfmade quizes in person with your friends. All in one solution for display, host "remote" and player buzzers

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages