A modern web application for predicting NC State sports game winners with live statistics, leaderboards, and championship recognition. Made in 1 hour during SOE Coding Hackathon so no real backend.
- ๐ Daily Sports Schedule: View all NC State sports scheduled for today
- ๐ฒ Smart Predictions: Pick winners based on team win percentages and stats
- ๐พ Local Storage: Predictions saved automatically in browser storage
- ๐ One-Click Toggle: Click team buttons to predict, click again to deselect
- ๐ฑ Responsive Design: Optimized for mobile, tablet, and desktop
- ๐ Champion Recognition: Special Pack Madness Champ showcase for #1 player
- ๐ Accuracy Rankings: Users ranked by prediction success rate
- ๐ Detailed Stats: Win/loss records, accuracy percentages, progress bars
- ๐ค User Identification: Highlight current user in leaderboard
- ๐จ Visual Hierarchy: Gold, silver, bronze styling for top performers
- ๐ Dark/Light Theme: Toggle between themes with system detection
- ๐ Toast Notifications: Success feedback for all prediction actions
- ๐ฏ Prediction Drawer: View and manage all current selections
- โฟ Accessibility: Full keyboard navigation and screen reader support
- ๐ Statistics Overview: Total players, average accuracy, best scores
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/johnny0595/hackathonSOEWinner.git
cd soehackathon
# Install dependencies
npm install
# Start development server
npm run devVisit http://localhost:3001 to view the application.
npm run dev # Start development server with Turbopack
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLintsrc/
โโโ app/ # Next.js App Router pages
โ โโโ page.tsx # Main predictions interface
โ โโโ leaderboard/ # Leaderboard page
โ โโโ layout.tsx # Root layout with providers
โ โโโ globals.css # Global styles and Tailwind
โโโ components/ # Reusable UI components
โ โโโ ui/ # shadcn/ui base components
โ โโโ sports-header.tsx # Sports selection navigation
โ โโโ game-card.tsx # Individual game prediction card
โ โโโ games-list.tsx # List of games for selected sport
โ โโโ leaderboard.tsx # Main leaderboard component
โ โโโ leaderboard-card.tsx # Individual user ranking card
โ โโโ prediction-sidebar.tsx # Current selections drawer
โ โโโ submit-button.tsx # Predictions submission
โ โโโ theme-toggle.tsx # Dark/light theme switcher
โโโ hooks/ # Custom React hooks
โ โโโ use-sports.ts # Sports data fetching
โ โโโ use-games.ts # Games data fetching
โ โโโ use-predictions.ts # Predictions management
โโโ services/ # Business logic and external services
โ โโโ predictions-storage.ts # LocalStorage operations
โโโ data/ # Mock data and providers
โ โโโ mock-provider.ts # Mock API implementation
โ โโโ http-provider.ts # Real API stub
โ โโโ data-provider.ts # Provider factory
โ โโโ mock-predictions.ts # Sample predictions
โ โโโ mock-leaderboard.ts # Sample leaderboard data
โโโ types/ # TypeScript type definitions
โ โโโ index.ts # All app interfaces
โโโ lib/ # Utility functions
โ โโโ utils.ts # General utilities
โ โโโ date-utils.ts # Date formatting helpers
โโโ providers/ # React context providers
โโโ query-provider.tsx # React Query setup
โโโ theme-provider.tsx # Theme management
The application uses an abstracted data provider pattern:
- MockProvider: Local JSON files for development/demo
- HttpProvider: Real API integration (configurable via environment variables)
- React Query: Caching and synchronization
- React Query: Server state and caching
- LocalStorage: Predictions persistence
- React Context: Theme and global providers
- Local State: Component-specific state
- shadcn/ui: Base component library
- Tailwind CSS: Utility-first styling
- Lucide React: Consistent iconography
- CSS Variables: Dynamic theming
- Select Sport: Click sport tabs in the header to filter games
- Pick Winners: Click team buttons to predict winners
- Change Mind: Click the same team again to remove prediction
- View Selections: Click "Predictions" button (shows count badge)
- Submit: Use bottom submit button to save all predictions
- View Rankings: Click "Leaderboard" in header navigation
- Champion Recognition: Top player gets Pack Madness Champ showcase
- Track Progress: See accuracy percentages and win/loss records
- Find Yourself: Current user is highlighted with "You" badge
# Enable real API (default: false, uses mock data)
NEXT_PUBLIC_USE_API=true
# API base URL (default: http://localhost:3001)
NEXT_PUBLIC_API_BASE_URL=https://your-api.comEdit files in /src/data/ to customize:
mock-predictions.ts: Pre-loaded predictionsmock-leaderboard.ts: User rankings and statspublic/mock/: Sports and games JSON files
GET /sports?date=YYYY-MM-DD // Available sports for date
GET /games?sport={id}&date=YYYY-MM-DD // Games for sport/date
GET /games/{gameId} // Individual game details
POST /predictions // Submit user predictionsSee /src/types/index.ts for complete TypeScript interfaces.
Framework configured for:
- Vitest: Unit testing
- React Testing Library: Component testing
- ESLint: Code quality
- TypeScript: Type checking
- Colors: Edit CSS variables in
globals.css - Components: Customize shadcn/ui components
- Layout: Modify responsive breakpoints in Tailwind config
- Add new sports to
mock-provider.ts - Update team logos and branding
- Modify win percentage calculations
- Add new game statistics
- Customize ranking algorithms
- Add achievement badges
- Modify champion rewards
- Update user avatar system
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
Go Pack! ๐บ Built with โค๏ธ for NC State Sports fans.