Skip to content

overFloweee/OJ-evaluate-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OJ Evaluate Cloud

Java Spring Boot License: MIT

OJ Evaluate Cloud is an open-source online judge backend built with Java, Spring Boot, Spring Cloud Alibaba, Nacos, RabbitMQ, Redis, MySQL, and Docker Compose.

The project is designed for students and developers who want to learn how an online judge system works in practice: problem management, code submission, asynchronous judging, code sandbox execution, result evaluation, and service-to-service collaboration.

中文说明:这是一个开源 OJ 判题评测云后端项目,用于学习和实践在线评测系统、代码沙箱、异步判题、微服务拆分和后端工程化。

Highlights

  • Microservice architecture: user service, question service, judge service, gateway, API client, shared model, and code sandbox service.
  • Online judge workflow: problem creation, code submission, queue-based judging, sandbox execution, and judge result persistence.
  • Code sandbox integration: isolates code execution behind a dedicated sandbox service interface.
  • Async judge pipeline: RabbitMQ-based message flow for judge task dispatch and acknowledgement.
  • Cloud-native local setup: MySQL, Redis, Nacos, and RabbitMQ can be started with Docker Compose.
  • Learning-friendly design: architecture diagrams and module boundaries are kept explicit for developers studying OJ systems.

Architecture

System architecture

OJ Evaluate Cloud Architecture

Judge module and code sandbox

Judge and Code Sandbox

Judge sequence diagram

Judge Sequence Diagram

Judge strategy pattern

Judge Strategy Pattern

Code sandbox template method pattern

Code Sandbox Template Method Pattern

Repository structure

.
├── evaluate-api-client              # Feign/API client shared by services
├── evaluate-code-sandbox-service    # Code sandbox execution service
├── evaluate-common                  # Shared common utilities
├── evaluate-gateway                 # Spring Cloud Gateway entry point
├── evaluate-judge-service           # Judge orchestration service
├── evaluate-model                   # Shared domain models and DTOs
├── evaluate-question-service        # Problem and submission service
├── evaluate-user-service            # User service
├── mysql-init                       # Database initialization scripts
├── docker-compose.env.yml           # MySQL / Redis / Nacos / RabbitMQ
└── docker-compose.service.yml       # Application services

Tech stack

Area Technology
Language Java 8
Framework Spring Boot 2.6.13
Microservices Spring Cloud, Spring Cloud Alibaba, Nacos, OpenFeign
Gateway Spring Cloud Gateway
Database MySQL, MyBatis-Plus
Cache / session Redis, Spring Session
Messaging RabbitMQ
Deployment Docker Compose
API docs Knife4j / Swagger

Quick start

Prerequisites

  • JDK 8
  • Maven 3.6+
  • Docker
  • Docker Compose V2

1. Clone the repository

git clone https://github.com/overFloweee/OJ-evaluate-cloud.git
cd OJ-evaluate-cloud

2. Build the project

mvn -DskipTests package

If Maven dependency download is slow, configure a nearby Maven mirror in your local settings.xml.

3. Start infrastructure services

docker compose -f docker-compose.env.yml up -d

This starts the required local infrastructure, including MySQL, Redis, Nacos, and RabbitMQ.

4. Start application services

docker compose -f docker-compose.service.yml up -d

5. Check container status

docker stats

If a service fails to start, you can run it in the foreground to inspect logs. For example:

docker compose -f docker-compose.service.yml up evaluate-gateway

Default service ports

Service Port Context path
Gateway 8101 /
User service 8102 /api/user
Question service 8103 /api/question
Judge service 8104 /api/judge
Code sandbox service 8105 /api/codesanbox

Related repositories

Current status

This project is an early-stage open-source learning and infrastructure project. The next maintenance focus is to improve documentation, add automated tests, harden the code sandbox boundary, and make the deployment process easier for new contributors.

See ROADMAP.md for the planned work.

Contributing

Contributions are welcome. You can help by improving documentation, fixing bugs, adding tests, simplifying deployment, or improving the judge and sandbox workflow.

Please read CONTRIBUTING.md before opening an issue or pull request.

Security

Code execution is a sensitive area. If you find a security issue related to sandboxing, command execution, authentication, or data isolation, please follow SECURITY.md.

License

This project is licensed under the MIT License.

About

Open-source online judge evaluation cloud with Java, Spring Boot, microservices, RabbitMQ, Docker Compose, and a code sandbox workflow.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors