• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GoOnlineJudge

GoOnlineJudge

GoOnlineJudge is an ACM/ICPC online judge platform.

Demo

Contents

Installation

Prerequisites

Disclaimer:

GoOnlineJudge works best on GNU/Linux and has been tested on Ubuntu 14.04+. Windows and Mac OS X are not recommended because RunServer cannot be built on both of them.

Docker

If you are Windows or Mac OS X user, you can try out docker-oj, based on docker image and works out of the box.

Quick Start

Be careful! This section might be out-of-date. Always check the Manual Installation guide for your safety.

GoOnlineJudge is installed by running the following commands in your terminal. You can install it via the command-line with curl.

via curl

curl -sSL https://raw.githubusercontent.com/ZJGSU-Open-Source/GoOnlineJudge/master/install.sh | sh

Manual Installation

Dependences

  • Go

    • GoOnlineJudge is mainly written in Go.
    • Get Go from golang.org
  • MongoDB

    • MongoDB is a cross-platform document-oriented databases.
    • Get MongoDB from MongoDB.org
  • mgo.v2

    • mgo.v2 offers a rich MongoDB driver for Go.
    • Get mgo.v2 via
    go get gopkg.in/mgo.v2
    
    • API documentation is available on godoc
  • flex

    • flex is the lexical analyzer used in RunServer.
    • Get flex using following command if you are running Ubuntu.
    sudo apt-get install flex
  • SIM

    • SIM is a software and text similarity tester. It's used in RunServer.
    • SIM is shipped along with RunServer.
  • GCC

    • The GNU compiler Collection.
    • Get GCC from GNU or using following command if you are running Ubuntu
    sudo apt-get install build-essential
  • OpenJDK

    • OpenJDK is Oracle's implementation of the next version of the Java SE platform.
    • OpenJDK is used to judge Java code.
    sudo apt-get install openjdk-7-jdk
  • iconv-go

    • iconv-go provides iconv support for Go.
    • Get iconv-go via
    go get github.com/djimenez/iconv-go
    

Install

Obtain latest version via git, source codes will be in your $GOPATH/src.

git clone https://github.com/ZJGSU-Open-Source/GoOnlineJudge.git $GOPATH/src/GoOnlineJudge
git clone https://github.com/ZJGSU-Open-Source/RunServer.git $GOPATH/src/RunServer
git clone https://github.com/ZJGSU-Open-Source/vjudger.git $GOPATH/src/vjudger
git clone https://github.com/sakeven/restweb.git $GOPATH/src/restweb
# Set $OJ_HOME variable
export OJ_HOME="yourself oj home" #e.g. export OJ_HOME=/$GOPATH/src
export DATA_PATH=$OJ_HOME/Data
export LOG_PATH=$OJ_HOME/log
export RUN_PATH=$OJ_HOME/run
export JUDGE_HOST=your_judge_host #e.g. export JUDGE_HOST="http://127.0.0.1:8888"
export MONGODB_PORT_27017_TCP_ADDR=127.0.0.1
export PATH=$PATH:$GOPATH/bin

# directory for MongoDB Data
mkdir $OJ_HOME/Data

# directory for problem set
mkdir $OJ_HOME/ProblemData

# directory for running user's code
mkdir $OJ_HOME/run

# directory for log
mkdir $OJ_HOME/log

Make sure you have these directories in your $GOPATH/src:

github.com/  
GoOnlineJudge/  
RunServer/  
gopkg.in/  
restweb/  

And these directories in your $OJ_HOME:

ProblemData/  
run/  
log/  

Now, it's time for compilation.

cd $GOPATH/src/restweb
go install ./...
cd $GOPATH/src
restweb build GoOnlineJudge
cd $GOPATH/src/RunServer
./make.sh

Start OJ

RunServer&
cd $GOPATH/src
restweb run GoOnlineJudge &

Now,you can visit OJ on http://127.0.0.1:8080.

Tips

  • You should always run MongoDB first then followed by OJ.

  • Running web server at 80 port requires administrator privileges. For security reasons, do not run our OJ at 80 port.

  • If you want to visit OJ at 80 port, nginx, the HTTP and reverse proxy server is recommended.

Maintainers

  • memelee

  • sakeven

  • clarkzjw

  • rex-zed

Roadmap

  • Binary packaging on mainstream distributions
  • Maybe a built-in simple blog
  • Rebase RESTful API
  • Modern design front-end

Contributions

License

See LICENSE