How graysonhuey/leaderboards works
Project type and purpose
• From the file tree and README (“WARU Band Olympics Leaderboards!”), we see a React-based, TypeScript single-page application (SPA) whose goal is to display and manage leaderboards for a band competition.
• It has no custom backend code; instead it relies on Firebase (auth + data) as a backend‐as‐a‐service and on Netlify for CI/CD and hosting.
High-level architectural components
a. Developers & CI/CD
• Source code in GitHub repo (.github/workflows/deploy.yml)
• On each push: GitHub Actions → runs build → pushes to Netlify
b. Hosting & CDN
• Netlify reads netlify.toml → deploys Vite build output → serves static assets via global CDN
c. Client application
• Browser loads index.html → main.tsx → renders React App
• Uses Tailwind CSS for styling (tailwind.config.js, postcss.config.js)
• Vite for dev/build (vite.config.ts)
d. Frontend modules
• src/App.tsx – root component & router
• src/contexts/AuthContext.tsx – provides user state & protected routes
• src/components – pages & UI pieces (Login, Dashboard, AdminPanel, Leaderboard, SectionSelector, Layout)
• src/lib/firebase.ts – config + instances for Firebase Auth & Firestore
e. External services
• Firebase Authentication – user login/role management
• Firebase Firestore (or Realtime DB) – stores leaderboard data
Data flow & interactions
• User opens browser → DNS → CDN → index.html + JS bundle
• React App mounts → AuthContext checks Firebase Auth state
→ if unauthenticated → redirects to LoginPage → signs in via Firebase Auth
→ if authenticated → fetches leaderboard data from Firestore via firebase.ts
→ client renders Dashboard or AdminPanel; AdminPanel writes updates to Firestore
• All reads/writes go over HTTPS REST/WebSocket to Firebase endpoints
Key architectural patterns
• SPA with client-side routing & protected routes (ProtectedRoute component)
• Context API for global auth state
• Component composition for layouts & pages
• BaaS (Firebase) decouples backend concerns—no custom server code
• CI/CD pipeline with GitHub Actions → Netlify