Skip to content

A full-stack Online Judge (OJ) platform where users can participate in contests, solve problems, and submit code securely inside a sandboxed environment.

Notifications You must be signed in to change notification settings

lugnitdgp/Online-Judge-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

oj

Online-Judge-2.0

A full-stack Online Judge (OJ) platform where users can participate in contests and submit code securely inside a sandboxed environment.


OJ Architechture

OJ_ARCH

Tech Stack

  • Frontend: Next.js (React-based UI framework)
  • Backend: Go (Echo framework)
  • Worker: Go (Worker pool for code execution)
  • Code Execution: isolate (Secure sandboxing of untrusted code)
  • Message Broker: RabbitMQ (Message broker for worker pool)

Features

  • User registration and authentication using JWT
  • Contest and problem management
  • Secure code execution via isolated worker pool
  • RESTful API design with Echo
  • PostgreSQL (optional) support via GORM ORM

Prerequisites

  • Go v1.23+Install Go
  • Node.js v20+ – for frontend
  • Docker (optional) – for local containerized setup
  • isolate – installed on the host (Linux only)

Development guide

Make sure all dependencies are installed.

Clone the repo:

git clone https://github.com/lugnitdgp/Online-Judge-2.0.git

Frontend

  • Use node v20+ (you can use nvm to change node version)
nvm use 20
  • Set environment variables (refer to .env.example)

  • Get inside frontend directory, install dependencies and run frontend

cd frontend
npm install
npm run dev

Backend

  • Use Go v1.23+

  • Set environment variables (refer to .env.example)

  • Get inside backend directory, run backend

cd backend
go mod tidy
go run server.go

Worker

  • Install Isolate locally (Linux machine)

  • Remove sudo temporarily by adding this line to your visudo

<username> ALL=(ALL) NOPASSWD: ALL
  • Get inside worker directory and run worker
cd worker
go mod tidy
go run worker.go

Contribution Guide

Always use atomic commit messages (monorepo best-practice) create PR against the main branch.

  • e.g. [Area]: [Component/file]: Context in one line

© GNU/Linux User's Group, NIT Durgapur

About

A full-stack Online Judge (OJ) platform where users can participate in contests, solve problems, and submit code securely inside a sandboxed environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •