Clash of Bytes is a fun, competitive coding platform where users can create and solve challenges in two exciting modes:
- ⚡ Speed Mode: Compete for fastest execution time (measured on our backend using Docker)
- ✂️ Char Mode: Solve the problem using the fewest characters
Each day, a community-submitted challenge is featured. Users can create puzzles, vote on them, submit creative solutions, and climb the leaderboard.
- Submit your own coding puzzles (with input/output & test cases)
- Solve puzzles directly in the browser with the Monaco editor
- Solutions are executed safely on the backend inside Docker containers
- Automatic execution time tracking (for Speed Mode)
- Code character counting (for Char Mode)
- Voting system for puzzles and solutions
- Daily featured challenge
| Layer | Tech |
|---|---|
| Frontend | Next.js + Monaco Editor |
| Backend | Next.js Actions + Docker container runner |
| Database | PostgreSQL via Prisma ORM |
| Code Execution | Dockerized runtimes |
git clone https://github.com/programordie2/clash-of-bytes.git
cd clash-of-bytesbun installOr use yarn or npm if you prefer.
Rename the .env.example to .env file in the root and fill out the required environment variables.
See the comments in the file for details.
Note: you will need a PostgreSQL database, if you haven't installed one yet, check out this guide: PostgreSQL Installation Guide.
bun prisma push dbMake sure you have Docker installed and running. The code execution is sandboxed using Docker containers. To install docker, follow the instructions on the official Docker website.
cd sandbox
cd py
docker build -t my-python-runner .
cd ../js
docker build -t my-javascript-runner .bun devThe backend runs submitted code securely inside a Docker container. Currently supports:
- Python 3
- JavaScript (Node.js)
Execution is isolated per test case per request using short-lived containers. Each puzzle defines input/output test cases, and the runner compares results and tracks performance metrics.
Each puzzle must include:
- A title and description
- Example input/output
- At least one test cases
| Mode | Description |
|---|---|
| Speed | Solutions ranked by execution time |
| Least Chars | Solutions ranked by character count |
- All code execution is done inside tightly sandboxed Docker containers
- No code is executed directly in the main app process
- Puzzle discussion threads
- AI puzzle quality checker
Pull requests welcome! If you'd like to submit your own challenge logic or improve the code execution runner, feel free to fork and go wild.
MIT: use it, fork it, remix it.