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 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.

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
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
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 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
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
Discovery & Problem Selection
Contestants browse curated problem sets with difficulty filters (Easy, Medium, Hard), acceptance rates, and topic tags.
Monaco Editor & Live Drafting
The user writes solutions in C++, Java, Python, or JavaScript with desktop-grade syntax highlighting, autocomplete, and theme toggling.
Testcase Execution & Sandboxing
Clicking Run or Submit dispatches code to BullMQ workers which spin up ephemeral, resource-constrained Docker sandboxes.
Real-Time Result Streaming
Worker status, standard output, testcase pass/fail badges, runtime metrics, and memory usage stream back instantly via Socket.IO.
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.
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.
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 });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"] } });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);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.
Custom Linux Seccomp Filtering
Custom BPF seccomp rules block dangerous syscalls (ptrace, mount, setuid, socket, fork bombs) before execution begins.
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.
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.
Pre-cached GCC 13 toolchain with RAM-disk volume mounting.
Real-time verdict streaming over Redis Adapter cluster.
Parallel submission capacity backed by BullMQ worker concurrency.
Pre-warmed pool of dormant container runtimes ready for immediate spawn.
Sustained execution throughput per worker node under peak contest load.
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 / Feature | CodeArena Docker Sandbox | Judge0 Cloud Fallback |
|---|---|---|
| Execution Latency | < 500ms (Direct Unix Socket) | ~ 1,800ms (HTTP Network Overhead) |
| Security Isolation | Custom Linux Seccomp + cgroups v2 | Isolate sandbox daemon |
| Cost / Scalability | Self-hosted, zero marginal cost | Usage-tiered API quota |
| Availability Role | Primary Real-Time Execution Engine | Automated Resilience & Spike Failover |
API Endpoints
| Resource | Mount point | Purpose |
|---|---|---|
| Auth | /api/auth/sync | Firebase token verification, user sync, and WebSocket token generation |
| Execution | /api/execute | Dispatch code for sandboxed compilation, testcase running, and evaluation |
| Evaluation | /api/evaluation/analyze | Groq & Gemini AI feedback, complexity analysis, and hint generation |
| Contests | /api/contests | Create, list, and register for competitive programming contests |
| Leaderboard | /api/contests/[id]/leaderboard/live | Real-time ranking updates with penalty scoring and submission telemetry |
| Admin & Ops | /api/admin/ops | System telemetry, worker health metrics, problem CRUD, and plagiarism scanner |
Project Structure
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.