Inspiration

The ongoing WC was the main inspiration. We wanted to give fans the power to step into the manager's shoes, build their dream XI using real-time player data, and see how their specific tactical choices not just overall ratings impact a match.

What it does

Either-Football-or-Soccer is an advanced AI-powered football squad builder and match simulation platform. It allows users to:

  • Scout Real Players: Search for live, real-world players and use Gemini AI to dynamically generate and enrich their tactical attributes (Pace, Passing, xG90, etc.) based on their current real-world form.
  • Build a Tactical Squad: Place players into specific formations (4-3-3, 3-5-2, etc.). The app calculates a dynamic chemistry score that heavily penalizes playing athletes out of their natural positions.
  • Simulate Matches: Users can play their custom squad against world-class opposition. The engine simulates a 90-minute match minute-by-minute, calculating stamina drain, expected goals (xG), and momentum.
  • Receive AI Coaching: After the match, the platform uses Explainable AI (SHAP values) to show exactly why a player performed well or poorly, and Gemini generates a realistic, dressing-room style post-match debrief.

How we built it

We built the platform using a modern, full-stack architecture:

  • Frontend: We used React 19 with TypeScript and Vite for a blazing-fast user interface, styled with Tailwind CSS and animated using Framer Motion.
  • Backend: We deployed a Node.js/Express server to handle secure API routing.
  • AI & Data: We integrated RapidAPI to fetch live football data and used the Google Gemini API for two critical features: generating predictive player attributes during the scouting phase, and writing the contextual post-match tactical debriefs.
  • Simulation Engine: We custom-built a mathematical match engine using Poisson distributions for shot probability and game theory (Shapley values) to calculate individual player ratings.

Challenges we ran into

The hardest part of the project was fine-tuning the simulation and player chemistry algorithms. We didn't want a team of 11 strikers to win just because their overall ratings were high. We spent hours developing a "Positional Coherence Matrix." This engine degrades specific player attributes if they are placed in the wrong slot (e.g., a center-back playing as a winger loses massive pace and crossing accuracy). Balancing this math so that the matches felt realistic, unpredictable, but statistically fair was incredibly challenging. Additionally, handling the asynchronous handoffs between the RapidAPI live search and the Gemini enrichment pipeline required careful error handling and fallback mock data.

Accomplishments that we're proud of

We are incredibly proud of the Explainable AI (XAI) SHAP Ratings dashboard. Instead of just giving a player a random "7.5/10" match rating at the end of the game, our engine breaks down the exact mathematical contributions to that score—showing the user exactly how much stamina decay, passing friction, or out-of-position penalties dragged their star player down. It makes the simulation feel incredibly transparent and rewarding.

What we learned

Learning how to make the deterministic math feed into the LLM prompt to create a cohesive narrative was a huge breakthrough for us.

What's next for Either-Football-or-Soccer

We plan to implement a global leaderboard and live matchmaking, allowing users to save their AI-enriched squads to a database and simulate matches head-to-head against other real players tactical setups in the cloud.

Built With

Share this project:

Updates

Submission history