DEV Community

Prajwal Dhande
Prajwal Dhande

Posted on

I got bored of solving DSA alone, so I built a Real-Time Multiplayer Coding Arena ⚔️

Hello World! 👋

As a software engineering student, practicing Data Structures and Algorithms (DSA) is a daily routine. But let's be honest, grinding LeetCode alone gets really monotonous after a while. Plus, it doesn't prepare you for the actual pressure of an interview.

I wanted to practice under pressure against real opponents, so over the last few months, I built NodeClash – a real-time 1v1 coding platform.

🎮 What is NodeClash?

It's a platform where you can battle your friends in real-time.

  • You create a room and share the link.
  • Both players get the same DSA problem.
  • The first person to pass all test cases wins.
  • Everything is synced in real-time (sub-100ms latency)!

🛠️ The Tech Stack

Being a full-stack developer, I went with my trusted tools:

  • Frontend: React.js (Vite) for a snappy, dark-themed UI.
  • Backend: Node.js & Express.
  • Real-time Sync: Socket.io (This was the most fun part!).
  • Database: MongoDB for storing user stats and matches.
  • Auth: Google OAuth.

🧠 The Core Challenge: Matchmaking & Real-time Sync

The hardest part of building this was ensuring that when Player A types a character or runs code, Player B sees the game state update instantly without the server crashing.

(Yahan par apne backend code ka ek chota sa snippet daal do, jaise tumne Socket.io se room create kiya ya join karwaya. Developers love seeing actual code!)


javascript
// Example: How I handled room joining
io.on('connection', (socket) => {
  socket.on('join_arena', (roomId) => {
    socket.join(roomId);
    console.log(`Player joined battle arena: ${roomId}`);
  });
});




🐞 I need your help!
This is my biggest full-stack project so far, and I really want to stress-test the servers.

I would love it if you guys could grab a friend, hop onto (https://nodeclash.in), and play a match.

Try to break the matchmaking, find UI bugs, and let me know your thoughts in the comments. I'll be actively fixing them!

Thanks for reading! 🚀
Enter fullscreen mode Exit fullscreen mode

Top comments (0)