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.
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:
Code
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.
π΄ Live Demo Β· π Read the story Β· π¬ Watch the demo
β¨ 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).
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
}
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.
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.
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)