A real-time multiplayer platform where developers compete to debug AI-generated code across multiple programming languages!
DebugArena is a real-time, multiplayer competitive debugging platform. Developers race to fix AI-generated buggy code in a variety of programming languages, earning points, climbing ranks, and building streaks. The platform is designed for fun, learning, and skill improvement, with a focus on speed, accuracy, and community.
- ๐ Authentication: Register/login to access the platform.
- ๐ Language Selection: Choose from 8 supported languages: Java, C, Python, C++, JavaScript, HTML/CSS, TypeScript, SQL.
- ๐๏ธ Difficulty Selection: Four levelsโEasy, Normal, Hard, Insane.
- ๐ฅ Lobby System: Get matched with 2 other players (3 per match).
- ๐ Bug Presentation: Receive the same AI-generated buggy code.
- โฑ๏ธ Timer: Race to fix the bug before time runs out (see timing scheme below).
- ๐ป Code Editor: Submit your fix (multiple submissions allowed, last one counts).
- ๐ค AI Validation: Google Gemini AI checks your solution for correctness.
- ๐ Scoring & Ranking: Points awarded for placement. Live leaderboard updates.
- ๐ Results: See your rank, points, time, and streaks after each round.
DebugArena features three main arenas/game modes, each designed for a different experience:
-
Solo Play: Play alone, no matchmaking required.
-
No Points: Practice mode does not affect your points, rank, or streaks.
-
Flexible Difficulty: Choose any language and difficulty to hone your skills.
-
No Pressure: Great for learning, warming up, or exploring new languages.
-
Competitive Multiplayer: Get matched with 2 other players for a 3-player real-time match.
-
Points & Ranks: Your performance directly affects your points and rank according to the scoring table.
-
Strict Timer: Difficulty-based time limits apply.
-
Leaderboard Impact: Results count toward global and language-specific leaderboards.
- Private Matches: Create or join a room with a custom code. Invite friends or play with selected players.
- Flexible Player Count: Set the number of players for your room (up to the supported max).
- Custom Difficulty & Language: Choose your preferred settings for the match.
- Challenge Mode (Optional): Enable point betting for extra stakes.
- Points: In standard custom rooms, no points are awarded or deducted. In challenge mode, points are wagered and distributed based on results.
The following features are planned for future development:
- ๐ Debug Marathon: 5-player competition with 5 rounds of increasing difficulty
- ๐ฎ Custom DebugMarathon: Private marathon rooms with customizable settings
| Difficulty | โฑ๏ธ Time Limit |
|---|---|
| Easy | 60 seconds |
| Normal | 90 seconds |
| Hard | 300 seconds |
| Insane | 420 seconds |
- The timer is set per round based on the selected difficulty.
- No submissions are accepted after the timer ends.
- Timer and player statuses are synchronized in real-time using Socket.IO.
Points are awarded strictly based on your placement and the selected difficulty. There are no speed or streak bonuses.
| Difficulty | 1st Place | 2nd Place | 3rd Place |
|---|---|---|---|
| Easy | +10 | +3 | -10 |
| Normal | +20 | +7 | -20 |
| Hard | +30 | +10 | -30 |
| Insane | +40 | +20 | -40 |
- 1st Place: Highest points for finishing first with a correct solution.
- 2nd Place: Fewer points for finishing second with a correct solution.
- 3rd Place: Points are deducted for finishing last.
- Incorrect/No Submission: No points awarded.
- ๐ฅ Bronze
- ๐ฅ Silver
- ๐ฅ Gold
- ๐ Diamond
- ๐ Master
- ๐ Grandmaster
Ranks are displayed on profiles and leaderboards.
- Profile Data: Username, display name, bio, location, social links, avatar.
- Statistics: Games played, win rate, average rank, fastest time, highest streak, points per language/difficulty.
- Streak Tracking: Visual streak counter, milestone badges (e.g., 50, 100, 365 days).
- Achievements: Earned for streaks, high scores, and special events.
- Activity Heatmap: Calendar-style visualization of daily activity.
- Global Leaderboard: Top players by total points.
- Language-Specific Leaderboards: Filter by programming language.
- Live In-Game Leaderboard: Updates in real-time during matches.
- ๐ Home/Landing Page: Overview, login/register.
- ๐น๏ธ Playground: Main game interface (code editor, timer, submission panel).
- ๐ค Profile: Stats, achievements, streaks, customization.
- ๐ Leaderboard: Rankings and filters.
- ๐ Authentication: Login, register, password reset.
- ๐งญ Navbar: Persistent navigation across all pages.
- SVG Badges: For rank display.
- CSS: Styling for profile, leaderboard, and main UI.
- JS: Frontend logic, real-time updates, UI interactivity.
- Responsive Design: Works on desktop and mobile.
- Code Editor: Syntax highlighting, error display, submission button.
- Timer Display: Prominent, with color changes as time runs out.
- Live Status: See when other players submit or finish.
- Result Modal: Shows after each round with detailed feedback.
- Express.js: API endpoints, authentication, routing.
- Socket.IO: Real-time multiplayer, timers, live updates.
- Google Gemini AI: Buggy code generation and solution validation.
- Database: Stores user data, points, streaks, match history.
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Main application page |
/generate-buggy |
GET | Generate buggy code |
/validate |
POST | Validate user solutions |
/profile |
GET | Fetch user profile |
/leaderboard |
GET | Fetch leaderboard data |
/auth/login |
POST | User login |
/auth/register |
POST | User registration |
/auth/logout |
POST | User logout |
DebugArena/
โโโ config/
โ โโโ database.js # Database configuration
โ โโโ passport.js # Authentication setup
โโโ middleware/
โ โโโ auth.js # JWT authentication middleware
โโโ models/
โ โโโ User.js # User model with profile data
โ โโโ PointTransaction.js # Points tracking model
โโโ routes/
โ โโโ auth.js # Authentication routes
โ โโโ passwordReset.js # Password reset functionality
โ โโโ profile.js # Profile management routes
โโโ public/
โ โโโ home.html # Landing page
โ โโโ playground.html # Main game interface
โ โโโ profile.html # User profile page
โ โโโ main.js # Frontend game logic
โ โโโ profile.js # Profile page functionality
โ โโโ style.css # Main styling
โ โโโ profile.css # Profile page styling
โ โโโ navbar.html # Navigation component
โโโ server.js # Express server setup
โโโ multiplayer.js # Socket.IO game logic
โโโ utils/
โ โโโ points.js # Points calculation utilities
โโโ package.json # Dependencies and scripts
โโโ .env # Environment variables
- Authentication: JWT/session-based, password hashing.
- Input Validation: All user input is sanitized and validated.
- Anti-Cheating: Server-side validation, no client-side scoring.
- Rate Limiting: Prevents abuse of endpoints.
- Add Languages: Modular code generation and validation.
- Custom Badges: Add new achievements or rank tiers.
- Profile Customization: Users can update display name, bio, and social links.
- Environment Variables:
.envfile for API keys and config. - Start Command:
npm start(runs server and frontend). - Port Configuration: Default 3000, configurable via
PORTenv variable.
- Bug Reports: Via GitHub Issues.
- Contributions: Fork, branch, PR workflow.
- License: MIT.
| ๐ฉ Feature | ๐ Description |
|---|---|
| ๐ฅ Multiplayer | 3-player real-time matches |
| ๐ค AI Bug Generation | Unique buggy code per match, per language/difficulty |
| โฑ๏ธ Timer | Difficulty-based time limits, real-time sync |
| ๐ Points & Ranks | Placement-based points, tiered ranks |
| ๐ค User Profiles | Stats, streaks, badges, activity heatmap |
| ๐ Leaderboards | Global and language-specific rankings |
| ๐ Real-Time Updates | Socket.IO for instant feedback and status |
| ๐ Secure Auth | JWT/session, password hashing, input validation |
| ๐ฑ Responsive UI | Works on all devices |
| ๐งฉ Extensible | Modular for new languages, badges, and features |