DebugDuel is a competitive multiplayer platform designed for software engineers. It places two developers in a real time environment with a broken codebase or a design challenge. The first developer to accurately diagnose, fix, and explain the issue claims victory and climbs the global leaderboard.
Built with low latency WebSocket communication and a strict Elo ranking system, DebugDuel provides a rigorous environment to test your technical proficiency against peers worldwide.
The platform operates on a decoupled client server architecture, utilizing real time bi directional event streams for gameplay synchronization.
graph TD
Client1[Player 1 Next.js Client] <-->|WebSocket| SocketGateway[Socket.IO Gateway]
Client2[Player 2 Next.js Client] <-->|WebSocket| SocketGateway
SocketGateway <--> Matchmaking[Matchmaking Engine]
SocketGateway <--> GameState[Game State Manager]
GameState --> Validation[Code & UI Validation Service]
Matchmaking --> Database[(Prisma / PostgreSQL)]
GameState --> Database
Validation --> Compiler[Isolated Execution Environment]
The matchmaking engine places players into a continuous polling pool. Once two players with comparable Elo ratings queue for the same mode, the server allocates a dedicated game room, synchronizes their countdown timers, and simultaneously serves the challenge payload. If an opponent disconnects, an automated forfeit protocol immediately resolves the match.
Players are issued unique cryptographic friend keys. By sharing these keys, users can populate their friends list, monitor real time active status, and send direct challenge invitations. A strict 30 second cooldown prevents challenge spamming.
DebugDuel employs a multi tiered Elo rating system to accurately reflect a player's skill across different domains.
- DebugDuel Elo: Measures proficiency in algorithmic debugging and syntax correction.
- UI UX Arena Elo: Tracks performance in pixel perfect CSS recreation and visual design challenges.
- Code KBC Elo: Evaluates rapid fire theoretical knowledge and trivia.
Overall Elo: The primary metric displayed on player profiles and leaderboards. It represents the highest rating achieved across all individual modes, ensuring that specialists are rewarded for their depth of expertise.
Winning a match transfers Elo points from the loser to the winner based on the rating disparity between the two players. Defeating a higher ranked opponent yields a larger Elo increase than defeating a lower ranked one.
debug-duel/
├── frontend/
│ ├── src/app/ # Next.js App Router views and layouts
│ ├── src/components/ # Reusable UI components
│ ├── src/store/ # Zustand state management
│ └── public/ # Static assets including the SVG logo
│
├── backend/
│ ├── server.js # Express and Socket.IO entry point
│ ├── prisma/ # PostgreSQL schema and migration scripts
│ └── .env # Environment configurations
To run the platform locally, you will need Node.js and a PostgreSQL instance.
-
Clone the repository
git clone https://github.com/your-org/debug-duel.git cd debug-duel -
Configure the Environment Set up your
.envfiles in both thefrontendandbackenddirectories with your database credentials and authentication keys. -
Initialize the Database
cd backend npm install npx prisma generate npx prisma migrate dev -
Start the Backend Server
npm run dev
-
Start the Frontend Application
cd ../frontend npm install npm run dev
We welcome contributions from the engineering community. To maintain codebase integrity, please adhere to the following workflow:
- Fork the repository and create a feature branch from
main. - Maintain architectural patterns: Ensure any new real time features are routed through the existing Socket.IO state manager. Do not implement direct client to database calls.
- Commit Messages: Use clear, imperative commit messages. If your commit does not require a CI CD pipeline trigger, append
[skip ci]to your commit message to conserve deployment resources. - Pull Requests: Submit a pull request with a detailed summary of your changes. Ensure your code passes all local linting and type checks before submission.
This project is licensed under standard open source terms. See the LICENSE file for more details.