# oj **Repository Path**: weiyuexin/oj ## Basic Information - **Project Name**: oj - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-09 - **Last Updated**: 2026-05-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OJ Online Judge System An Online Judge system developed with Go + React, supporting code submission, automated judging, rankings, and more. ## Project Overview This project is a fully-featured Online Judge system designed with a microservices architecture, comprising core components such as a user-facing frontend, an admin panel, and a judging service. The system supports online evaluation of multiple programming languages and is suitable for programming practice and contest organization. ## Technology Stack ### Backend - **Language**: Go 1.22 - **Framework**: Gin - **Database**: PostgreSQL - **Cache**: Redis ### Frontend (User Interface) - **Framework**: React 18 + TypeScript - **Styling**: TailwindCSS - **Build Tool**: Vite - **State Management**: Zustand ### Judging Service - **Language**: Go - **Sandbox**: Docker ### Admin Panel - **Frontend Framework**: Vue 3 - **UI Components**: Element Plus ## Features ### User Interface - User registration and login - Problem browsing and search - Online code submission - Real-time judging status - Submission history query - Personal ranking - Personal profile ### Admin Panel - Problem management (create, edit, delete) - User management (permission settings, bans) - Submission history viewing - System announcement publishing - Data analytics dashboard ### Judging System - Multi-language support (C, C++, Java, Python, etc.) - Docker-based sandbox isolation - Memory and time limits - Test case management ## Quick Start ### Prerequisites - Docker >= 20.10 - Docker Compose >= 2.0 - Linux server (Ubuntu 20.04+ recommended) ### Deployment Steps 1. Clone the project to your server: ```bash git clone https://gitee.com/weiyuexin/oj.git /opt/oj cd /opt/oj ``` 2. Configure environment variables: ```bash cp .env.example .env # Edit the .env file to set required environment variables ``` 3. Generate JWT key: ```bash openssl rand -base64 32 ``` 4. Start all services: ```bash docker-compose up -d ``` 5. Access the system: - User Interface: http://your-server-ip - Admin Panel: http://your-server-ip/admin - Default admin account: admin / admin123 ## Project Structure ``` oj/ ├── backend/ # Backend API service │ ├── cmd/ # Entry point │ ├── internal/ # Internal packages │ │ ├── config/ # Configuration loading │ │ ├── handler/ # HTTP handlers │ │ ├── middleware/# Middleware │ │ ├── model/ # Data models │ │ └── service/ # Business logic ├── frontend/ # User frontend │ └── src/ │ ├── api/ # API requests │ ├── components/# Common components │ ├── pages/ # Page components │ ├── store/ # State management │ └── types/ # Type definitions ├── judger/ # Judging service │ ├── internal/ │ │ ├── db/ # Database operations │ │ └── sandbox/ # Docker sandbox ├── gva-admin/ # Admin panel │ ├── server/ # Backend API │ └── web/ # Vue frontend └── docker/ # Docker configurations ``` ## Common Commands ```bash # Check service status docker-compose ps # View logs docker-compose logs -f # Restart services docker-compose restart # Stop services docker-compose down # Update deployment git pull docker-compose up -d --build ``` ## Judging Status Codes | Code | Description | |------|-------------| | 0 | Waiting for judgment | | 1 | Compiling | | 2 | Running | | 3 | Accepted | | 4 | Wrong Answer | | 5 | Time Limit Exceeded | | 6 | Memory Limit Exceeded | | 7 | Runtime Error | | 8 | Compilation Error | | 9 | System Error | | 10 | Output Limit Exceeded | ## Supported Programming Languages - C (gcc) - C++ (g++) - Java (OpenJDK 21) - Python 3 - Go - JavaScript (Node.js) ## Configuration Details Key Environment Variables: | Variable Name | Description | Default Value | |---------------|-------------|---------------| | DB_HOST | Database address | postgres | | DB_PORT | Database port | 5432 | | DB_USER | Database user | oj | | DB_PASSWORD | Database password | - | | DB_NAME | Database name | oj | | REDIS_HOST | Redis address | redis | | REDIS_PORT | Redis port | 6379 | | JWT_SECRET | JWT secret key | - | | JUDGE_SECRET | Judging service secret key | - | ## License This project is intended solely for learning and communication purposes. For commercial use, please contact the author for authorization. ## Acknowledgments Thank you to all developers who have contributed code to this project.