Skip to content

An online judge developed using ReactJS as frontend and Django REST API framework as backend.

Notifications You must be signed in to change notification settings

nvatuan/DOnlineJudge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOJ - DOnlineJudge

This project was developed mainly for educational/experimental purpose, if you want an OJ to set-up or for a more full-fledged and well-documented OJ, please refer to the followings:

  1. DMOJ Suitable for system that will be public and will serve many user because of their great permission controls and optimization. Although to set up a running server there is some trouble you have to go through
  2. CMS, DOMjudge Well-known and very stable system for contest creation/management such as IOI and ICPC.
  3. QingdaoU Online Judge A simple OJ but very functional, can be run in production and set-up in seconds with Docker technology. Can be a good starting point to developing an OJ.
DOnlineJudge's Logo

A modern online judge that is developed using ReactJS and Django REST API Framework. Our motive is To further understand about Online Judges, we have built our own OJ system, taking a different technical approach when compare to others.

See it in action here.

Features

The current version consists of a small set of functionality, though very necessary and allows us to demonstrate the core features our system can do.

  • A bulletin board to post announcements
  • Rich problem statements, with support for LaTeX math
  • Support popular programming language: C, C++, Python, Java
  • Rich, comprehensive submission status page
  • Great Permission controls for staffs

Screenshots

Front Page

  • Greeting message and the system's bulletin board.

Front page

Problems

  • Rich Search, Filtering tools to help finding the correct problem.

Problem

  • Supports LaTex for better paragraph styling and math expression

Problem Details

Submission Status

  • Rich Search and Filtering tools

Status

  • Comprehensive Submission details

Status Detail

Staff Page

The DOJ admin interface is versatile, and can be efficiently used for anything from managing users to authoring problem statements, auditting submissions,..

  • Admin dashboard with useful information and a Control Panel (on the left side)

Admin Dash

  • Control what is public via Visibility

Admin Announcement

  • Easy-to-use, friendly interface

Admin Problem Create

  • Control over submissions

Admin Submission

Installation

Our project has 3 components that you will need to run separately:

Web-server (build folder)

This is our site, we will need to serve this folder. One simple way to do it is to install npm module express, then place the following script serve.js in the same folder with the build folder. And start the server with node serve.js.

serve.js
var path = require('path');
var express = require('express');
var app = express();

app.use(express.static(path.resolve(__dirname, 'build')));
app.get('*', (req, res) => {
    res.sendFile(path.resolve(__dirname, 'build', 'index.html'));
});

var server = app.listen(8080)

API Server (donlinejudge folder)

For this, we need Python 3.8's django module. There are some more dependencies we have yet to note it down, but you can install them as you go because django will let you know what you are missing. Also, the backend uses Postgresql (version 13), make sure you install it as well. To start the backend, run the following commands:

  1. Migrate the database if you haven't:
python manage.py makemigrations
python manage.py migrate
  1. Start the backend
python manage.py runserver 0.0.0.0:5000

Will run the API server on port 5000.

Judge Server (dockerjudge folder)

We have yet to document the dependencies, some major ones you will need are:

  • Docker engine
  • websockets module Then download the dockerjudge folder and run this command from the parent directory:
python -m dockerjudge 127.0.0.1:5001

This command will run it as an module, start the judge server and listening to port 5001. Though the module needs some time to warm up first (initialize the Docker containers).

Technical/System Analysis

For more information, (eg. how our system was built, and how it performs,...) you can check them here (.PDF).

Development branches

  • For DOJ's website interface related issues, please refer to dev-frontend
  • For DOJ's webserver-related issues, please refer to dev-backend
  • For DOJ's Judge Server related issues, please refer to judgeserver