- Project Overview
- Features
- Tech Stack
- Prerequisites
- Installation
- Project Structure
- Contributing
- License
This project is a Codeforces clone that provides an online platform for competitive programming. Built with React and Express, it allows users to submit code for various problems, which are then executed securely in containerized Docker instances. The platform includes user authentication, problem creation, real-time code execution, and results display, creating an environment similar to popular coding platforms like Codeforces and CodeChef.
- User Authentication: Secure JWT-based user authentication with session management using Recoil.
- Problem Management: Administrators can create problems with details like title, description, constraints, and sample inputs/outputs.
- Code Submission and Evaluation: Users can submit code in multiple programming languages for execution in Docker containers.
- Real-Time Feedback: Code is queued, executed in containers, and results (success/failure, runtime, memory usage) are displayed to users in real-time.
- Problem Difficulty: Problems are categorized by difficulty levels to help users choose challenges.
- Dockerized Code Execution: Each code submission is executed inside isolated Docker containers to ensure security and consistency.
- React.js (with TypeScript)
- Tailwind CSS (for styling)
- Recoil (for state management)
- Shadcn
- Node.js with Express.js
- MySQL with Sequelize ORM
- Docker (for containerized code execution)
- RabbitMQ for queueing submissions/runs
- JWT for Authentication
- WebSockets for real-time notifications of code execution results
Before running the application, ensure you have the following installed:
- Node.js (v14+)
- Docker
- MySQL
- RabbitMQ
- Clone the repository:
git clone https://github.com/your-username/codeforces-clone.git cd codeforces-clone - Install Dependencies:
cd client npm install # Install backend dependencies cd ../server npm install - Environmental Configuration:
cp .env.example .env - Start the Services:
- Ensure Docker is running
- Start RabbitMQ service
- Start MySQL service
- Run The Application:
npm run dev # Start backend worker (in server directory) npm run worker
The project has the following folder structure:
client: Contains the React frontend application.server: Contains the backend API and Docker-related services.
Once the application is running, users can:
- Register and Log in to the platform.
- Browse and submit code for different programming problems.
- View real-time execution results such as success, failure, runtime, and memory usage.
- Create and manage problems (for admins only).
This project uses Docker to isolate and securely execute code submissions. Each submission is run in a separate Docker container to prevent security issues and ensure consistency in execution.
We welcome contributions! Please fork this repository, make your changes, and submit a pull request. Make sure to follow the coding standards and write tests for new features or bug fixes.