Enter the Arena. Code your Destiny.
CodeVerse is a futuristic, real-time competitive coding platform designed for 1v1 battles. It connects developers in a virtual arena where they can challenge opponents to solve algorithmic problems under time pressure. Featuring a sleek, glassmorphism-inspired UI and seamless real-time synchronization, CodeVerse transforms standard coding practice into an intense e-sport experience.
Github link = https://github.com/Naman37B/CodeVerse
- 1v1 Duels: Create private rooms and invite friends using a unique Room Code.
- Live Synchronization: Powered by Socket.io, battle states (timers, scores, and submission verdicts) are synced instantly between players.
- Dynamic Problem Set: Fetches real coding problems from the Codeforces API (Ratings 800-1200) or uses a robust fallback set if the API is unavailable.
- Immersive UI: Custom particle background effects, neon aesthetics, and glassmorphism design.
- Interactive Feedback: Anime.js animations for smooth transitions and alerts.
- Live Leaderboard: Real-time tracking of solved problems and penalties during the match.
- JSON-Based Persistence: Lightweight, file-based database system for users, battles, and leaderboards (no external database setup required).
- Automated Judging Simulation: Simulates a judging environment where submissions are verified against Codeforces user status (polling mechanism).
Frontend
- HTML, CSS
- JavaScript
- Socket.io Client - Real-time events
Backend
- Node.js - Runtime environment
- Express.js - Web framework
- Socket.io - WebSocket server
- Node-fetch - API requests
Follow these steps to get CodeVerse running locally on your machine.
Ensure you have Node.js (v14 or higher) installed.
git clone [https://github.com/naman37b/codeverse.git](https://github.com/naman37b/codeverse.git)
cd codeverseNavigate to the backend folder and install the required packages:
cd backend
npm installYou can run the server in development mode (with nodemon) or standard mode:
# Development mode (auto-restarts on changes)
npm run dev
# OR Standard start
npm startThe server will start on http://localhost:5000.
- Access the App: Open your browser and go to
http://localhost:5000. - Sign Up / Login: Create a user account. Provide your real Codeforces Handle during signup to allow the system to track your actual submissions on Codeforces.
- The Lobby:
- Create Battle: Generates a Room Code. Share this with a friend.
- Join Battle: Enter a Room Code to connect to an existing lobby.
- The Battle:
- Once both players join, the battle begins!
- Solve the 3 provided problems on Codeforces.
- The system polls your Codeforces account status to verify submissions.
- Scoring:
- Problem 1: 100 pts
- Problem 2: 150 pts
- Problem 3: 200 pts
- Penalty: -20 pts per wrong submission.
- Victory: The battle ends when time runs out or both players solve all problems.
codeverse/
├── .gitignore # Git ignore configuration
├── README.md # Project documentation
│
├── backend/
│ ├── data/
│ │ ├── battles.json # Storage for active and past battles
│ │ └── users.json # Storage for user credentials
│ ├── package.json # Backend dependencies and scripts
│ ├── package-lock.json # Dependency lock file
│ └── server.js # Main server entry point & Socket.io logic
│
└── frontend/
├── auth.css # Styles for Login/Signup pages
├── battle.css # Styles for the Battle Arena
├── battle.html # Battle Arena HTML structure
├── battle.js # Battle logic (timer, fetching problems)
├── leaderboard.html # Leaderboard page HTML
├── lobby.css # Styles for the Lobby
├── lobby.html # Lobby page HTML
├── lobby.js # Lobby logic (create/join rooms)
├── login.html # Login page HTML
├── particles.js # Background particle animation script
├── script.js # Global scripts (Leaderboard fetch & Socket init)
├── script1.js # Auth scripts (Login/Signup fetch logic)
├── signup.html # Signup page HTML
└── style.css # Global styles