D-OnlineJudge is a full-stack online coding and competitive programming platform built with Java Spring Cloud microservices architecture and Vue 3 frontend framework.
It provides a secure, scalable, and feature-rich environment for programming competitions, code submissions, and real-time verdict feedback.
- ποΈ Microservices Architecture: Spring Cloud-based modular design with independent deployable services, high cohesion, and loose coupling
- π Secure Sandbox Environment: Docker containerization provides isolated execution environments to prevent malicious code attacks
- β‘ Asynchronous Judging: Redis task queues + RabbitMQ event-driven architecture for high-performance, non-blocking code execution
- π Enterprise-Grade Authentication: Long-lived and short-lived token mechanism (Access Token + Refresh Token) with Redis-backed session management
- π Full-Stack Observability: SkyWalking distributed tracing, Prometheus metrics monitoring, and Loki log aggregation for complete system visibility
- π Automated CI/CD Pipeline: GitHub Actions workflow for continuous integration, building, and deployment
- π Intelligent Full-Text Search: Elasticsearch with IK Chinese tokenizer for millisecond-level problem search
- πΎ Three-Tier Cache Architecture: Local cache (Caffeine) + distributed cache (Redis) + database, dramatically reducing database load
- π Real-Time WebSocket Notifications: Global push system for real-time verdict feedback without page blocking
- π‘οΈ Traffic Management: Alibaba Sentinel integration for rate limiting, circuit breaking, and system protection
This guide will help you set up and run D-OnlineJudge locally. Follow the steps below.
Ensure you have the following software installed:
| Software | Version | Purpose |
|---|---|---|
| JDK | 17+ | Backend compilation and runtime |
| Maven | 3.6+ | Project build tool |
| Docker | 20.10+ | Containerization |
| Docker Compose | 1.29+ | Container orchestration |
| Git | 2.0+ | Version control |
| Node.js | 16+ (optional) | Frontend development |
| Pnpm | 8+ (optional) | Frontend package manager |
git clone https://github.com/yourusername/D-OnlineJudge.git
cd D-OnlineJudgeWe provide complete Docker Compose configurations to start all dependencies with a single command:
# Create Docker network
docker network create doj
# Start all core services (MySQL, Redis, RabbitMQ, Nacos, Elasticsearch, etc.)
# For detailed commands, see docs/0.build.md section "2. Deploying Core Dependency Services"- Access Nacos console:
http://localhost:8848/nacos(default:nacos/nacos) - Navigate to "Configuration Management" β "Configuration List"
- Create the following shared configuration files:
| Data ID | Description |
|---|---|
shared-jdbc.yaml |
Database and cache connection settings |
shared-swagger.yaml |
API documentation and logging config |
shared-jwt.yaml |
JWT authentication key configuration |
shared-rabbitmq.yaml |
RabbitMQ message queue settings |
π‘ Configuration templates are available in
docs/0.build.mdsection "2.8 Adding Shared Configurations to Nacos".
Execute the following command in DOJ-BE/common/src/main/resources/:
keytool -genkeypair -alias decade -keyalg RSA -keysize 2048 \
-validity 365 -keypass doj123 -keystore doj.jks -storepass doj123cd DOJ-BE
mvn clean installOpen a separate terminal for each microservice and start them in order:
# 1. Start Gateway Service
java -Dhttp.proxySet=false -Dhttps.proxySet=false \
-jar gateway-service/target/gateway-service-1.0-SNAPSHOT.jar
# 2. Start User Service
java -Dhttp.proxySet=false -Dhttps.proxySet=false \
-jar user-service/target/user-service-1.0-SNAPSHOT.jar
# 3. Start Problem Service
java -Dhttp.proxySet=false -Dhttps.proxySet=false \
-jar problem-service/target/problem-service-1.0-SNAPSHOT.jar
# 4. Start Submission Service
java -Dhttp.proxySet=false -Dhttps.proxySet=false \
-jar submission-service/target/submission-service-1.0-SNAPSHOT.jar
# 5. Start Sandbox Service
java -Dhttp.proxySet=false -Dhttps.proxySet=false \
-jar sandbox-service/target/sandbox-service-1.0-SNAPSHOT.jarπ― Verify Backend Startup:
- Check Nacos service list:
http://localhost:8848/nacosshould show all services in healthy status- Access API documentation:
http://localhost:8080/doc.htmlshould display all service endpoints
cd DOJ-FE
# One-click build, package, and start (grant execute permission once)
chmod +x run-docker.sh
./run-docker.sh
# Application will start at http://localhost:8088This script automatically:
- β
Executes
pnpm buildto generate static files - β
Builds Nginx image based on
Dockerfile - β Stops old container and starts new one
- β
Maps port
8088 β 80
cd DOJ-FE
# Install dependencies
pnpm install
# Start development server with hot reload
pnpm dev
# Access at http://localhost:5173Once all services are running successfully, access them via:
| Component | URL | Description |
|---|---|---|
| Frontend Application | http://localhost:8088 |
Online coding competition platform |
| API Documentation | http://localhost:8080/doc.html |
Knife4j Swagger documentation |
| Nacos Console | http://localhost:8848/nacos |
Service registry and configuration |
| SkyWalking UI | http://localhost:9999 |
Distributed tracing (optional) |
| Grafana Dashboard | http://localhost:3000 |
Metrics monitoring and alerting (optional) |
| Kibana Logs | http://localhost:5601 |
Log aggregation and analysis (optional) |
| Pillar | Technology | Purpose |
|---|---|---|
| Traces | Apache SkyWalking | "What did the request experience?" - Link visualization, performance analysis |
| Metrics | Prometheus + Grafana | "How is the system performing?" - Real-time monitoring and alerting |
| Logs | Loki + Promtail | "What happened?" - Log aggregation and troubleshooting |
# Start SkyWalking
docker-compose -f docker-compose-skywalking.yml up -d
# Access at http://localhost:9999
# Start Prometheus + Grafana + Loki
docker-compose -f docker-compose-monitoring.yml up -d
# Access Grafana at http://localhost:3000 (admin/admin)For detailed setup, see docs/0.build.md section "4. Building the Observability Platform".
# Start all backend microservices (dependencies must be started first)
docker-compose -f docker-compose-service.yml up -d
# Start frontend application
cd DOJ-FE && ./run-docker.sh
# View running containers
docker ps# Build multi-language code execution environments
docker build -t code-runner-cpp -f docs/Dockerfile.cpp .
docker build -t code-runner-java -f docs/Dockerfile.java .
docker build -t code-runner-python -f docs/Dockerfile.python .We welcome all forms of contributions!
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
For questions, suggestions, or feedback, please reach out through:
- GitHub Issues: Submit an Issue
- Discussions: GitHub Discussions
Special thanks to the following open-source projects for their inspiration and support
β If this project helps you, please give it a Star! β

