<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Samuel K Quansah</title>
    <description>The latest articles on DEV Community by Samuel K Quansah (@samuelquansah).</description>
    <link>https://dev.to/samuelquansah</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4024418%2Fa0faea97-4599-42e8-b349-0617ae917c53.png</url>
      <title>DEV Community: Samuel K Quansah</title>
      <link>https://dev.to/samuelquansah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samuelquansah"/>
    <language>en</language>
    <item>
      <title>FanaticAI — World Cup Rivalry Obsession Engine (Powered by Google Gemini)</title>
      <dc:creator>Samuel K Quansah</dc:creator>
      <pubDate>Fri, 10 Jul 2026 18:56:35 +0000</pubDate>
      <link>https://dev.to/samuelquansah/fanaticai-world-cup-rivalry-obsession-engine-powered-by-google-gemini-47oh</link>
      <guid>https://dev.to/samuelquansah/fanaticai-world-cup-rivalry-obsession-engine-powered-by-google-gemini-47oh</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-07-09"&gt;Weekend Challenge: Passion Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

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

&lt;p&gt;The application offers two primary features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fan Rant Sentiment Analyzer&lt;/strong&gt;: Fans can type their raw, unedited, emotional rants about a match. The engine uses Google Gemini to analyze the text and output a &lt;strong&gt;Passion Index (0-100%)&lt;/strong&gt; alongside a custom supportive commentator response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rivalry Simulator Console&lt;/strong&gt;: Users can choose two legendary national teams (e.g. Brazil vs Argentina) and configure their commentator loyalty bias. Gemini then streams a highly biased, passionate, and audio-ready match commentary stream.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/samuelQUANSAH/fanatic-ai-world-cup-companion" rel="noopener noreferrer"&gt;samuelQUANSAH/fanatic-ai-world-cup-companion&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Run&lt;/strong&gt;: The frontend dev server runs at &lt;code&gt;http://localhost:5173&lt;/code&gt; and connects to the FastAPI backend gateway running at &lt;code&gt;http://localhost:8888&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;(See the &lt;code&gt;docs/assets/&lt;/code&gt; directory in our repository for screenshots of the dashboard UI and passion gauge in action).&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/samuelQUANSAH" rel="noopener noreferrer"&gt;
        samuelQUANSAH
      &lt;/a&gt; / &lt;a href="https://github.com/samuelQUANSAH/fanatic-ai-world-cup-companion" rel="noopener noreferrer"&gt;
        fanatic-ai-world-cup-companion
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      FanaticAI: World Cup Rivalry Obsession Engine — DEV Weekend Challenge: Passion Edition entry using Google Gemini API
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;FanaticAI — World Cup Rivalry Obsession Engine&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;An interactive AI companion for devoted football fans to track sentiment, calculate fan passion index metrics, and simulate sports rivalries using the &lt;strong&gt;Google Gemini API&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Built for the &lt;strong&gt;DEV Weekend Challenge: Passion Edition&lt;/strong&gt; (Best Use of Google AI Category).&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🚀 How It Works&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rant Analyzer&lt;/strong&gt;: Uses Gemini to evaluate sports rant inputs, compute a passion score (0-100), and generate supportive analyst summaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rivalry Simulator&lt;/strong&gt;: Simulates high-emotion commentary of matches with fan loyalty configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🛠️ Stack&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI Platform&lt;/strong&gt;: Google Gemini 1.5 Flash (google-generativeai SDK)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: FastAPI (Python), Uvicorn&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React, TS, Vite, Tailwind CSS v4, Framer Motion&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📂 Repository Layout&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;backend/&lt;/code&gt;&lt;/strong&gt;: FastAPI routers, schemas, and Gemini integration handlers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;frontend/&lt;/code&gt;&lt;/strong&gt;: Command Center dashboard with interactive sentiment gauges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;docs/&lt;/code&gt;&lt;/strong&gt;: Holds the DEV Community submission templates (&lt;code&gt;dev_submission.md&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;💻 Local Setup &amp;amp; Run&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Configure Environment (Backend)&lt;/h3&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/samuelQUANSAH/fanatic-ai-world-cup-companion" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The application is built using a modern full-stack developer architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend&lt;/strong&gt;: &lt;strong&gt;FastAPI&lt;/strong&gt; (Python) and &lt;strong&gt;Uvicorn&lt;/strong&gt; for fast asynchronous endpoints. We integrated the official &lt;strong&gt;Google Generative AI SDK&lt;/strong&gt; (&lt;code&gt;google-generativeai&lt;/code&gt;) to connect to the &lt;code&gt;gemini-1.5-flash&lt;/code&gt; model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: &lt;strong&gt;React&lt;/strong&gt;, &lt;strong&gt;Vite&lt;/strong&gt;, &lt;strong&gt;TypeScript&lt;/strong&gt;, &lt;strong&gt;Tailwind CSS v4&lt;/strong&gt;, and &lt;strong&gt;Framer Motion&lt;/strong&gt; for a premium, responsive, dark-mode neon dashboard.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🧠 Gemini Prompts &amp;amp; Integration
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Structured JSON Passion Score Estimation
&lt;/h4&gt;

&lt;p&gt;We instruct Gemini to output structured JSON data directly by passing a precise scoring template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Analyze the following sports fan rant text: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;rant&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Calculate a &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;passion_score&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; representing how obsessed, devoted, and emotional the fan is on a scale from 0 to 100. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Also write a brief 1-sentence supportive response acknowledging their obsession. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Return ONLY a clean JSON object with keys: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;passion_score&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; (integer) and &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;response_summary&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; (string).&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the backend services, we configured &lt;code&gt;generation_config={"response_mime_type": "application/json"}&lt;/code&gt; to guarantee a clean, parseable JSON block returned to the React frontend.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. PERSONA-Biased Commentary Generation
&lt;/h4&gt;

&lt;p&gt;To capture the real feeling of sports rivalries, we feed Gemini a commentator persona biased towards a specific team:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a fanatical, obsessed football commentator who is highly devoted to &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;bias_team&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Generate a brief, emotional, 3-sentence live commentary stream of a hypothetical match &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;between &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;team_a&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; and &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;team_b&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Your tone must show absolute passion, bias, and excitement!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Google AI&lt;/strong&gt;: The entire system logic is powered by &lt;strong&gt;Google Gemini 1.5 Flash&lt;/strong&gt; to perform structured sentiment scoring and persona-driven creative content generation.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>weekendchallenge</category>
      <category>googleai</category>
      <category>gemini</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
