Git Product home page Git Product logo

online-judge's Introduction

Online Judge

This web application is similar to an integration of LeetCode and Google Doc where people can edit code and evaluate the code together in real time.

Front End

The front end of the project uses Angular to create a signle page web app. The following are the details of the front end implementation.

User

  • There are two types of users. One kind is host which needs to register an account at the web app. The other kind is tourist which do not need an account.
  • The host can add and edit a question. The tourist needs the invitation code from the host in order to join the session to code together with the host. The invitation code can be found on the home page after the host login.

Editor

  • The editor in the front end uses the Ace Editor.
  • Each user can see the position of other users' caret. This is done through adding a fake caret for each joined user.
  • Uses socketIO to update the content in the editor to each user in real time. Thus, users can see the update immediately if anyone make an edition.
  • The users can load and save their code so that they do not need to start over next time

Evaluator

  • The users can submit their code to the evaluator and the running result of the code will be returned back and displayed under the editor.

Back End

The backend uses NodeJs and Express for the web server. For the code evaluator, it is a simple web server behind a docker container. The web server will receive the code and send back the result. The code will be directly run in the container.

Web Server

  • Create REST API for the front end to save code and evaluate code.
  • Use MongoDB to save the code and question a user has created.
  • Use socketIO to receive real time edition from one user and send the edition to the rest of users that are in the same session

Evaluator

  • A simple server using Flask to create a REST API to receive code to evaluate.
  • Create a subprocess to run the code and return the running result.
  • Using docker container because it can scale horizontally

Live Deployment

Live deployment on Heroku: https://infinite-brook-22446.herokuapp.com/

Might Take a little long to start up the first time for web server and evaluator due to limitation of Heroku

online-judge's People

Contributors

alanzhang88 avatar

Watchers

 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.