Giter Club home page Giter Club logo

goonlinejudge's Introduction

#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 and Arch Linux. Windows and Mac OS X are not recommended because RunServer cannot be built on both of them.

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.

Docker

docker build -t oj .
docker run --link your_mongo:mongodb --name oj  -e DATA_PATH=your_data_path -e JUDGE_HOST=your_judge_host -v your_data_path:your_data_path -d -p 80:8080 oj

If you installed mongodb on your host os, use script like this:

cat > env_file << EOF
MONGODB_USERNAME=test
MONGODB_PASSWORD=password
MONGODB_PORT_27017_TCP_ADDR=192.168.1.1
MONGODB_PORT_27017_TCP_PORT=27017
MONGODB_INSTANCE_NAME=test
DATA_PATH=your_data_path
JUDGE_HOST=your_judge_host
EOF

docker run --env-file env_file --name oj -v your_data_path:your_data_path -d -p 80:8080 oj

Quick Start

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

####via curl

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

####via wget

wget 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
  • 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"

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

##Contributions

##License See LICENSE

goonlinejudge's People

Contributors

sakeven avatar clarkzjw avatar memelee avatar micln avatar bitdeli-chef avatar

Watchers

James Cloos avatar Max avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.