A real-time competitive trivia platform built with Firebase and vanilla JavaScript. Players compete daily on Sporcle quizzes, earn points throughout the season, and face off in Head-to-Head matchmaking and playoff tournaments.
- Daily Leaderboard: Submit scores from daily Sporcle quizzes with automatic ranking
- Tiebreaker System: Time remaining serves as the tiebreaker for identical scores
- Real-time Updates: Standings update instantly via Firebase real-time listeners
- Point System: Points awarded based on daily ranking (1st place = most points)
- Cumulative Tracking: Season-long leaderboard tracks total points earned
- First/Last Place Stats: Track who gets the most first places and last places
- Real-time Queuing: Find opponents instantly with websocket-style matching
- Category Selection: Choose from 9 queue types (Random + 8 specific categories)
- Category-based Standings: Track win/loss records per category
- Streak Tracking: Current streak and best win streak displayed
- 32-Team Bracket: Standard NCAA-style tournament bracket
- Seeded Matchups: Seeds determined by season standings (1 vs 32, 2 vs 31, etc.)
- BYE Handling: Automatic advancement when fewer than 32 players
- Real-time Bracket Updates: Live bracket visualization with React components
- Animated Spinner: Physics-based wheel animation for quiz selection
- 8 Categories: Geography, History, Science, Sports, Movies/TV, Music, Literature, Misc
- Quiz Database: Admins can add quizzes with category tags via the Quiz Manager
- Season Awards: Four awards given at season end:
- π Commissioner's Trophy (most regular season points)
- π₯ Sporcle Cup (playoff champion)
- πΉ Head to Head Demon (most H2H wins)
- β Highest Highs (most first places)
- Champion Badges: Award winners display badges next to their names
- Email/Password Auth: Users create accounts to track their stats
- Persistent Sessions: Stay logged in across browser sessions
- Profile Management: Edit display name and alias
- Quiz Management: Set daily quiz links, manage quiz database
- Points Management: Edit/delete player points, award points manually
- Season Management: End playoffs, archive and reset season data
- Playoff Controls: Finalize brackets, manually set match winners
- Frontend: Vanilla JavaScript, HTML5, CSS3
- UI Framework: Bootstrap 5 with Bootswatch Minty theme
- Backend: Firebase (Firestore, Authentication, Cloud Functions)
- Real-time Data: Firestore real-time listeners
- Rendering: React (for playoff bracket component)
public/
βββ index.html # Main application (7000+ lines)
β βββ Firebase initialization
β βββ Authentication system
β βββ Daily quiz section with wheel
β βββ Today's standings
β βββ Season standings
β βββ Head-to-Head matchmaking
β βββ Playoff bracket (React)
β βββ Hall of Champions
β βββ Admin panel
βββ app.js # Application logic
β βββ Champion badges system
β βββ Standings rendering
β βββ Awards display
β βββ Admin UI handlers
β βββ Tab navigation
βββ styles.css # Custom styles
β βββ Bracket layout
β βββ Responsive breakpoints
β βββ Component styling
βββ quiz-admin.html # Quiz database manager
βββ Quiz CRUD operations
βββ Category management
βββ Admin authentication
| Collection | Purpose |
|---|---|
today |
Current day's quiz submissions |
points |
Season standings (cumulative points) |
userProfiles |
User account information |
headtoheadQueue |
H2H matchmaking queue |
headtoheadMatches |
Active/completed H2H matches |
headtoheadRecords |
H2H win/loss statistics |
playoffSeries |
Playoff bracket matchups |
wheelQuizzes |
Quiz database with categories |
wheelSpin |
Current wheel spin state |
quizLink |
Today's quiz URL |
config |
App configuration (playoffs state) |
archivedPoints |
Historical season data |
archivedH2H |
Historical H2H records |
The H2H system uses a polling-based matchmaking approach:
- Player joins queue with selected category
- System checks for compatible opponents every 3 seconds
- When matched, both players receive the same quiz
- Scores submitted and winner determined automatically
When players have identical scores:
- Higher percentage wins
- If tied: More time remaining wins
- If still tied: Higher raw score wins
- If still tied: Alphabetical by name
Uses standard NCAA tournament seeding:
- Seeds 1-32 based on regular season points
- Bracket pairs: 1v32, 16v17, 8v25, 9v24, etc.
- Winners advance to next round automatically
-
Create Firebase Project
- Go to Firebase Console
- Create new project
- Enable Firestore Database
- Enable Authentication (Email/Password)
-
Configure Firebase
- Copy your Firebase config to
index.html - Deploy Firestore security rules
- Copy your Firebase config to
-
Deploy
firebase deploy --only hosting
-
Set Admin Access
- Use Firebase Admin SDK to set custom claims
- Run in Google Cloud Shell:
admin.auth().setCustomUserClaims(USER_UID, { admin: true });
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
function isAdmin() {
return request.auth != null && request.auth.token.admin == true;
}
match /config/{document} {
allow read: if true;
allow write: if isAdmin();
}
match /points/{alias} {
allow read: if true;
allow write: if isAdmin();
}
match /today/{alias} {
allow read: if true;
allow write: if request.auth != null;
}
match /userProfiles/{uid} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == uid;
}
match /headtoheadQueue/{doc} {
allow read, write: if request.auth != null;
}
match /headtoheadMatches/{doc} {
allow read, write: if request.auth != null;
}
match /headtoheadRecords/{alias} {
allow read: if true;
allow write: if request.auth != null;
}
match /playoffSeries/{doc} {
allow read: if true;
allow write: if isAdmin();
}
match /wheelQuizzes/{doc} {
allow read: if true;
allow create: if request.auth != null;
allow delete: if isAdmin();
}
match /wheelSpin/{doc} {
allow read: if true;
allow write: if isAdmin();
}
match /archivedPoints/{doc} {
allow read: if true;
allow write: if isAdmin();
}
match /archivedH2H/{doc} {
allow read: if true;
allow write: if isAdmin();
}
}
}- Push notifications for H2H matches
- Historical season browser
- Player profile pages
- Match history viewer
- Mobile app version
- Discord integration
This project was created for educational purposes as part of a web development course.
Jared Ellis
- Sporcle for the quiz content
- Firebase for the backend infrastructure
- Bootstrap for the UI framework
- Bootswatch for the Minty theme