An online platform for submitting and evaluating code. This project uses PostgreSQL for the database, Docker for secure code execution, and local file storage for problem artifacts and user submissions.
This online judge allows users to:
- Submit code in multiple languages.
- Create problems and contests.
- Evaluate submissions in a secure, sandboxed environment using Docker.
- Store submissions and problem artifacts locally.
The problem creation page is intuitive for users familiar with standard online judge platforms.
- Backend: Spring Boot (Java), Maven
- Frontend: Vite + React (or other frontend framework)
- Database: PostgreSQL
- Code Execution: Docker containers
- Storage: Local file storage for submissions and problem data
-
Install PostgreSQL Download and install from PostgreSQL Official Site.
-
Set Environment Variables Create a
.envfile in the same directory asapplication.yml:DB_USERNAME=your_username DB_NAME=your_database_name DB_PASSWORD=your_password
-
Run Backend
cd backend ./mvnw spring-boot:run- The backend runs on localhost:8081 by default.
- To change the port, update
application.ymland also updatevite.config.jsin the frontend with the new backend IP/port.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Run the frontend:
npm run dev
- The frontend runs on localhost:5173 by default.
-
Build the Docker Image
docker build -t gcc-time:13 . -
Update Docker Image in Backend Open
cppExecutor.javaand ensure the image name/tag matches the one you built:// Example String dockerImage = "gcc-time:13";
-
Docker is used to securely execute user-submitted code in a sandboxed environment.
- Start PostgreSQL.
- Run backend:
./mvnw spring-boot:run(inside backend). - Run frontend:
npm run dev(inside frontend). - Ensure backend port matches frontend configuration (
vite.config.js).
-
Creating Problems and Contests Anyone can create problems or contests. The interface is intuitive and similar to other online judges.
-
Submitting Code Users can submit code to problems, which is executed in Docker containers for sandboxing.
-
Viewing Results Submission results and scores are displayed on the frontend in real-time.
-
Backend port:
application.yml(default 8081) -
Frontend backend URL:
vite.config.js -
Docker image name:
cppExecutor.java -
Local storage paths:
- Problem artifacts:
/uploads/problems/ - Submissions:
/uploads/submissions/This can be changed in application.yml file
- Problem artifacts: