Computer Technology Course - Homework 2
This project is an online code judging platform, inspired by websites like Codeforces and Quera, where users can view questions, submit their solutions, and see the results of their submissions. The system provides functionalities such as user authentication, code submission handling, and an admin panel for managing questions.
- Users can register and log in.
- Passwords are securely stored in the database using bcrypt.
- There are two types of users: regular users and admin users. Admins can manage questions, change user roles, and perform other privileged actions.
- Proper role-based access control is implemented to ensure that only admins can see and use admin functionalities.
- Each user has a profile showing their activity, including statistics about their submissions.
- Admin users can change regular users’ roles (promote to admin or demote).
- Questions are listed by their publish date (newest first).
- Pagination is implemented for question listing, with 10 questions displayed per page.
- Admin users can create, edit, and publish questions.
- Questions have the following attributes: title, content (statement), time and memory limits, input/output data.
- Questions are initially in a draft state and can only be published by an admin.
- Users can submit solutions (written in Golang) to questions.
- Submissions go through a judging process, where the code is tested against predefined cases.
- The result of a submission can be one of the following: Correct (OK), Compile Error, Wrong Answer, Memory Limit Exceeded, Time Limit Exceeded, or Runtime Error.
- A dedicated "code-runner" service handles the execution of user-submitted code in isolated Docker containers.
- This service ensures security by limiting resource usage (CPU, memory) and disallowing network access for submitted code.
- The project uses Docker to containerize the application, including the code runner service.
- Docker Compose is used to set up an internal network that connects all necessary services: the main app, the database, and the code runner service.
- A script for load testing is used to simulate high traffic and ensure that the system handles large amounts of data and submissions efficiently.
- You can see load testing results from here!
The whole project was dissected into 7 phases:
- Frontend - Mohammad Barkatin implemented the frontend.
- Authentication - Mehdi Taheri handled the user authentication and session management.
- Database Design - Parisa Sadat Mousavi was responsible for designing the database schema.
- Implementing Site Services - Mehdi Taheri worked on implementing the core services of the site.
- Code Runner Service & Integration - Mohammad Barkatin and Mehdi Taheri developed and integrated the code runner service.
- Docker Deployment - This task remains to be completed.
- Database Population & Load Testing - Parisa Sadat Mousavi populated the database and conducted load testing.