DEV Community

Cover image for I Built a Real‑Time Academic Battle Platform at 14 — Here's How
PRIYANSHU SINGH
PRIYANSHU SINGH

Posted on

I Built a Real‑Time Academic Battle Platform at 14 — Here's How

Hey Dev.to community! 👋

I'm Priyanshu, a 14‑year‑old developer from India. For the past few months, I've been building Dheeyuddha — a platform where schools battle each other in real‑time academic wars. Think Clash of Clans meets education.

I wanted to share the journey, the tech stack, the failures, and what I've learned so far. Hopefully, this helps someone else building their first serious project.

🧠 The Idea
It started with a simple observation: learning apps are boring.

You answer questions, earn points, maybe keep a streak. But there's no real reason to come back except fear of losing that streak. I wanted to build something that felt like competition. Like pride. Like war.

So I asked: What if studying felt like a sport?

What if your school had a live scoreboard? What if you could challenge a rival school to a real‑time battle and watch the scores update as answers came in? What if winners could repost their victory screens to Instagram and flex on their friends?

That's how Dheeyuddha (धीयुद्ध — "War of Intellect") was born.

🏗️ The Tech Stack
I chose tools that would let me move fast and build real‑time features without managing servers.

Technology Why I Chose It
Next.js (App Router) React framework with SSR, API routes, and easy deployment
Supabase Auth, PostgreSQL database, and real‑time subscriptions out of the box
Tailwind CSS Rapid UI development without leaving my JSX
Framer Motion Smooth animations for the trailer and UI
Vercel One‑click deploys from GitHub
🔥 The Core Features

  1. Real‑Time School Wars Two schools enter a war room via invite code. Students solve teacher‑verified questions, and the scoreboard updates instantly using Supabase Realtime.
js
// Subscribe to war room updates
const warRoomSubscription = supabase
  .channel('war-room')
  .on(
    'postgres_changes',
    { event: 'UPDATE', schema: 'public', table: 'war_rooms', filter: `id=eq.${warId}` },
    (payload) => {
      // Update score display in real time
    }
  )
  .subscribe()
Enter fullscreen mode Exit fullscreen mode
  1. Fair Matchmaking (The "War Weight" Formula) Inspired by Clash of Clans, I designed a formula that calculates a team's strength so that opponents are fairly matched.
Team Weight = (Average Class × 100) + (Average Points × 0.1) – (Number of Distinct Classes × 5)
Class × 100 – Class level is the strongest factor

Points × 0.1 – Points fine‑tune strength (1000 points ≈ one class step)

Distinct Classes × –5 – Small penalty encourages class diversity (your war rule)
Enter fullscreen mode Exit fullscreen mode

If no match is found immediately, the search range expands over time — just like in Clash of Clans.

  1. Never See the Same Question Twice I track every question interaction in a separate table. When a student requests a new question, the query filters out any they've already seen.
sql
SELECT q.*
FROM questions q
WHERE q.class <= :user_class
  AND NOT EXISTS (
    SELECT 1 FROM user_question_interactions uqi
    WHERE uqi.question_id = q.id AND uqi.user_id = :user_id
  )
ORDER BY random()
LIMIT 1;
Enter fullscreen mode Exit fullscreen mode
  1. Repost Feature (Built‑In Virality) After a war ends, winners get a victory screen with one‑click sharing to Instagram/WhatsApp. This creates a viral loop: win → share → friends see → join → war again.

🎬 The Trailer — Coded, Not Edited
I wanted a cinematic trailer but didn't have video editing software. So I built it in React using Framer Motion.

The entire trailer is a single Next.js page with:

Animated steps (intro → sign in → dashboard → repost → challenge → match found → outro)

A fake cursor that moves and clicks automatically

Real‑time typing effects

A "Match Found" explosion with pulsing glows

📉 The Struggles (Because It Wasn't Easy)

  1. The Name Pivot
    Originally, I called it Manthan. Then I discovered multiple companies and a government platform already using that name. I had to rebrand everything — codebase, logo, pitch. That hurt. But I learned: check your name early.

  2. Reddit Bans
    Tried promoting on Reddit. Got multiple accounts banned. Learned the hard way about shadowbanning and IP flags. Now I'm focusing on LinkedIn, Twitter, and Dev.to.

  3. Loneliness
    Building alone at 14 is isolating. Most people my age don't understand why I spend nights coding. But I've learned that the work itself becomes the company.

  4. YouTube Algorithm
    My trailer got 20 views in 24 hours. It's easy to feel invisible. But I've learned that consistency beats virality. I'm posting more Shorts and improving hooks.

🧠 What I've Learned

  1. Ship Fast, Iterate Faster
    My first war system was over‑engineered. I spent weeks on auto‑matchmaking before realising I could launch with invite codes and add complexity later. Start simple.

  2. Database Indexes Matter
    Early on, queries were slow. Adding indexes on foreign keys and frequently queried columns made a huge difference.

`sql
CREATE INDEX idx_war_queue_weight ON war_queue (team_weight);
CREATE INDEX idx_user_interactions_user_question ON user_question_interactions(user_id, question_id);`
Enter fullscreen mode Exit fullscreen mode
  1. Community > Code
    I spent months coding in isolation. When I finally started posting on LinkedIn and engaging with founders, everything changed. Feedback, encouragement, even critique — all of it made the project better.

  2. Your Age Can Be an Advantage
    At first, I hid that I was 14. Now I lead with it. People root for young builders. They offer advice, mentorship, and opportunities. Don't hide what makes you different.

📊 Current Status
✅ Authentication (Supabase)

✅ War lobby with invite codes

✅ Real‑time score updates

✅ Question selection + opponent targeting

✅ Trailer (coded in React)

✅ Team weight formula designed

✅ Repost feature (win → share)

In progress:

🔄 Teacher verification flow

🔄 Auto‑matchmaking queue

🔄 Weekly reports + badges

🛣️ What's Next
Launch beta — I'm looking for students, teachers, and schools to test Dhiyuddha. If you're interested, drop a comment or DM me.

Improve matchmaking — Implement the expanding search range and fine‑tune the weight formula.

Monetization — Freemium model (Pro badges) and school tournament licenses.

Keep building in public — More posts, more transparency, more engagement.

💬 Questions for the Community
If you've made it this far, I'd love your honest feedback:

Does the stack (Next.js + Supabase) make sense for scaling real‑time features?

Any gotchas with Supabase Realtime at higher concurrency?

The gamification angle — is this actually useful or just another distraction?

What would you do differently if you were building this?

🔗 Links
Live beta: https://manthan-beta-c975.vercel.app/

Trailer: https://www.youtube.com/watch?v=cEzUVo3kE8I

GitHub: Not public yet (cleaning up), but happy to share specific code snippets

🙏 Final Thought
I don't know if Dheeyuddha will become big. But I do know this:

Every line of code taught me more than any textbook could. Every rejection taught me resilience. Every view — even 20 — taught me that someone, somewhere, saw what I built.

If you're a young developer reading this: build the thing. It won't be perfect. People might ignore it. But you'll come out the other side a different person.

Thanks for reading. Roast me, encourage me, or just say hi. I'm here for all of it.

nextjs #supabase #react #tailwindcss #realtime #edtech #buildinpublic #indianstartup #webdev

Top comments (1)

Collapse
 
priyanshu_singh_a546c21fc profile image
PRIYANSHU SINGH

make sure to comment your opinion.