Inspiration

Online discourse today is overly polarized, rewarding outrage and attention rather than genuine engagement. We wanted to build an educational platform that shifts the focus away from "winning" arguments at all costs, and instead creates a constructive, low-stakes space where people can share diverse viewpoints, explore underlying reasons, and foster mutual understanding.

What it does

Yaapi is a mobile-first, real-time debate arena. Users scroll through a "Start yaaping" feed of topic cards, pick a stance (Side A, Side B, or Either), and are instantly queued to pair with an opponent.
Casual Mode: A fast-paced, free-flowing chat for low-stakes topic exchanges. Competitive Mode: A structured debate scored in real-time by an AI referee, determining a winner based on engagement and reasoning.
Spectator Experience: A "View yaaps" feed allows users to spectate active and ended conversations, ranked by a personalized recommendation algorithm.

How we built it

Frontend: We built a Next.js 16 client that connects via WebSockets to subscribe to real-time database tables and call state reducers.
Backend & Core Engine: We eliminated the traditional REST API backend. The entire game state is powered by SpacetimeDB on Maincloud, acting as both our database and application server via TypeScript reducers compiled to WebAssembly.
AI Integration: Because SpacetimeDB reducers must be deterministic, we isolated our AI logic into a secure Next.js server route. This service identity pings the Gemini 3.8-Flash API to automatically tag new topics, summarize ended chats, and asynchronously score competitive batches.
Recommendations: The feed learns each user's preferences over time, without them having to set anything up.

  • Learning from behavior: Every action adds weight to the features of the topic involved: its category, its tags, its tone (fun or serious), and the people or things it mentions. The weights are: create +5, join +4, like +3, sign-up interest +2.5, message, open or read +1. Signals fade over time as score × 2^(−days/14), a 14-day half-life, so the profile follows what someone likes now.
  • Learning from what they skip: Topics a user scrolls past count slightly against them (−0.3 per showing), and showings they never act on count −1. The feed also pushes a topic down by 0.05 each time it's shown without engagement, up to three times, so stale topics stop reappearing.
  • Matching: A topic's affinity score is 0.4 × tag match + 0.6 × entity match. Specific interests like "Ariana Grande" count for more than broad ones like "music".
  • Ranking: score = 0.40 × affinity + 0.25 × popularity + 0.15 × freshness + 0.10 × social proof + 0.10 × matchmaking odds − penalty The feed is then diversified so no single category dominates. New topics are mixed in for exploration, and the order refreshes every 10 minutes. ## Challenges we ran into Deterministic Backend Constraints: SpacetimeDB reducers cannot use external networks or non-deterministic functions (like Date.now()). This meant we couldn't call the Gemini API directly from the database and had to architect a separate, secure AI upkeep route to write results back to the database. Preventing AI Manipulation: To stop players from using prompt injection or spamming verbosity to trick the AI judge, we implemented a secure service identity, strict rate limits (60 messages per hour), and server-enforced point caps. ## Accomplishments that we're proud of Successfully deploying a completely serverless, low-latency multiplayer architecture using SpacetimeDB. Engineering a transparent, multi-layered AI moderation panel that evaluates substantive clash and logical integrity rather than simply counting words. Designing a personalized recommendation engine that dynamically updates a user's feature affinities (categories, tags, entities) without requiring massive backend compute. ## What we learned Building yaapi taught us that a real-time app gets much simpler when the database is the backend. SpacetimeDB let us write the server logic in TypeScript, as reducers that run inside the database. Live updates came for free, but we had to learn its rules: logic must be deterministic, background jobs are scheduled as tables, and some schema changes require wiping the data.

We learned to treat AI as one layer rather than the authority. Gemini tags topics and scores comp debates, but the server enforces point caps and rate limits and decides the winner, so a fooled or spammed model can't break the game.

Designing the recommendation system taught us to balance personalization with exploration. A fixed list of tags plus AI-extracted names of people and things kept user taste profiles small but specific.

Finally, we practiced real collaboration: feature branches, pull requests, resolving merge conflicts, and deploying with Vercel and Maincloud.

What's next for Yaapi - The Casual Debate Arena

  • Extending the recommendation algorithm to search result ranking
  • Refining the Debate Coach
  • Implement monetization features. Publish our app onto mobile platforms.

Built With

Share this project:

Updates

Submission history