How redstellaris/leaderboard works
This is a GT3 leaderboard web app: visitors pass a quiz and authentication gate, then view session and course rankings sourced from Google Sheets; the app also provides prediction, circuit-rating, and administrative views. A separate serverless check monitors sheet changes and GitHub commits, sends Discord notifications, and persists monitoring state. The frontend and auth flow are supported by sampled source; several listed views and the monitor’s unsampled details are represented only where the tree or excerpts support them.
Main entry points: App.jsx App shell · check.js Monitor endpoint · SessionView.jsx Session view · sheetsFetch.js Sheet loading
Components 19
Leaderboard app
- App shell
src/App.jsx - Access quiz
src/components/views/QuizPage.jsx - Sheet loading
src/utils/sheetsFetch.js - Session view
src/components/views/SessionView.jsx - Ranking logic
src/logic/ranking.js - Global results
src/components/views/GlobalView.jsx - Course results
src/components/views/CourseView.jsx - Landing page
src/components/views/LandingPage.jsx - Predictions
src/components/views/PredictionPanel.jsx - Circuit rating
src/components/views/CircuitRating.jsx - Admin dashboard
src/components/views/AdminDashboard.jsx
Identity and access
- Auth provider
src/auth/AuthProvider.jsx - Supabase
src/auth/supabaseClient.js
Monitoring
- Monitor endpoint
api/check.js - Monitor state
Other components
- Visitor
- Google Sheets
- GitHub API
- Discord webhook
Connections 19
- Visitor → App shell: uses
- App shell → Access quiz: renders
- App shell → Auth provider: checks session
- App shell → Sheet loading: loads data
- Sheet loading → Google Sheets: fetches rows
- App shell → Landing page: renders
- App shell → Session view: renders
- Session view → Ranking logic: calculates rankings
- Session view → Global results: renders global
- Session view → Course results: renders course
- App shell → Predictions: renders
- App shell → Circuit rating: renders
- App shell → Admin dashboard: renders
- Auth provider → Supabase: auth and profiles
- Admin dashboard → Supabase: manages profiles
- Monitor endpoint → Monitor state: reads and writes
- Monitor endpoint → Google Sheets: checks changes
- Monitor endpoint → GitHub API: checks commits
- Monitor endpoint → Discord webhook: sends alerts