Skip to content

PatilSharvil/DebugArena

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ 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


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors