Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

An Online Coding Judge to compile/run programs of various programming languages

License

Notifications You must be signed in to change notification settings

devashish42/Online_Coding_Judge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Judge

Github licence Generic Badge Generic Badge Generic Badge

About Problem

An online platform for organising timed contests and practising programming problems by checking code on certain constraints such as time, space, and correctness.

Features

REST API for running, and testing the code with custom input.
A RESTful API for running and testing code in various programming languages.
Supported Programming Languages -
  • C / C++ (Language Code: 001)
  • Java (Language Code: 002)
  • Python (Language Code: 003)
REST API for fetching current and previous contests.
REST API for fetching questions for contest id.
REST API for testing code in a programming language on open test-cases of a problem.
REST API for submitting code for a problem of a contest / practice.
Practice will also be a type of contest which have a very large end time. Due to which we will have the Leaderboard for overall Practice. Kind of All time Leaderboards.
Also it must have a feature of generating shortend URL of the submission Link. If the submitted solution is not submitted to a current ongoing contest.
REST API for signing up or signing in for the users.
REST API for contributing problems to the Coding_Judge.
REST API for fetching leaderboard of a contest.

Technology Stack

Front-end Technologies

  • HTML
  • CSS
Bootstrap

What is Bootstrap?

Bootstrap is a CSS Framework for developing responsive and mobile-first websites.

Why Bootstrap?

This question can have two percepective which is -

  • Why to use Bootstrap?
  • Why Bootstrap not Foundation or Pure?
Why to use Bootstrap?
To make the web-app responsive and mobile-friendly.
Why Bootstrap not Foundation or Pure?
The main advantage of Foundation or Pure over Bootstrap is that they are more customizable over Bootstrap. But in this project most of the users will visit from PC due to which the Bootstrap is the best choice for responsive and mobile-first website.
Reference: Bootstrap vs Foundation

Javascript

What is Javascript?

Javascript is a programming language for web which can update and change both HTML and CSS.

Why Javascript?

  • For submitting code asynchronously.
  • For updating the submmision results asynchronously.
ReactJS

What is React?

React is a JavaScript library that builds user interfaces for single-page applications by dividing UI into composable components.

Why React?

  • Fast Rendering of web-pages using virtual DOM - Web-pages rending is a critical major task of the project as per percepective of performance./li>
  • Abstraction - Not Exposing complex internals of the code to the user.
  • Reusable Components - There are lots of places where the same components of the webpage can be used.
    For Example:
    • Coding Environment on the Practice page / Contest page.
    • Problems Addition page as a individual component / on addition of a problem for a contest.

Reference: Reasons to use React

Back-end Technology

Django

What is Django?

Django is a high-level python web framework that encourages rapid Development and clean, pragmatic design.

Why Django?

  • Scalable & Reliable - It's been 13 years Django started developing its framework
  • Secure - As it have inbuilt authentication, authorization and session management which makes it secure.
  • In-built Admin.
  • MVC Architecture

Reference: Why Django?

Database

MySQL

What is MySQL?

MySQL is a open-source relational database management system.

Why MySQL?

To understand the fact that why we have chosen MySQL over MongoDB or Cassandra. We have to understand CAP Theorem.
CAP Theorem: CAP theorem stands for "Consistency", "Availability", and "Partition Tolerance". According to CAP Theorem we can choose any two things at a time in a database. That is either "CP", "AP", or "CA" and for each of these type of the these we have several database from which we can choose.
  • CP: MongoDB
  • CA: MySQL
  • AP: Cassandra


As in our project the consistency and availability are the most important factor because there will be several users which will hit at the same time during the contest due to which the availability of the website is important. For Short-contest the updatation of the submission results should be consistent as much as possibile.
For Example: Let's say the database is replicated into two parts that is A and B. Their is a user named "X" who submitted the solution for some problem after which a Docker Container is created for running the code into an isolated environment. After successfully running the code, the results are updated to the database replica A. But due to inconsistency issue in the database it is not updated on the database replica B. Due to which the submission results are not getting updated on the user-end. Therefore, consistency is very important for our system.
Reference: What is CAP Theorem?

Version Control

Github

ER Diagram

ERD

Pre-requisites of Project

Installation of Project

Clone the Repository

To clone the repository open the terminal and run below command:

git clone https://github.com/arch888/Coding_Judge

Change the current directory to the project directory:

cd Coding_Judge

Install Dependencies

Django Dependencies

To create a fresh virtual environment run the below command in the terminal:

pipenv shell .

To install the django dependencies run the below command in the terminal:

pipenv install

Setting up Database

Create a file name Coding_Judge/db_conf.py to store the configuration of the local Database:

touch Coding_Judge/db_conf.py

Variables in the configuration file should be:

DBNAME = 'database_name'
DBUSER = 'username'
DBPASSWORD = 'password'
DBHOST = '127.0.0.1'
DBPORT = ''

More to Cover

  • Contribution Guidelines
  • Screenshots & Videos

About

An Online Coding Judge to compile/run programs of various programming languages

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages