π World Cup 2026 Tracking Application
Author: Kenneth Kinyanjui (Product Manager)
π― Product Vision & Mission
Our mission is to build the definitive real-time companion for the 2026 FIFA World Cup, delivering sub-second match updates, personalized team tracking, and curated media highlights to millions of fans globally. By combining a zero-trust architecture with a blazing-fast user interface, we ensure that fans stay closer to the action than ever beforeβreliably, securely, and beautifully.
π Core Success Metrics (KPIs)
- Performance: Under-2-second Initial Page Load (LCP) even under peak load.
- Reliability: 99.99% uptime during active tournament hours.
- Latency: Backend p95 latency under 500ms.
- Engagement: Curated video highlights integrated to increase time-on-page by 25%.
π Live Deployment: https://worldcup26-ioextended.web.app π Documentation: https://kenju254.github.io/worldcup-yami/
β¨ Key Features
- π Daily Schedule: Real-time updates on upcoming matches, group alignments, and kick-off countdowns.
- π Match Results: Instant access to final scores, goal scorers, and head-to-head metrics.
- π Team Follower: Personalized tracking for favorite nations. Enter your country (e.g., "USA" or "Argentina") to pin their specific telemetry and upcoming matches to your dashboard.
- πΊ Highlights Carousel: Curated video highlights sourced directly via YouTube API to rewatch defining tournament moments.
- π Dynamic Theming: Smooth transitions between Light and Dark mode options matching user preferences.
ποΈ Architecture at a Glance
The application is architected around a secure, serverless Zero Trust model to prevent API key leakage and scrape attacks.
graph TD
User([User Browser]) -->|HTTPS| FH[Firebase Hosting]
FH -->|Next.js Server Side Rendering| Next[Next.js App Server]
subgraph Secure Cloud VPC
Next -->|Internal OIDC Request / OIDC identity token| Proxy[OIDC Identity Proxy]
Proxy -->|Authorized HTTPS| Functions[Firebase Functions / Cloud Run - Python Flask]
end
subgraph External Data Layer
Functions -->|API Key Auth| APISports[API-Sports Football API]
Functions -->|API Key Auth| YouTube[YouTube Data API v3]
end
π οΈ Tech Stack
| Layer | Technology | Reason for Selection |
|---|---|---|
| Frontend Framework | Next.js 16 (React 19) | Server components enable fast server-side rendering and keep secrets out of client bundle. |
| Styling | Vanilla CSS (Modern CSS Custom Props) | Total control over typography, layouts, and fast execution without framework build overhead. |
| Backend Gateway | Flask (Python 3.10) | Lightweight, easy to route, standard for quick microservices. |
| Serverless Runtime | Firebase Cloud Functions (Gen 2 / Cloud Run) | Scalable backend execution with auto-scaling to zero to save budget, and scales up to 10 instances to handle match peaks. |
| Security Layer | Google Auth Library (OIDC Token) | Restricts backend functions only to authenticated frontend requests, preventing public scraping and billing exploitation. |
π Getting Started
Prerequisites
- Node.js: v18.0.0 or higher
- Python: v3.10.0 or higher
- Firebase CLI: Globally installed (
npm install -g firebase-tools)
1. Project Setup & Frontend Installation
Clone the repository and install dependencies:
npm install
2. Backend Setup
Navigate to the functions directory and set up a Python virtual environment:
cd functions
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
3. Environment Configuration
Create environment files using the templates provided:
# In the functions/ directory, create a .env file:
cp .env.example .env
# Configure the credentials in functions/.env:
# FOOTBALL_API_KEY=your_key
# YOUTUBE_API_KEY=your_key
# CURRENT_SEASON=2022
4. Running the Application Locally
To start the developer environment:
-
Frontend Server:
bash npm run devThe application will be available at http://localhost:3000. -
Backend Emulators / Server: You can run Firebase emulators to test functions:
bash firebase emulators:startOr run Flask locally directly for rapid development:bash source functions/venv/bin/activate python functions/main.py
π Project Structure
worldcup-yami/
βββ .github/workflows/ # CI/CD pipelines (CI validation & CD Auto-deploy)
βββ .husky/ # Git hooks (pre-commit lint, pre-push test runner)
βββ functions/ # Backend Python/Flask Microservice (Firebase Functions)
β βββ .env.example # Example backend secrets
β βββ main.py # Main Flask application entrypoint & API endpoints
β βββ requirements.txt # Python production dependencies
β βββ requirements-dev.txt # Python developer & testing packages
βββ public/ # Static assets and icons
βββ src/
β βββ app/ # Next.js App Router pages, layouts, and API proxy routes
β β βββ layout.tsx # Global root HTML wrapper
β β βββ page.tsx # Dashboard landing page container
β β βββ api/team/[id]/ # Client-to-Backend Next.js authentication proxy
β βββ components/ # Reusable React components (Schedule, Results, Carousel)
β β βββ ThemeProvider.tsx# Client theme switching context
β βββ utils/
β βββ api.ts # Compute-aware OIDC fetching helper
βββ firebase.json # Firebase configuration rules
βββ package.json # Frontend project manifest
πΊοΈ Product Roadmap
- v1.0 (Current): Live match dashboard, daily schedules, team follower, video highlights, and theme selection.
- v1.1 (Targeted): Full CI/CD integration, automated test suites (Jest/Pytest), input sanitization, and response caching.
- v1.2 (Planned): Live match countdown timers, match event timeline logs, and accessible navigation.
- v2.0 (Future): Real-time web sockets for goal notifications, user accounts with cross-device favorited teams, and multi-language support (English, Spanish, French).
π€ Contributing Guidelines
We welcome contributions to make this project the best it can be!
1. Fork the repository and create a new feature branch (git checkout -b feature/amazing-feature).
2. Ensure your code passes all lint checks (npm run lint) and python lint (flake8).
3. Write tests for any new features or bug fixes.
4. Commit your changes following conventional commits standards.
5. Push to your branch and submit a Pull Request to the main branch.
π License
This project is licensed under the MIT License. See LICENSE for details.