Skip to content

Latest commit

 

History

110 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Online Judge Project

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.


Table of Contents

  1. Project Overview

  2. Technologies Used

  3. Developer Setup

  4. Running the Application

  5. User Guide

  6. Configuration


Project Overview

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.


Technologies Used

  • 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

Developer Setup

Backend Setup

  1. Install PostgreSQL Download and install from PostgreSQL Official Site.

  2. Set Environment Variables Create a .env file in the same directory as application.yml:

    DB_USERNAME=your_username
    DB_NAME=your_database_name
    DB_PASSWORD=your_password
  3. Run Backend

    cd backend
    ./mvnw spring-boot:run
    • The backend runs on localhost:8081 by default.
    • To change the port, update application.yml and also update vite.config.js in the frontend with the new backend IP/port.

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Run the frontend:

    npm run dev
    • The frontend runs on localhost:5173 by default.

Docker Setup

  1. Build the Docker Image

    docker build -t gcc-time:13 .
  2. Update Docker Image in Backend Open cppExecutor.java and ensure the image name/tag matches the one you built:

    // Example
    String dockerImage = "gcc-time:13";
  3. Docker is used to securely execute user-submitted code in a sandboxed environment.


Running the Full Application

  1. Start PostgreSQL.
  2. Run backend: ./mvnw spring-boot:run (inside backend).
  3. Run frontend: npm run dev (inside frontend).
  4. Ensure backend port matches frontend configuration (vite.config.js).

User Guide

  • 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.


Configuration

  • 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

About

Custom Online Judge built with Spring Boot, Docker, and PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages