A fast-paced trivia quiz app with solo and real-time multiplayer modes. Questions are pulled from the Open Trivia Database across dozens of categories and difficulty levels.
Live app: https://jamiep2k.github.io/TriviaApp/
- Singleplayer — customise category, difficulty, question count, and an optional countdown timer
- Multiplayer — host or join a room with up to 6 players using a 6-character room code
- Real-time score sync and a final leaderboard
- Automatic room cleanup when the host leaves or disconnects
- Works entirely in the browser — no install required
- Open the app and configure your quiz settings (category, difficulty, number of questions, time limit)
- Press Start Quiz
- Select an answer for each question — correct answers are revealed immediately
- View your final score and a full answer review at the end
Hosting a game:
- Press Multiplayer on the home screen
- Press Host and enter your display name
- Configure the quiz settings in the lobby
- Share the 6-character room code with other players
- Press Start Game once everyone has joined
Joining a game:
- Press Multiplayer → Join and enter your display name
- Enter the room code provided by the host
- Wait in the lobby until the host starts the game
Once the game starts, all players answer questions simultaneously. The next question advances automatically once everyone has answered (or the timer runs out). Final standings are shown on a leaderboard at the end.
The app is plain HTML/CSS/JS with no build step — just serve the three files.
To set up multiplayer you need a Firebase project:
- Go to Firebase Console and create a new project
- Enable Realtime Database (choose a region) and Anonymous Authentication
- Copy your Firebase config and paste it into the
firebaseConfigblock near the bottom ofindex.html - Set your Realtime Database rules to the following:
{
"rules": {
"rooms": {
"$roomCode": {
".read": "auth != null",
".write": "auth != null && (!data.exists() || data.child('hostId').val() === auth.uid)",
"players": {
"$uid": {
".write": "auth != null && (auth.uid === $uid || root.child('rooms').child($roomCode).child('hostId').val() === auth.uid)"
}
}
}
}
}
}| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript |
| Questions API | Open Trivia Database |
| Multiplayer | Firebase Realtime Database |
| Auth | Firebase Anonymous Authentication |
| Hosting | GitHub Pages |