Chess.com meets LeetCode — Battle developers head-to-head on algorithmic challenges in real-time.
Key Features • System Architecture • Tech Stack • Quick Start • Supported Languages
Practicing DSA alone on LeetCode can feel slow and unengaging. AlgoArena turns algorithmic problem-solving into a fast-paced multiplayer competitive esport.
Match with opponents based on your Elo rating, receive the same problem simultaneously, write code in Monaco Editor, watch your opponent's live progress telemetry, and race to pass all secret test cases. Submissions are judged in isolated Docker containers with instant verdict streaming over WebSockets.
|
Instant skill-based matchmaking with expanding search bands. Experience live opponent telemetry, typing indicators, line-count tracking, and instant win/loss triggers. |
Submissions run inside isolated, non-root Docker containers with strict RAM (256MB), CPU, PID, and |
|
Chess-style rating system featuring dynamic K-factors, solve-speed bonuses, problem difficulty multipliers, placement calibration, and global leaderboards. |
Generate 6-character room codes or direct challenge links to battle friends, host study groups, or run mock interview sprints unrated. |
|
VS Code-powered editor with syntax highlighting, custom themes, and automatic |
Track your Elo progression charts, match history, win rates across problem topics, daily duel streaks, and customizable avatar styles. |
flowchart LR
A[React 19 + Monaco UI] <--->|WebSockets & REST| B[Express 5 + Socket.io Server]
B <---> C[(PostgreSQL DB)]
B --->|Enqueue Job| D[(Redis + BullMQ)]
D ---> E[Judge Worker]
E ---> F[Docker Sandbox]
F --->|Node.js / Python / C++ / Java| E
E --->|Publish Verdict| D
D --->|aa:verdicts| B
- Client Layer: React 19 single-page app with Monaco Editor and persistent Socket.io connection.
- Gateway Layer: Express 5 REST API + Socket.io gateway managing authentication, room states, and matchmaking queues.
- Queue & Broker: Redis and BullMQ distributed queues decoupling heavy code execution from API traffic.
- Execution Sandbox: Dedicated worker pool executing untrusted user code inside hardened, zero-network Docker containers.
| Domain | Technologies |
|---|---|
| Frontend | React 19, Vite, Monaco Editor (@monaco-editor/react), Tailwind CSS, Socket.io Client, Axios, React Router 7 |
| Backend & Realtime | Node.js, Express 5, Socket.io 4, PostgreSQL (pg pool, pgcrypto), JWT, Bcrypt, Nodemailer |
| Queue & Messaging | Redis (Upstash), BullMQ 5 (Distributed job queue & pub/sub) |
| Judge & Sandbox | Docker Engine, Alpine Linux (node:20-alpine), GCC / G++ 13, Python 3.11, OpenJDK 17 |
| Authentication | JWT (HS256), Email OTP (Nodemailer SMTP), Google OAuth (Firebase Admin) |
AlgoArena supports multi-language execution with native data-structure builders:
| Language | Runtime / Compiler | Version | Features |
|---|---|---|---|
| JavaScript | Node.js VM & Container | v20.x |
Built-in Tree & Linked-List parser |
| Python | Python 3 | 3.11+ |
Automatic AST parameter unpacking |
| C++ | GCC (G++) | C++17 |
High-speed execution with nlohmann-json |
| Java | OpenJDK | Java 17 |
Auto-compiled with memory-tuned flags |
Over 175+ curated algorithmic problems across key competitive programming topics:
Arrays • Strings • Linked Lists • Trees & BST • Dynamic Programming • Graphs & BFS/DFS • Binary Search • Sorting
git clone https://github.com/ayushoncode/AlgoArena.git
cd algoarena
# Install dependencies for all services
cd backend && npm install
cd ../frontend && npm install
cd ../workers && npm install
cd ..Create .env files in backend/, workers/, and frontend/:
backend/.env
PORT=4000
NODE_ENV=development
CLIENT_URL=http://localhost:5173
DATABASE_URL=your_postgresql_connection_string
REDIS_URL=your_redis_connection_string
JWT_SECRET=your_super_secret_jwt_keyworkers/.env
DATABASE_URL=your_postgresql_connection_string
REDIS_URL=your_redis_connection_string
SANDBOX_IMAGE=algoarena-sandbox
WORKER_CONCURRENCY=3frontend/.env
VITE_API_URL=http://localhost:4000# Build the Docker sandbox image (one-time setup)
docker build -t algoarena-sandbox -f workers/Dockerfile.sandbox workers/Start the services across three terminals:
# Terminal 1: Backend API & WebSocket Gateway
cd backend && npm start
# Terminal 2: Background Submission Worker
cd workers && npm start
# Terminal 3: Frontend Web App
cd frontend && npm run devOpen http://localhost:5173 to enter the arena! ⚔️
Run the backend and frontend on one laptop (the host). Find its local IPv4 address with:
ipconfigUse the host laptop's IPv4 Address (for example, 10.20.24.254) in frontend/.env:
VITE_API_URL=http://10.20.24.254:4000Restart Vite after changing .env, then on both laptops open:
http://10.20.24.254:5173
Create or log into separate accounts and use a custom room code to challenge each other. Both laptops must be on the same Wi-Fi, and Windows Firewall must allow Node.js on private networks. The backend, PostgreSQL, Redis, and worker stay on the host laptop; the second laptop only needs a browser.
- Real-time 1v1 matchmaking with dynamic Elo scaling
- Multi-language Docker sandbox judge (JS, Python, C++, Java)
- Custom private battle rooms with shareable codes
- Global leaderboards & detailed rating progression analytics
- Tournament Bracket Mode — Auto-generated knockout brackets for communities
- 2v2 Team Battles — Co-op competitive problem-solving
- Spectator Mode — Watch ongoing ranked matches live with dual code view
Distributed under the ISC License.