How subham269/prediction-tracker works
Sports Prediction Tracker is a web app for making cricket and football predictions, recording outcomes, and reviewing accuracy and history. Users enter through shared navigation, optionally authenticate, then submit predictions and view their results through sport-specific and summary pages. The frontend also includes a Node backend and a SQLite database, but the backend source was not excerpted, so its connections to the UI are shown as unverified. The README describes localStorage persistence, while sampled prediction pages call an API; the exact persistence implementation could not be confirmed.
Main entry points: App.jsx App Router · api.js API Client · layouts Shared Layout · protectedroute.jsx Route Guard
Components 18
Application Shell
- App Router
src/App.jsx - Shared Layout
src/layouts - UI Components
src/components/ui
Authentication
- Auth State
src/context/AuthContext.jsx - Login
src/layouts/Login.jsx - Registration
src/layouts/SignUp.jsx - Route Guard
src/lib/protectedroute.jsx
Prediction Features
- Cricket Predictions
src/pages/Cricket.jsx - Football Predictions
src/pages/Football.jsx - Prediction History
src/pages/My_predictions.jsx - Accuracy Stats
src/pages/Stats.jsx - Leaderboard
src/pages/leaderboard.jsx - Home
src/pages/Home.jsx
Backend Services
- API Client
src/lib/api.js - Backend API
backend/backend.js - SQLite Database
predictions-app.db
Other components
- Visitor
- Browser Storage
Connections 23
- Visitor → App Router: opens
- App Router → Shared Layout: renders
src/App.jsx - App Router → Cricket Predictions: routes
src/App.jsx - App Router → Football Predictions: routes
src/App.jsx - App Router → Home: routes
src/App.jsx - App Router → Accuracy Stats: routes
src/App.jsx - App Router → Route Guard: protects
src/App.jsx - Route Guard → Prediction History: renders
src/App.jsx - Route Guard → Leaderboard: renders
src/App.jsx - App Router → UI Components: uses sidebar
src/App.jsx - Shared Layout → UI Components: uses components
src/layouts/AppSidebar.jsx - Shared Layout → Login: opens
src/layouts/AppHeader.jsx - Shared Layout → Registration: opens
src/layouts/AppHeader.jsx - Login → Auth State: sets session
src/layouts/Login.jsx - Registration → Auth State: sets session
src/layouts/SignUp.jsx - Route Guard → Auth State: checks session
src/lib/protectedroute.jsx - Auth State → Browser Storage: persists session
src/context/AuthContext.jsx - Cricket Predictions → API Client: fetches predictions
src/pages/Cricket.jsx - Football Predictions → API Client: fetches predictions
src/pages/Football.jsx - Prediction History → API Client: requests history
src/pages/My_predictions.jsx - Leaderboard → API Client: requests rankings
src/pages/leaderboard.jsx - API Client → Backend API: sends requests
- Backend API → SQLite Database: uses database