Inspiration

I built Code Arena out of my own experience struggling to run and join fair coding contests in college.

Most existing judges felt either too generic or too rigid for how our college actually works. Streams (departments), time windows, cheating concerns, and practice after contests weren’t handled in a way that made sense on campus. I wanted a single place where:

  • contests could be stream‑wise and fair,
  • practice could be open to everyone afterwards, and
  • admins could actually see what was going on.

Code Arena is my attempt to give my college its own competitive programming arena instead of bending other platforms to fit us.


What it does

Code Arena is a college‑focused competitive programming platform that:

  • Runs stream‑based contests

Students are auto‑grouped into 3 streams based on department (Core, Electrical, and CS/IT). Live contests can be restricted to a stream or opened to all.

  • Uses ICPC‑style scoring with a fairness tweak

Each student’s total time is based on when they actually start working and when they finish, plus a penalty for tab switching:

[ \text{Total Time} = (\text{finish time} - \text{start time}) \;+\; 20 \text{ minutes} \times \text{(tab switches)} ]

The leaderboard sorts by score first, then by this total time.

  • Unlocks practice mode after contests

Once a contest ends, its problems appear in a global Problem Bank. Anyone can solve them there, without stream restrictions and without affecting contest rankings.

  • Keeps a permanent practice bank

I’ve pre‑loaded the platform with 100+ LeetCode‑style problems that are always available for practice, even when no contest is running. This lets students treat Code Arena as both an arena and a daily practice site.

  • Includes basic proctoring

During contests, the code editor watches for tab switches. Students get visible warnings, and after too many switches they’re blocked from submitting. Admins can later see tab‑switch counts and run counts per user, while students just see their final rank and time.

  • Gives admins a personalized dashboard

Admins get a focused view of all contests: scheduled, live, and archived, grouped by stream with quick links to view results, manage problems, or delete contests. It’s designed for how college coordinators actually work day‑to‑day.


How we built it

I kept the stack fairly standard, but focused on making the rules correct:

  • Frontend: Next.js (App Router), TypeScript, Tailwind CSS
  • Backend & DB: Supabase (PostgreSQL, Auth, Realtime, RLS)
  • Judging: Judge0 CE to compile and run C/C++/Java/Python against hidden test cases
  • Realtime: Supabase Realtime + Next.js server actions for live leaderboards and profile stats

Streams are derived from the user’s department and enforced on the server in submission actions, not just in the UI. Row Level Security is used so students only touch their own data, while admins get the bigger picture.


Challenges we ran into

Even though I built this solo, there were a few tricky parts:

  • Stream logic everywhere

Once the stream mapping changed (e.g., Core vs Electrical vs CS/IT), I had to update it across:

  • the host form,
  • stream filters,
  • backend checks, and
  • admin views,

without breaking existing contests.

  • Fair time calculation

Deciding what “start time” means for a user sounds simple, but I had to choose between contest start, first page visit, or first submission. Then I layered tab‑switch penalties on top. Getting to a formula that felt fair took a few iterations.

  • RLS vs analytics

At one point, admin leaderboards weren’t seeing tab‑switch data because RLS only allowed each user to read their own monitoring row. The UI looked fine, but the numbers were wrong. Fixing this meant redesigning the select policy so any authenticated user can read monitoring data, while only the owner can write it.

  • Proctoring sensitivity

I didn’t want to punish students for a single accident. Tuning the number of warnings, what message to show, and when to disqualify required careful testing so it felt strict but still reasonable.


Accomplishments that we're proud of

Even though this is a solo project, I’m proud that Code Arena:

  • Runs a full contest flow end‑to‑end

From hosting a contest, to joining by stream, to real‑time scoring, to open practice mode afterwards — it actually works as a complete loop.

  • Shows a meaningful leaderboard

The leaderboard doesn’t just list AC counts; it includes total time with tab‑switch penalties and still updates live, which makes contests feel more serious and transparent.

  • Handles wrong‑stream students gracefully

If a student opens a contest that isn’t for their stream, they can still read the problem and see the leaderboard, but the editor and submit button are locked with a clear explanation instead of a confusing error.

  • Has visible but not overbearing proctoring

Students see clear warnings if they tab away too often, and admins quietly get extra data (switches/runs) for each participant when they review results.

  • Ships with a real practice set and admin tools

Code Arena isn’t an empty shell — it already has 100+ curated problems available from day one, plus an admin dashboard that makes it practical to actually run and review contests, not just demo them.


What we learned

Through Code Arena, I learned a lot more than just “how to build a website”:

  • Backend rules matter more than UI

Stream checks, contest windows, and disqualifications all must live on the server. The UI is just a hint; security and fairness live in the backend.

  • Row Level Security is powerful and easy to get wrong

Whenever data “disappeared,” the first place to check was RLS. I got used to writing and debugging policies and thinking carefully about who can select vs update vs insert.

  • AI is great for speed, but product decisions are human

AI tools helped me scaffold and refactor quickly, but they can’t decide contest rules or academic fairness. Those had to come from my own experience and manual testing.

  • Building for my own environment helps

Because I’m designing this for my own college, decisions about streams, penalties, and practice mode were grounded in real issues I’ve seen, not abstract ideas.


What's next for Code Arena

Going forward, I’d like to:

  • Make the platform more beginner‑friendly

    • Editorials and hints after contests
    • Starter “packs” of problems for each stream and year
    • Smoother onboarding so first‑time coders can treat Code Arena as a safe practice environment, not just a hardcore judge

Ultimately, I want Code Arena to be the default place where my college can host serious programming contests, and at the same time a welcoming practice arena that lowers the barrier for new students to start coding.

Built With

Share this project:

Updates