# FanaticAI — World Cup Rivalry Obsession Engine (Powered by Google Gemini)

> Source: <https://dev.to/samuelquansah/fanaticai-world-cup-rivalry-obsession-engine-powered-by-google-gemini-47oh>
> Published: 2026-07-10 18:56:35+00:00

*This is a submission for Weekend Challenge: Passion Edition*

I built **FanaticAI: World Cup Rivalry Obsession Engine**, a companion web application for devoted football (soccer) fans who want to measure their passion and simulate legendary matches.

The application offers two primary features:

`http://localhost:5173`

and connects to the FastAPI backend gateway running at `http://localhost:8888`

.*(See the docs/assets/ directory in our repository for screenshots of the dashboard UI and passion gauge in action).*

An interactive AI companion for devoted football fans to track sentiment, calculate fan passion index metrics, and simulate sports rivalries using the **Google Gemini API**.

Built for the **DEV Weekend Challenge: Passion Edition** (Best Use of Google AI Category).

`backend/`

`frontend/`

`docs/`

`dev_submission.md`

).The application is built using a modern full-stack developer architecture:

`google-generativeai`

) to connect to the `gemini-1.5-flash`

model.We instruct Gemini to output structured JSON data directly by passing a precise scoring template:

```
prompt = (
    f"Analyze the following sports fan rant text: '{rant}'. "
    f"Calculate a 'passion_score' representing how obsessed, devoted, and emotional the fan is on a scale from 0 to 100. "
    f"Also write a brief 1-sentence supportive response acknowledging their obsession. "
    f"Return ONLY a clean JSON object with keys: 'passion_score' (integer) and 'response_summary' (string)."
)
```

In the backend services, we configured `generation_config={"response_mime_type": "application/json"}`

to guarantee a clean, parseable JSON block returned to the React frontend.

To capture the real feeling of sports rivalries, we feed Gemini a commentator persona biased towards a specific team:

```
prompt = (
    f"You are a fanatical, obsessed football commentator who is highly devoted to {bias_team}. "
    f"Generate a brief, emotional, 3-sentence live commentary stream of a hypothetical match "
    f"between {team_a} and {team_b}. Your tone must show absolute passion, bias, and excitement!"
)
```


