Skip to content
/ Judge1 Public

Judge1 is a code execution engine that can run C++, JavaScript, and Python code in a containerized manner.

Notifications You must be signed in to change notification settings

AFZL210/Judge1

Repository files navigation

Judge1

Judge1 is a code execution engine that can run C++, JavaScript, and Python code in a containerized manner.

Logo

Features

  • Sandboxed compilation and execution
  • Scalable architecture
  • Support for C++, Python and JavaScript (More coming soon!)
  • Webhooks (HTTP callbacks)
  • Detailed execution results

System Design

Benchmark

Executing 100 codes in 10 seconds. The performance is not very good because of Docker startup time. The system is not suitable for building a problem-solving platform like LeetCode but can be used to build contest-based sites like Codeforces and CodeChef.

2024-12-30.18-23-03.mp4

Get Started

Judge1 is an experimental code execution engine inspired by Judge0. It is not currently intended for production use, but you can self-host it for small-scale purposes.

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

DATABASE_URL - PostgreSQL database connection string

TOP_SECRET - JWT Secret (base64 string)

REDIS_HOST - Redis server hostname

REDIS_PORT - Redis server PORT number

NODE_ENV - PROD (Production) or DEV (Development)

HTTP_SERVER_PORT - Main server PORT (default - 8080)

Installation

We recommend using Linux/MacOS or Windows with WSL2 for an easy setup.

  • Docker support will be added soon! (Feel free to contribute 😊)

Clone the repository

  git clone https://github.com/AFZL210/Judge1.git

Provide execution permissions to server and worker scripts

chmod u+x scripts/server.sh
chmod u+x script/worker.sh

Run the server and worker

./scripts/server.sh
./scripts/worker.sh

Done! The server will start on port 8080.

Authors

About

Judge1 is a code execution engine that can run C++, JavaScript, and Python code in a containerized manner.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published