A comprehensive web-based game leaderboard and event management system designed for the CPE (Computer Engineering) Fair, featuring an immersive Genshin Impact theme with stunning visuals and interactive elements.
- Project Overview
- Features
- Technologies Used
- Installation
- Environment Variables
- Running the Application
- Project Structure
- API Documentation
- Usage
- Contributing
- License
- Acknowledgments
The CPE Fair Web Application is a full-stack event management platform built to streamline game competitions, track team scores, and display real-time leaderboards. Designed with a captivating Genshin Impact aesthetic, the platform brings together seven nations (teams) competing across various game categories.
- Manage competitive gaming events with multiple teams
- Track scores across different game categories (Sports, Esports, Brain Games, Mini Games, etc.)
- Display live leaderboards with podium rankings
- Provide an admin dashboard for managing games, players, teams, and scores
- Export comprehensive score reports to Excel
- Real-time Leaderboards: View overall standings and category-specific rankings
- Team Management: Seven Genshin Impact-themed teams (Fontaine, Inazuma, Liyue, Mondstadt, Natlan, Sumeru, Snezhnaya)
- Score Tracking: Log individual and group game scores with detailed participant information
- Admin Panel: Complete CRUD operations for games, players, teams, and scores
- Data Export: Generate Excel reports with master score ledgers
-
Interactive Leaderboards
- Overall standings with podium display for top 3 teams
- Category-specific leaderboards (Sports, Esports, Brain Games, Mini Games)
- Individual game rankings with team-based scoring
- Conditional rendering: displays all teams even with 0 points
-
Genshin Impact Theme
- Seven nation-themed backgrounds (Fontaine, Inazuma, Liyue, Mondstadt, Natlan, Sumeru, Snezhnaya)
- Animated starry backgrounds and golden border designs
- Gradient text effects and hover animations
- Nation-specific color schemes and visual effects
-
Game Schedule Viewer
- View game schedules by category
- Interactive game cards with bracketing and schedule information
- Comprehensive Dashboard
- Overview statistics (total games, players, teams, scores)
- Real-time data visualization
- Game Management
- Create, edit, and delete games
- Set game categories and group/solo modes
- Quick score entry directly from game cards
- Player Registry
- Add and edit player information (name, CYS, team affiliation)
- Filter and search players by team
- Bulk player management
- Score Management
- Log scores for individual or group games
- Edit and delete score entries
- View scores by game or team
- Contributor tracking
- Team Management
- Configure team sections and representatives
- View team-specific statistics
- Settings & Configuration
- Admin authentication with secret key
- Export master score ledger to Excel
- System configuration options
- Full-stack TypeScript implementation
- Server-side rendering with Next.js
- RESTful API architecture
- Real-time data synchronization with TanStack Query
- Responsive design (mobile, tablet, desktop)
- PostgreSQL database with Supabase
- Authentication middleware for admin routes
- Optimistic UI updates
- Excel export functionality with ExcelJS
- Comprehensive error handling and logging
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 16.0.7 | React framework with SSR and routing |
| React | 19.2.1 | UI library |
| TypeScript | 5.x | Type-safe development |
| TanStack Query | 5.90.11 | Server state management and caching |
| TanStack Table | 8.21.3 | Advanced table functionality |
| Tailwind CSS | 4.x | Utility-first CSS framework |
| Radix UI | - | Accessible component primitives |
| Axios | 1.13.2 | HTTP client |
| Lucide React | 0.555.0 | Icon library |
| date-fns | 4.1.0 | Date manipulation |
| xlsx | 0.18.5 | Excel file generation |
| react-toastify | 11.0.5 | Toast notifications |
| Technology | Version | Purpose |
|---|---|---|
| Express.js | 5.1.0 | Web framework |
| TypeScript | 5.9.3 | Type-safe development |
| Supabase | 2.81.1 | PostgreSQL database and backend services |
| Winston | 3.18.3 | Logging library |
| ExcelJS | 4.4.0 | Excel file generation |
| CORS | 2.8.5 | Cross-origin resource sharing |
| dotenv | 17.2.3 | Environment variable management |
- tsx - TypeScript execution for development
- ESLint - Code linting
- Babel React Compiler - Optimized React compilation
Before you begin, ensure you have the following installed:
- Node.js (v18.x or higher) - Download
- npm or yarn - Package manager
- Git - Version control
- Supabase Account - Sign up for database services
git clone https://github.com/geraldsberongoy/cpe_fair_web.git
cd cpe_fair_webcd backend
npm installcd ../frontend
npm installCreate a .env file in the backend directory:
# Supabase Configuration
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Admin Authentication
ADMIN_SECRET=your_admin_secret_key
# Server Configuration
PORT=3001
NODE_ENV=developmentHow to get Supabase credentials:
- Go to Supabase Dashboard
- Select your project
- Navigate to Settings → API
- Copy the Project URL (SUPABASE_URL)
- Copy the service_role key (SUPABASE_SERVICE_ROLE_KEY)
Create a .env.local file in the frontend directory:
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:3001/apiFor production, update the API URL to your deployed backend URL.
cd backend
npm run devThe backend will run on http://localhost:3001
Open a new terminal:
cd frontend
npm run devThe frontend will run on http://localhost:3000
cd backend
npm run build
npm startcd frontend
npm run build
npm startcpe-fair/
├── backend/
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ │ ├── auth.controller.ts
│ │ │ ├── game.controller.ts
│ │ │ ├── player.controller.ts
│ │ │ ├── score.controller.ts
│ │ │ └── team.controller.ts
│ │ ├── lib/ # External service integrations
│ │ │ └── supabaseClient.ts
│ │ ├── middlewares/ # Authentication & validation
│ │ │ └── auth.ts
│ │ ├── routes/ # API route definitions
│ │ │ ├── auth.routes.ts
│ │ │ ├── game.routes.ts
│ │ │ ├── player.routes.ts
│ │ │ ├── score.routes.ts
│ │ │ └── team.routes.ts
│ │ ├── types/ # TypeScript type definitions
│ │ │ ├── game.ts
│ │ │ ├── player.ts
│ │ │ ├── score.ts
│ │ │ └── team.ts
│ │ ├── utils/ # Utility functions
│ │ │ └── logger.ts
│ │ └── index.ts # Express server setup
│ ├── package.json
│ └── tsconfig.json
│
├── frontend/
│ ├── src/
│ │ ├── app/ # Next.js app router
│ │ │ ├── admin/ # Admin panel pages
│ │ │ │ ├── games/
│ │ │ │ ├── overview/
│ │ │ │ ├── registry/
│ │ │ │ └── settings/
│ │ │ ├── schedule/ # Game schedule views
│ │ │ ├── page.tsx # Landing page
│ │ │ └── layout.tsx
│ │ ├── components/ # React components
│ │ │ ├── admin/ # Admin-specific components
│ │ │ │ ├── GameCard.tsx
│ │ │ │ ├── GameModal.tsx
│ │ │ │ ├── QuickScoreModal.tsx
│ │ │ │ ├── player/
│ │ │ │ └── score/
│ │ │ ├── landing/ # Public-facing components
│ │ │ │ ├── leaderboard.tsx
│ │ │ │ ├── Podium.tsx
│ │ │ │ ├── CategoriesBar.tsx
│ │ │ │ └── BorderDesign.tsx
│ │ │ ├── ui/ # Reusable UI components
│ │ │ └── StarryBackground.jsx
│ │ ├── hooks/ # Custom React hooks
│ │ │ ├── useGame.ts
│ │ │ ├── usePlayer.ts
│ │ │ ├── useScore.ts
│ │ │ └── useTeams.ts
│ │ ├── services/ # API service layers
│ │ │ ├── api.ts
│ │ │ ├── auth.service.ts
│ │ │ ├── game.service.ts
│ │ │ ├── player.service.ts
│ │ │ ├── score.service.ts
│ │ │ └── team.service.ts
│ │ ├── types/ # TypeScript interfaces
│ │ ├── assets/ # Images and fonts
│ │ │ └── images/
│ │ │ └── backgrounds/ # Genshin Impact nation themes
│ │ └── lib/ # Utility functions
│ ├── public/ # Static assets
│ ├── package.json
│ └── next.config.ts
│
├── docs/ # Documentation
│ └── backend_api.md # API reference
├── management/ # Project management files
└── README.md # This file
Detailed API documentation is available in docs/backend_api.md.
Base URL: http://localhost:3001/api
GET /game- List all gamesGET /player- List all playersGET /team- List all teamsGET /score- List all scoresGET /score/section_team- Get aggregated team scores
POST /game- Create gamePUT /game/:id- Update gameDELETE /game/:id- Delete gamePOST /player- Create playerPOST /score- Log scorePUT /score/:id- Update scoreDELETE /score/:id- Delete score
?category=Sports- Filter by game category?includeMiniGames=true- Include Mini Games in overall rankings (default: false)?sortBy=points- Sort scores by field
- Open your browser and navigate to
http://localhost:3000 - Browse the leaderboards - View overall standings and category-specific rankings
- Explore game schedules - Check game timings and brackets
- View team details - Click on team cards to see detailed score breakdowns
- Navigate to
http://localhost:3000/admin - Enter the admin secret key (configured in
.env) - Access the dashboard to manage:
- Games: Create, edit, and delete games with quick score entry
- Players: Manage player registry and team assignments
- Scores: Log, edit, and delete score entries
- Settings: Export data and configure system settings
- Go to Admin → Games
- Click "Add New Game" to create a game
- Fill in game details (name, category, group/solo mode)
- Use the "Add Score" button for quick score entry
- Edit or delete games as needed
Method 1: Quick Score Entry (from Games page)
- Go to Admin → Games
- Click the "Add Score" button on any game card
- Select team/player and enter score details
Method 2: Score Management Page
- Go to Admin → Manage Scores
- Click "Log New Score"
- Select game, team/player, and enter points
- For group games, add multiple participants
- Go to Admin → Settings
- Click "Export Master Score Ledger"
- Excel file will be downloaded with complete score data
- Overall: View all teams ranked by total points (Mini Games excluded by default)
- Categories: Filter by Sports, Esports, Brain Games, or Mini Games
- Individual Games: Click on any game to see team rankings for that specific game
- Team Details: Click on team cards to view detailed score breakdowns and participants
We welcome contributions to the CPE Fair Web Application! Here's how you can help:
- Check if the issue already exists in GitHub Issues
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
- Environment details (OS, browser, Node version)
- Fork the repository
- Create a feature branch
git checkout -b feat/your-feature-name
- Make your changes
- Follow existing code style
- Add TypeScript types
- Update documentation if needed
- Test thoroughly
- Test in development mode
- Check for console errors
- Verify responsive design
- Commit your changes
git commit -m "feat: add new feature description" - Push to your fork
git push origin feat/your-feature-name
- Open a Pull Request
- Provide clear description of changes
- Reference related issues
- Include screenshots for UI changes
- Use TypeScript for type safety
- Follow existing naming conventions
- Write meaningful commit messages (conventional commits)
- Keep components modular and reusable
- Add comments for complex logic
- Test on multiple screen sizes
- Ensure accessibility standards
- Frontend: Follow Next.js and React best practices
- Backend: Use Express.js conventions
- Formatting: Run
npm run lintbefore committing - Types: Always define TypeScript interfaces
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 CPE Fair Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This project proudly features the Genshin Impact theme, drawing inspiration from the beloved game by miHoYo/HoYoverse. We acknowledge and respect their original creative work:
- Visual Aesthetics: The seven nation themes (Fontaine, Inazuma, Liyue, Mondstadt, Natlan, Sumeru, Snezhnaya) are inspired by Genshin Impact's world design
- Color Schemes: Golden accents, nation-specific color palettes, and gradient effects
- Background Imagery: Nation-themed backgrounds that capture the essence of each region
- UI Elements: Ornamental borders, starry effects, and elegant typography inspired by the game's visual language
Disclaimer: This project is a fan-made application for educational and event management purposes. It is not officially affiliated with, endorsed by, or connected to miHoYo/HoYoverse or Genshin Impact. All Genshin Impact-related imagery, themes, and references are the property of their respective owners.
- Next.js Team - For the amazing React framework
- Vercel - For Next.js development and deployment tools
- Supabase Team - For the excellent PostgreSQL database platform
- TanStack - For React Query and Table libraries
- Radix UI - For accessible component primitives
- Tailwind CSS Team - For the utility-first CSS framework
- Lucide - For the beautiful icon library
- CPE Fair Organizing Team - For the opportunity to build this platform
- Open Source Community - For the incredible tools and libraries that made this project possible
- Beta Testers - For valuable feedback during development
- All contributors who have helped improve this project
- The React and TypeScript communities for excellent documentation
- Stack Overflow community for troubleshooting assistance
- GitHub for hosting and version control services
- Repository: github.com/geraldsberongoy/cpe_fair_web
- Issues: Submit an issue
- Discussions: Join the discussion
Built with ❤️ by the CPE Fair Development Team
Powered by Genshin Impact's timeless aesthetics