Putong Online Judge v2
(For version 1, please visit here)
Preview
Demo (Test Account: 123456 / 123456)
Documentation
Currently Not available
Features
- Built on Docker -- One click Deployment
- Single Page Application -- Better User Experience
- Support multiple cases of test data
- Powered by Vue.js, Koa.js, MongoDB, Redis
Delpoyment
Note: This project is still during BETA
stage
Docker
- clone this project
git clone https://github.com/acm309/PutongOJ.git PutongOJ
- compose up
docker-compose up
or
daemon mode
docker-compose up -d
It will listen on 80 ports after it is successfully deployed. Then you can directly visit this platform.
Enjoy it!
Manual Installation
Ubuntu is recommended. You can deploy this platform on other linux, but I can't ensure it must work.
apt-get install libcairo2-dev libpango1.0-dev build-essential
- clone this repo
git clone https://github.com/acm309/PutongOJ.git
- install project dependencies
npm i -g yarn
yarn
- setup database connections
export variables
export redisURL='your redis url'
export dbURL='your mongodb url'
update config/index.js
const prod = {
port: 3000 // the port the application will listen on
}
- setup static files and judger
node manager.js
pm2.config.json
would be generated.
- start
install pm2 first
npm i -g pm2
then start with pm2
pm2 start pm2.config.json
Migration
Know the Container Id
of the mongodb container by running:
docker ps
dump
Replace <Container id>
with the real id of your running mongodb container
docker exec -it <Container id> mongodump --out /data/backup --db oj
The output data will be stored at migrations/backup/
restore
docker exec -it <Container Id> mongorestore --db oj --drop /data/backup/oj
static files
copy files to public
folder
Replace <Container id>
with the real id of your running oj container
docker cp <SRC_PATH> <Container Id>:/app/public
Browser Support
- IE: NOT recommended
- Chrome: 50 or above is recommended
- Firefox: 50 or above is recommended
- Edge: recommended