An online platform for organising timed contests and practising programming problems by checking code on certain constraints such as time, space, and correctness.
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.
- HTML
- CSS
Bootstrap
Bootstrap is a CSS Framework for developing responsive and mobile-first websites.
This question can have two percepective which is -
- Why to use Bootstrap?
- Why Bootstrap not Foundation or Pure?
Reference: Bootstrap vs Foundation
Javascript
Javascript is a programming language for web which can update and change both HTML and CSS.
- For submitting code asynchronously.
- For updating the submmision results asynchronously.
ReactJS
React is a JavaScript library that builds user interfaces for single-page applications by dividing UI into composable components.
- 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
Django
Django is a high-level python web framework that encourages rapid Development and clean, pragmatic design.- 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?
MySQL
MySQL is a open-source relational database management system. 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?
Github
- Python 3 (Installation)
- Pip 3 (Installation)
- Pipenv (Installation)
- NPM (Installation)
- Git (Installation)
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
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
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 = ''
- Contribution Guidelines
- Screenshots & Videos