Inspiration

The 2026 World Cup is set to be the largest in history with 48 teams. As fans, we often find ourselves overwhelmed by stats but starving for stories. We were inspired to build a tool that doesn't just predict who will win, but explains why—using data to uncover the "Dark Horses" and "What-If" scenarios that make football the beautiful game.

What it does

PitchProphet is a comprehensive simulation dashboard that:

  • Runs 10,000+ Monte Carlo iterations to calculate tournament win probabilities.
  • Analyzes 150 years of international football matches (48,000+ results) to derive historical Elo ratings.
  • Provides AI-powered Data Stories for every team using Gemini 1.5 Flash.
  • Features an interactive "What-If" Scenario Builder to see how injuries or home advantage swing the odds.
  • Visualizes the entire tournament path with an interactive bracket.

How I built it

We built the application using a modern React stack optimized for performance and design:

  • Frontend: Vite + React + Vanilla CSS (Glassmorphism design system).
  • Simulation Engine: Custom JavaScript implementation of the Elo rating system and Monte Carlo methods: $$P(\text{Win}) = \frac{1}{1 + 10^{(R_B - R_A)/400}}$$ Where $R_A$ and $R_B$ are the Elo ratings of the competing teams.
  • AI Layer: Google Gemini 1.5 Flash for generating long-form reports and conversational analysis.
  • Data Pipeline: A custom Node.js ingestion script that processes raw historical CSVs into an optimized JSON dataset for client-side analytics.

Challenges I ran into

  • Data Normalization: Mapping 150 years of historical team names (e.g., "West Germany" vs "Germany") to the current 2026 FIFA rankings required a robust fuzzy-matching logic.
  • Client-Side Simulation: Running 10,000 tournament simulations in the browser without blocking the UI thread necessitated heavily optimized iterative loops.
  • The "White-on-White" Bug: We encountered tricky browser-specific styling for dropdown <option> elements in dark mode, which we solved with targeted global CSS resets.

Accomplishments that I'm proud of

  • 150-Year Insight: Integrating an external Kaggle dataset featuring every international match since 1872 to create a more accurate "Historical Weight" score.
  • Data Export: Implementing a client-side Markdown generator that allows users to download their AI-generated stories as professional reports.
  • Unified Design: Creating a premium, "living" dashboard that feels like a professional broadcasting suite.

What I learned

We learned the importance of "Data Storytelling" over raw "Data Reporting." Integrating an LLM like Gemini allowed us to bridge the gap between hard math (Elo/Monte Carlo) and human intuition. We also deepened our knowledge of React's state management for real-time filtering of large datasets.

What's next for PitchProphet

  • Live Data Integration: Connecting to real-time APIs during the 2026 qualification window to update form scores dynamically.
  • Predictive Betting Models: Incorporating odds-maker data to find value discrepancies.
  • Social Brackets: Allowing users to save and share their simulated brackets as custom "Pick'em" challenges.

Built With

Share this project:

Updates