Watch full working Video of Project: 🔗Click Here.
Website: https://www.online-judge.online/
The inspiration for this project came from the desire to create an interactive platform where programmers of all levels can practice and improve their coding skills. Inspired by popular competitive programming platforms like Codeforces, LeetCode, and HackerRank, this project aims to provide a comprehensive and user-friendly environment for learning, practicing, and competing in coding challenges.
The primary goal of this project is to create a robust, scalable, and user-friendly online judge system that caters to the needs of both learners and experienced programmers. The platform is designed to:
- Enhance Coding Skills: Provide a wide range of problems that help users improve their problem-solving and coding skills.
- Facilitate Learning: Offer features like sample test cases and detailed feedback to help users understand and learn from their mistakes.
- Support Multiple Languages: Enable users to write and test their code in various programming languages including C++, Java, C, and Python.
- Provide Secure and Reliable Execution: Ensure that user code is executed in a secure, controlled, and reliable environment with proper handling of different execution scenarios like runtime errors and time limit exceeded (TLE) conditions.
- Secure user login and session management using
JSON Web Tokens (JWT) and Cookie-based Authentication.
- Ensures that all forms are properly validated on the client and server sides.
- Allows users to reset their passwords via email using the
Nodemailer
library.
- Only admin users can create, update, and delete problems, as well as host contests.
- Lists all available problems. Users can select a problem to view details, run code, and submit solutions.
- Users can submit solutions in C++, Java, C, or Python.
- Isolates the execution environment of the submitted code, ensuring secure and consistent execution without affecting the host system using
Docker
. - Executes submitted code against sample and hidden test cases.
- Provides immediate feedback on submissions (e.g., Accepted, Wrong Answer, Runtime Error, Time Limit Exceeded).
- Dependencies:
uuid, fs, path, child_process
- Clears input, code, and output files created during execution every three hours to keep the application light using
node-cron
dependency.
- Users can participate in ongoing contests and view the leaderboard at the end of the contest.
- Node.js: JavaScript runtime for server-side development.
- Express.js: Web framework for building the backend APIs.
- MongoDB: NoSQL database for storing user data, problems, and contest information.
- Mongoose: ODM library for MongoDB.
- Docker: Used to run submitted code in isolated containers.
- UUID: For generating unique identifiers.
- fs, path: File system and path manipulation.
- child_process: Node.js module for executing system commands.
- Nodemailer: For sending password reset emails.
- React: JavaScript library for building user interfaces.
- React Router (react-router-dom): Library for handling client-side routing.
- Axios: Promise-based HTTP client for making API requests.
- Hooks: Used for managing state and side-effects
- Props: For passing data between components
- State: For managing component state
- react-simple-code-editor: For building the code editor interface
- Fork this project by clicking the Fork button on top right corner of this page.
- Clone the repository by running following command in git:
git clone https://github.com/yourusername/online-judge.git
- Go into the backend folder and install dependency:
cd "Online-Judge\backend"
npm install
- Go to the compiler folder and install dependency:
cd "Online-Judge\compiler"
npm install
- Go to the frontend folder and install dependency:
cd "Online-Judge\frontend"
npm install
Start the backend server:
nodemon App.js
Start the compiler server:
nodemon App.js
Start the frontend server
npm run dev