Banner Background
Web App

CodeArena

CodeArena is a modern, enterprise-grade competitive programming and technical interview platform built with Next.js 16, React 19, Redis, BullMQ, and Docker. It features sandboxed multi-language code execution (C++, Java, Python, JavaScript), real-time contest leaderboards powered by Socket.IO and Redis Pub/Sub, Groq & Google Gemini AI feedback on code submissions, and interactive mock coding interviews with telemetry and plagiarism detection.

Next JSReact JSTypescriptNode.jsNode JSDockerRedisBullMQSocket.ioSocket.IOMongoDBTailwind CSSMonaco EditorGoogle GeminiGroq AIFirebaseGitGithubRender
CodeArena Preview

Overview

CodeArena is an enterprise-grade competitive programming and technical interview platform built with Next.js 16, React 19, Redis 7, BullMQ, and Docker. Designed for high-concurrency algorithm battles and simulated interview practice, it bridges the gap between fast-paced live coding competitions and in-depth developer skill mastery.

The platform features sandboxed multi-language code execution (Python, C++, Java, JavaScript, Rust, Go), real-time contest leaderboards powered by Socket.IO and Redis Pub/Sub, instant AI-driven code complexity analysis (evaluating Correctness, Efficiency, and Readability), and developer profile telemetry with interactive submission activity heatmaps.

Awarded #1 Top Project Among 45+ Teams

CodeArena was recognized as the #1 Top Project across 45+ competing cohort teams for its resilient Docker-based sandbox architecture, sub-second execution speeds, real-time WebSockets, and polished full-stack user experience.

CodeArena Hero Platform — Master Algorithms

CodeArena homepage: 2,500+ problems, live contests, multi-language execution environments (Python, C++, Java, JS, Rust, Go), and AI Interviewer.

Tech Stack

  • Next.js 16 (App Router) with React 19
  • Tailwind CSS + PostCSS for sleek dark-first design system
  • @monaco-editor/react for desktop-grade code editing with syntax highlighting
  • Framer Motion & GSAP for fluid micro-animations and layout transitions
  • Radix UI Primitives (Avatar, Checkbox, Dialog, Separator, Slot)
  • Canvas Confetti for celebration triggers upon passing testcases

Feature Breakdown

Docker Sandboxed Multi-Language Execution

Secure, resource-constrained container sandbox executing C++, Java, Python, JavaScript, Rust, and Go with 256MB memory caps, 5s timeouts, and Linux seccomp filtering.

Global Hall of Fame & Live Leaderboard

Real-time competitive leaderboard with live contest scoring, rating updates (260 rating), rank shift animations, and Socket.IO broadcasts.

AI Complexity Analysis Radar

Instant time/space complexity evaluation, radar visualization across Correctness, Efficiency, and Readability, and automated optimization feedback.

Developer Telemetry & 277+ Activity Heatmap

Annual submission heatmaps, difficulty distribution charts (Easy/Medium/Hard), topic mastery indexing, and targeted algorithmic focus recommendations.

CodeArena Live IDE & AI Submission Analysis

Real-time IDE workspace featuring instant code submission evaluation, 4/4 testcase verification, runtime/memory benchmarks (25ms / 7.66MB), and AI code analysis radar.

Platform Interface & Live Telemetry

Admin Center & Real-Time System Analytics Dashboard

Admin Center & Real-Time System Analytics Dashboard

Comprehensive administrator control panel showing real-time platform velocity, live contest monitoring, weekly submission distribution, AI interview metrics, and global elite rankings.

Global Hall of Fame & Real-Time Leaderboard

Global Hall of Fame & Real-Time Leaderboard

Real-time global leaderboard showcasing top-ranked contestants (#2 ahmuzahid), live contest ratings (260), score cards, country distributions, and WebSocket broadcast status.

Community Problem Feed & Daily Picks

Community Problem Feed & Daily Picks

Community dashboard featuring Daily Picks (Two Sum, Maximum Subarray Sum), Trending Problems, Upcoming Contests countdown, and peer solved feeds.

Developer Profile, Problem Statistics & 277-Day Submission Heatmap

Developer Profile, Problem Statistics & 277-Day Submission Heatmap

Comprehensive developer profile with GitHub-style submission activity heatmap (277 annual submissions), solve difficulty breakdown (Easy/Medium/Hard), and focus area skill recommendations.

Architecture

User Journey

1

Discovery & Problem Selection

Contestants browse curated problem sets with difficulty filters (Easy, Medium, Hard), acceptance rates, and topic tags.

2

Monaco Editor & Live Drafting

The user writes solutions in C++, Java, Python, or JavaScript with desktop-grade syntax highlighting, autocomplete, and theme toggling.

3

Testcase Execution & Sandboxing

Clicking Run or Submit dispatches code to BullMQ workers which spin up ephemeral, resource-constrained Docker sandboxes.

4

Real-Time Result Streaming

Worker status, standard output, testcase pass/fail badges, runtime metrics, and memory usage stream back instantly via Socket.IO.

5

AI Diagnostics & Leaderboard Updates

Groq and Gemini analyze the code for optimization while contest standings update on live leaderboards with animated rank shifts.

CodeArena separates concerns across stateless API servers, background worker pools, and real-time socket clusters—all synchronized through Redis.

System Architecture & Data Flow
Rendering architecture diagram...

Submissions enter POST /api/execute, get validated and enqueued into Redis BullMQ. A background worker picks the job, provisions an isolated Docker container with seccomp rules, passes inputs, gathers stdout/stderr/time/memory metrics, and pushes the final verdict to MongoDB and Socket.IO.

Sandboxed Compilation & Execution Workflow

High-throughput asynchronous task processing and Docker isolation lifecycle.

Phase 01
Redis 7BullMQZod

Code Ingestion & Rate-Limit Gate

Code submissions validate syntax parameters and pass through Redis token-bucket rate limiters before entering queues.

await submissionQueue.add("execute-job", { language, code, testcases, userId }, { attempts: 2, backoff: 1000 });
Phase 02
DockerodeLinux cgroupsSeccomp

Ephemeral Container Provisioning

Worker pulls from queue, spawns an isolated Docker container with restricted seccomp profile, and attaches ephemeral memory volumes.

const container = await docker.createContainer({ Image: `sandbox-${lang}`, HostConfig: { Memory: 256 * 1024 * 1024, NetworkMode: "none", SecurityOpt: ["seccomp=untrusted.json"] } });
Phase 03
C++20Java 21Python 3.12Node.js

Testcase Streaming & Metric Capture

Code compiles and runs against hidden input testcases. CPU time, peak RSS memory, and standard output are measured in milliseconds.

const { stdout, stderr, executionTimeMs, memoryUsedKb, status } = await runTestcases(container, testcases);
Phase 04
Socket.IOGroq Llama 3Gemini AI

Real-Time Verdict & AI Analysis

Results broadcast to contestant via Socket.IO while Groq/Gemini models perform automated time complexity analysis.

io.to(userId).emit("submission:verdict", { status, executionTimeMs, memoryUsedKb, aiFeedback });

Sandboxing & Container Security Architecture

Executing untrusted code requires rigorous defense-in-depth across the kernel, file system, and container network layers.

Seccomp BPF

Custom Linux Seccomp Filtering

Custom BPF seccomp rules block dangerous syscalls (ptrace, mount, setuid, socket, fork bombs) before execution begins.

Linux cgroups

Strict Cgroups Resource Caps

Each container run is constrained to 256MB RAM and 50% single CPU core with a hard 5-second process timeout kill-switch.

No Network

Air-Gapped Network Isolation

Containers launch with --network none to strictly prevent outbound SSRF requests, cryptocurrency miners, or network scanning.

Sandboxed Execution & Concurrency Benchmarks

Telemetry collected across concurrent compilation and broadcast workloads.

<420ms
C++ Compilation Speed

Pre-cached GCC 13 toolchain with RAM-disk volume mounting.

8ms
Socket Event Latency

Real-time verdict streaming over Redis Adapter cluster.

1,000+
Concurrent Contests

Parallel submission capacity backed by BullMQ worker concurrency.

65ms
Container Spin-up Time

Pre-warmed pool of dormant container runtimes ready for immediate spawn.

2,500/min
Queue Processing Throughput

Sustained execution throughput per worker node under peak contest load.

256MB
Memory Ceiling

Hard unexceedable cgroups memory barrier with SIGKILL safety guard.

Execution Engine Comparison: Docker vs Judge0

Architectural tradeoffs between local container runners and cloud fallbacks.

Dimension / FeatureCodeArena Docker SandboxJudge0 Cloud Fallback
Execution Latency< 500ms (Direct Unix Socket)~ 1,800ms (HTTP Network Overhead)
Security IsolationCustom Linux Seccomp + cgroups v2Isolate sandbox daemon
Cost / ScalabilitySelf-hosted, zero marginal costUsage-tiered API quota
Availability RolePrimary Real-Time Execution EngineAutomated Resilience & Spike Failover

API Endpoints

ResourceMount pointPurpose
Auth/api/auth/syncFirebase token verification, user sync, and WebSocket token generation
Execution/api/executeDispatch code for sandboxed compilation, testcase running, and evaluation
Evaluation/api/evaluation/analyzeGroq & Gemini AI feedback, complexity analysis, and hint generation
Contests/api/contestsCreate, list, and register for competitive programming contests
Leaderboard/api/contests/[id]/leaderboard/liveReal-time ranking updates with penalty scoring and submission telemetry
Admin & Ops/api/admin/opsSystem telemetry, worker health metrics, problem CRUD, and plagiarism scanner

Project Structure

docker-compose.yml
docker-compose.dev.yml
next.config.mjs
package.json
Dockerfile.base
Dockerfile.cpp
Dockerfile.java
Dockerfile.javascript
Dockerfile.python
seccomp-profile.json
layout.js
page.jsx

Getting Started

Environment Variables

NEXT_PUBLIC_APP_URL=http://localhost:3000
MONGODB_URI=mongodb://localhost:27017/codearena
REDIS_URL=redis://localhost:6379

FIREBASE_PROJECT_ID=...
FIREBASE_CLIENT_EMAIL=...
FIREBASE_PRIVATE_KEY="..."

GROQ_API_KEY=...
GEMINI_API_KEY=...
JUDGE0_API_KEY=...

Running Locally

Requires Node.js 18+, Docker Desktop, Redis, and MongoDB (local or Atlas).

npm install
npm run dev

Deployment

  • Render / Railway — stateless Next.js app, Redis instance, and MongoDB Atlas database.
  • Self-hosted Docker — complete deployment using docker-compose.yml with prebuilt executor sandboxes.

Frequently Asked Questions

See it in action

Explore the live competitive coding platform, contests, and interview simulator at the Live Application.

• OPEN TO WORK • OPEN TO WORK
star
OPEN TO WORK · OPEN TO WORK ·
wingsLogo

FROM CONCEPT TO CREATION
LET'S MAKE IT HAPPEN!

I'm available for full-time roles & freelance projects.

I thrive on crafting dynamic web applications, and
delivering seamless user experiences.