Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


write Code then Submit

codeSubmit is an online judge for programming assignments. It is initially developed to support the online course taught by Dr. Wong Tsz Yeung at CUHK, see the course here.

Besides this online judge, there is also a platform for students to program game playing AI and compete with each other. See aimole.




You are recommended to deploy on ubuntu because the prepared scripts are written for environment of ubuntu machines.

On the ubuntu machine, run shellscripts/npm/ to install all the required packages. These includes docker, node.js and npm dependencies of codeSubmit.

codeSubmit persists data on MongoDB and queues jobs on RabbitMQ. To spin them up, you can run shellscripts/docker/mongodb/ and shellscripts/docker/rabbitmq/

And then, configure codeSubmit by modifying configs/*

To spin up codeSubmit admin for production use, run shellscripts/docker/production/

To spin up codeSubmit student for production use, run shellscripts/docker/production/

To spin up codeSubmit worker for production use, run shellscripts/docker/production/

For deploying more instances on multiple machines, run the corresponding [admin, student, worker] script with an extra argument of master ip. E.g. shellscripts/docker/production/ to spin up a worker with databases connecting to Same for codeSubmit admin and codeSubmit student.

Database maintenance

There is only one source to maintain, that is MongoDB.

You can have two ways to backup the database, one is through GUI, another is using crontab to save to AWS S3 regularly.


MongoChef is a GUI client of MongoDB. You can use the export feature to backup MongoDB. Next time you want to restore it, you can drop the existing database and then import the one you exported before.


Detailed instruction is in here.


To spin up all the stuffs for development, run shellscripts/docker/codesubmit/ This will spin up a MongoDB, RabbitMQ, codeSubmit admin, codeSubmit student and codeSubmit worker. And watch for file changes to restart all three codeSubmit instances (admin, student and worker).

To spin up things individually:

Run shellscripts/docker/mongodb/ for MongoDB. Run shellscripts/docker/rabbitmq/ for RabbitMQ. And you can monitor RabbitMQ via visiting http://localhost:15672.

To watch changes and livereload for admin, run grunt and visit http://localhost:8000 To watch changes and livereload for student, run grunt student and visit http://localhost:8001 To watch changes and livereload for worker, run grunt worker


All the user submitted code are running inside sandbox environment. For each code execution, codeSubmit will spawn docker instances to run the compilation and execution process. This isolates each submission as well as providing security to the host.

This sandbox is a sub-project of Dr. Wong Tsz Yeung's students' final year project. You can find its docker hub repository here.


This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see


online judge platform






No releases published


No packages published