DEV Community

Cover image for RIVAL β€” I Built an AI That Settles Any Rivalry… Out Loud πŸ”₯
Blackwatch
Blackwatch

Posted on

RIVAL β€” I Built an AI That Settles Any Rivalry… Out Loud πŸ”₯

DEV Weekend Challenge: Passion Edition Submission

This is a submission for Weekend Challenge: Passion Edition

What I Built

Remember being a kid and staging the ultimate showdowns in your head? Goku vs Naruto. Gohan vs Batman. Your dog vs the neighbour's cat. No rules, no logic β€” just pure "who would win?!" chaos with your friends until someone rage-quit.

RIVAL is me trying to bottle that feeling.

You type in any two rivals β€” real or fictional, living or non-living, serious or completely ridiculous β€” pick a tone, and smash the πŸ”₯ IGNITE button. RIVAL then:

  • writes a fiery, over-the-top hype monologue that trash-talks and celebrates both sides,
  • scouts each contender with πŸ’ͺ Powers and ⚠️ Weaknesses cards,
  • crowns a winner and drops a bold prediction,
  • rates the beef on a passion meter,
  • and β€” the best bit β€” reads the whole thing out loud like a dramatic sports commentator.

hero section with complete result

BarΓ§a vs Real Madrid, settled. (The AI sided with Madrid. I'm choosing not to comment.)

⚠️ Please don't take the verdicts to heart. It's a fun project, not a court ruling. I asked it to settle Batman vs a cat and… let's just say I'm still not over the result. πŸ₯²

That's the whole idea: pick two things, start a fight, enjoy the show.

Demo

πŸ”΄ Try it live: https://rivals-tau.vercel.app/

Watch it in action (turn the sound ON β€” the voice is the whole point):

And here's the setup β€” two rivals, six quick presets, five tones, one big red button:

herosection

Code

GitHub logo BlackWatch021 / Rivals

My submission for dev.to weekend challenge

πŸ”₯ RIVAL

Settle the rivalry.

Pick any two rivals β€” real or fictional, living or non-living, serious or completely ridiculous. RIVAL writes fiery trash-talk, scouts each side's powers & weaknesses, crowns a winner, and then reads the whole thing out loud like a dramatic sports commentator.

Next.js TypeScript Tailwind CSS Google Gemini ElevenLabs Vercel

πŸ”΄ Live Demo Β· πŸ“– Read the story Β· 🎬 Watch the demo

RIVAL settling BarΓ§a vs Real Madrid β€” monologue, passion meter, and powers/weaknesses cards

✨ What it does

  • πŸ₯Š Any matchup β€” Goku vs Naruto, iOS vs Android, Cats vs Dogs, Coffee vs Tea… if you can name two things, you can pit them.
  • ✍️ Fiery AI monologue that trash-talks and hypes both sides.
  • πŸ’ͺ Scouting cards β€” Powers & Weaknesses for each contender.
  • πŸ† A winner + a bold prediction, plus a passion meter for the beef.
  • πŸŽ™οΈ Dramatic spoken commentary β€” the verdict, read aloud.
  • 🎭 Five tones β€” Hype, Savage, Sarcastic, Professional, Wholesome.
  • ⚑ Six…

How I Built It

The plan sounded easy: "call two AI APIs, done by lunch." Reader, it was not done by lunch. Here's the fun of it.

🧱 The stack

Next.js (App Router) + TypeScript + Tailwind, deployed on Vercel. Two tiny server-side Route Handlers do all the secret-key work β€” /api/generate for the text and /api/voice for the audio β€” so my API keys never touch the browser. The frontend only ever talks to my server, and my server talks to the AIs. No key ever ships to the client.

🧠 The brain β€” Google Gemini

Gemini does all the writing: the monologue, a shorter spoken version, the powers/weaknesses for each side, the winner, the prediction, and a passion score β€” all returned as clean JSON, and all steered by whichever tone you picked (Hype, Savage, Sarcastic, Professional, Wholesome).

scouting cards power weakness

Cats vs Dogs. "Silent assassins" vs "Separation anxiety." Chef's kiss.

My first attempts kept returning cut-off, broken JSON, and it drove me up the wall. Turns out the model I'm on is a thinking model β€” it was quietly burning its entire token budget "thinking" and running out of room mid-sentence. The fix was to tell it to stop overthinking and just answer:

generationConfig: {
  responseMimeType: "application/json",
  thinkingConfig: { thinkingBudget: 0 }, // stop pondering, just reply
}
Enter fullscreen mode Exit fullscreen mode

Sometimes the AI just needs to be told to shut up and hand over the goods.

πŸ”Š The voice β€” ElevenLabs

This is the "wow." ElevenLabs takes the text and reads it back in a dramatic broadcaster voice. I feed it a tight, ~40-second spoken version instead of the full monologue, so it lands like a punchy highlight reel instead of a two-minute TED talk.

audio player

Gotcha I learned the hard way: on the free tier you can't use ElevenLabs' fancy "library" voices through the API β€” it throws a payment error right in your face. Swapping to a built-in premade voice ("Daniel", a steady broadcaster) fixed it and honestly suits a commentator better anyway.

πŸ’Έ Surviving the free tier (a.k.a. the real project)

Here's the twist nobody warns you about: I'm on the free tier of both AIs, and that quietly became the most interesting engineering constraint of the whole build.

  • Gemini gives me roughly 20 requests a day. ElevenLabs gives about 10,000 characters a month β€” that's ~5 full monologues. Not a lot once strangers on the internet start hammering IGNITE.
  • So that short spoken version isn't just nicer to listen to β€” it's about 4Γ— cheaper on characters (β‰ˆ2,000 β†’ β‰ˆ340 per go).
  • The six preset matchups are pre-generated (text and audio) and served as static files. Clicking a preset costs zero API calls β€” instant, free, and infinitely replayable. That's the guaranteed-to-work demo path.
  • And when a quota does run dry, you don't get a scary red error β€” you get a cheeky popup, and the app gently nudges you toward a preset instead. Failing with a smile beats failing with a stack trace.

quotapopup

The most polite "I'm broke, please try a free one" message I could write.

Prize Categories

  • Best Use of Google AI β€” Gemini writes every word: the trash-talk, the scouting report, the verdict, and the prediction, tuned to whatever tone you pick.
  • Best Use of ElevenLabs β€” it turns all of that into dramatic, spoken-word commentary that plays right on the page.

Built solo, over one caffeine-heavy weekend. πŸ”₯

I had a whole list of features I didn't get to (I started late β€” classic), so if RIVAL made you smile and you'd like to see it grow, drop a comment with your dream matchup or the feature you'd add β€” I'm reading every single one.

Now go settle something ridiculous. Batman deserves a rematch. πŸ¦‡πŸ±

Top comments (0)