Skip to content

Latest commit

 

History

History
275 lines (199 loc) · 11 KB

README.md

File metadata and controls

275 lines (199 loc) · 11 KB

🚀 DebugArena: Competitive Multiplayer Debugging Platform

DebugArena Logo Version License Node.js Socket.IO

A real-time multiplayer platform where developers compete to debug AI-generated code across multiple programming languages!


🎯 What is DebugArena?

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.


🕹️ Game Flow & User Journey

  1. 🔐 Authentication: Register/login to access the platform.
  2. 🌐 Language Selection: Choose from 8 supported languages: Java, C, Python, C++, JavaScript, HTML/CSS, TypeScript, SQL.
  3. 🎚️ Difficulty Selection: Four levels—Easy, Normal, Hard, Insane.
  4. 👥 Lobby System: Get matched with 2 other players (3 per match).
  5. 🐞 Bug Presentation: Receive the same AI-generated buggy code.
  6. ⏱️ Timer: Race to fix the bug before time runs out (see timing scheme below).
  7. 💻 Code Editor: Submit your fix (multiple submissions allowed, last one counts).
  8. 🤖 AI Validation: Google Gemini AI checks your solution for correctness.
  9. 🏆 Scoring & Ranking: Points awarded for placement. Live leaderboard updates.
  10. 📊 Results: See your rank, points, time, and streaks after each round.

🏟️ Arenas & Game Modes

DebugArena features three main arenas/game modes, each designed for a different experience:

1. 🏅 Practice Arena

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

2. 🏆 Ranked Arena

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

3. 🏠 Custom Room Arena

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

Future Scope Features

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

⏲️ Timing Scheme by Difficulty

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.

🏅 Scoring & Points System

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.

🏆 Rank Tiers

  • 🥉 Bronze
  • 🥈 Silver
  • 🥇 Gold
  • 💎 Diamond
  • 👑 Master
  • 🏅 Grandmaster

Ranks are displayed on profiles and leaderboards.


👤 User Profiles & Achievements

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

🏆 Leaderboards & Rankings

  • Global Leaderboard: Top players by total points.
  • Language-Specific Leaderboards: Filter by programming language.
  • Live In-Game Leaderboard: Updates in real-time during matches.

🗂️ Sections & Navigation

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

🖼️ Public Assets & UI/UX

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

🛠️ Backend & Real-Time Logic

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

🔌 API Endpoints

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

📁 File & Directory Structure

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

🔒 Security & Fair Play

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

🧩 Extensibility & Customization

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

🚀 Deployment & Configuration

  • Environment Variables: .env file for API keys and config.
  • Start Command: npm start (runs server and frontend).
  • Port Configuration: Default 3000, configurable via PORT env variable.

🤝 Support & Contribution

  • Bug Reports: Via GitHub Issues.
  • Contributions: Fork, branch, PR workflow.
  • License: MIT.

🏁 Summary Table: Key Features

🚩 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


Status