Hiring?
Seeking new challenges
Home
About Me
Projects
Contact
Loading theme toggle
Switch Theme (Light / Dark / System)

looking for a software engineer?

if you're looking for someone to help build and scale products, hire me.

Hire me

© 2026 Sagar Gujarathi

Back to Projects
BitFight
Active

BitFight

A high-performance competitive coding platform for real-time 1v1 battles and global tournaments. Features a custom Docker-based sandboxed judge.

Overview

BitFight is a real-time competitive programming platform designed for speed and reliability. It enables developers to compete in head-to-head 1v1 coding battles, participate in scheduled contests, and track their progress through an ELO-based ranking system. The platform focuses on low-latency interactions and a seamless developer experience with an integrated Monaco-powered IDE.

Features

  • Real-time 1v1 Battles: Instant matchmaking and live synchronization of match state using a custom Request/Report protocol over WebSockets.
  • Sandboxed Execution: A scalable Go-based judge service that executes untrusted code within isolated Docker containers, offering support for multiple programming languages.
  • Competitive System: ELO-based ranking subsystem with global leaderboards and match history tracking.
  • Spectator Mode: Watch live matches in real-time with zero-latency state updates.
  • Solo Practice Mode: A dedicated environment for solving curated problems and improving coding speed without the pressure of a match.
  • Integrated IDE: A feature-rich code editor based on Monaco, providing syntax highlighting, autocomplete, and real-time execution feedback.

Tech Stack

The architecture is built for high concurrency and low latency. The Next.js 16 frontend uses the App Router and shadcn/ui for a premium, responsive interface, with TanStack Query managing server state. The backend is a high-performance Go service using the Fiber framework, leveraging Redis for real-time messaging and WebSocket state management. PostgreSQL with GORM provides reliable persistence for user data, problems, and match results.

Challenges

One of the primary challenges was ensuring consistent match state across distributed WebSocket nodes. I implemented a robust synchronization protocol using Redis Pub/Sub to handle real-time events like code submissions and verdicts. Additionally, building a secure and fast code execution sandbox required careful Docker orchestration and parallel test case execution to minimize "Time to Verdict" for the users.

Roadmap

  • Team Battles: Support for multi-player team-based competitive formats.
  • Custom Contest Creator: Tools for organizations to host their own private coding tournaments.
  • Advanced Analytics: Detailed breakdown of user performance metrics and coding patterns over time.

Duration

1 month

Date

2025

Technologies

Next.js
Next.js
Go
Go
Redis
Redis
Socket.io
Docker
Docker
PostgreSQL
PostgreSQL
View Live