RuoYi-Vue-Plus Documentation

repository·6.X·Indexed 25 days ago

https://github.com/dromara/ruoyi-vue-plus

An enhanced, rewritten version of the RuoYi-Vue framework designed for distributed cluster environments. Built with JDK 21/25 and Spring Boot 4.1, it features a plugin-based architecture, Vue3 + TS + ElementPlus frontend, and high-performance components like Jetty, Sa-Token, and Mybatis-Plus. It includes built-in support for distributed locks (Lock4j), task scheduling (SnailJob), file storage (Minio/RustFS), and advanced data security features such as masking and encryption.

Tokens
4.1K
Snippets
9
Records
17
Agent score
81%

What's inside RuoYi-Vue-Plus

  1. Overview of RuoYi-Vue-Plus

    6.X

    RuoYi-Vue-Plus is a comprehensive rewrite of the original RuoYi-Vue framework, specifically upgraded for distributed cluster scenarios.

    Key Information:

    • Compatibility: It is NOT compatible with the original RuoYi-Vue framework due to the architectural rewrite.
    • Licensing: The code and documentation are open-source, free, and available for commercial use, provided the original license files are retained in your project.
    • Core Tech Stack: Built with Spring Boot 4.1 (as per badges), JDK 21, and JDK 25.
    • Frontend Options: While the official frontend is plus-ui, community members have also provided versions based on vben5 and soybean frameworks.
  2. Compare RuoYi-Vue-Plus with standard RuoYi

    6.X

    RuoYi-Vue-Plus extends the standard RuoYi functionality with several advanced business features. Key differences include:

    • Client Management: Supports managing all integrated clients (e.g., PC, Mini-programs) with dynamic login methods (SMS, password) and dynamic token expiration control.
    • File Management: Includes built-in file display, upload, download, and deletion, along with dynamic configuration management for file storage.
    • Advanced Scheduled Tasks: Supports full task management (add, modify, delete), log management, and executor management (standard RuoYi only supports task and log management).
    • Multi-DataSource Code Generation: Supports generating frontend and backend code (Java, HTML, XML, SQL) for multiple data sources with CRUD download capabilities.
    • Enhanced Service Monitoring: Provides cluster-level monitoring for CPU, memory, disk, stack, online logs, and Spring configurations (standard RuoYi is limited to single-machine monitoring).
    • Use Case Demonstrations: Includes built-in functional case studies.
  3. Compare RuoYi-Vue-Plus with standard RuoYi

    6.X

    RuoYi-Vue-Plus is an enhanced version of the RuoYi framework designed for higher performance, better extensibility, and modern development standards. Key improvements include:

    • Frontend: Rewritten with Vue3 + TS + ElementPlus (vs Vue2/3 + JS).
    • Backend Architecture: Uses a plugin-based and extension-pack structure for decoupling, making it easier to extend compared to the tightly coupled modules in standard RuoYi.
    • Web Container: Uses Jetty (based on Netty) for high performance instead of Tomcat.
    • Security & Auth: Uses Sa-Token and Jwt for low-coupling and high extensibility, supporting complex permission expressions (e.g., AND, OR, Permission OR Role). It also includes JustAuth for third-party logins (WeChat, DingTalk, etc.).
    • Database & ORM: Uses Mybatis-Plus for near-zero SQL writing and provides advanced features like automatic SQL monitoring, seamless data permission filtering via annotations, and support for multiple heterogeneous data sources via dynamic-datasource.
    • Distributed Capabilities: Built-in support for Distributed Locks (Lock4j), Distributed Task Scheduling (SnailJob), Distributed File Storage (Minio/RustFS), and Distributed Sessions/WebSocket/SSE.
    • Data Security: Features built-in support for Data Masking, Data Encryption/Decryption (AES, RSA, SM2, etc.), and Interface Transmission Encryption (Dynamic AES + RSA).
    • Observability: Integrated with SpringBoot-Admin for service monitoring and Apache SkyWalking for distributed tracing.
    • Developer Experience: Includes a code generator that supports Mybatis-Plus and SpringDoc, supports Docker orchestration for one-click environment setup, and provides comprehensive demo cases.
  4. Set permissions for the Redis data directory

    6.X

    When using the Dockerized Redis setup, you must ensure the data directory has sufficient permissions to allow the Redis process to write data. If permissions are not set correctly, Redis will fail to persist data. Execute the following command on the host directory mapped to /docker/redis/data:

    chmod 777 /docker/redis/data
  5. Configure MySQL via Docker Compose

    6.X

    The mysql service uses mysql:8.4.9. Key configuration options include:

    • MYSQL_ROOT_PASSWORD: Sets the root password (default: root).
    • MYSQL_DATABASE: The initial database name to create (default: ry-vue).
    • TZ: Sets the timezone (e.g., Asia/Shanghai).

    Volumes:

    • Data: /docker/mysql/data/ maps to /var/lib/mysql/.
    • Config: /docker/mysql/conf/ maps to /etc/mysql/conf.d/.

    Default Command Arguments:

    • --character-set-server=utf8mb4
    • --collation-server=utf8mb4_general_ci
    • --explicit_defaults_for_timestamp=true
    • --lower_case_table_names=1
    mysql:
        image: mysql:8.4.9
        container_name: mysql
        environment:
          TZ: Asia/Shanghai
          MYSQL_ROOT_PASSWORD: root
          MYSQL_DATABASE: ry-vue
        ports:
          - "3306:3306"
        volumes:
          - /docker/mysql/data/:/var/lib/mysql/
          - /docker/mysql/conf/:/etc/mysql/conf.d/
        command:
          --character-set-server=utf8mb4
          --collation-server=utf8mb4_general_ci
          --explicit_defaults_for_timestamp=true
          --lower_case_table_names=1
        privileged: true
        network_mode: "host"
  6. Configure SnailAI Server via Docker Compose

    6.X

    The ruoyi-snailai-server provides AI capabilities. When using network_mode: "host", it accesses external services via the host's ports.

    Environment Variables:

    • SNAIL_AI_RAG_DOCLING_ENABLED: Enables/disables Docling (default: true).
    • SNAIL_AI_RAG_DOCLING_URL: URL for Docling service (default: http://127.0.0.1:5100).
    • SNAIL_AI_RAG_DOCLING_PADDLE_OCR_ENABLED: Enables/disables PaddleOCR (default: true).
    • SNAIL_AI_RAG_DOCLING_PADDLE_OCR_URL: URL for PaddleOCR service (default: http://127.0.0.1:8866/ocr).

    Ports:

    • 8900 and 18888.

    Volumes:

    • Logs: /docker/snailai/logs/ maps to /ruoyi/snailai/logs.
    ruoyi-snailai-server:
        image: ruoyi/ruoyi-snailai-server:6.0.0
        container_name: ruoyi-snailai-server
        environment:
          TZ: Asia/Shanghai
          SNAIL_AI_RAG_DOCLING_ENABLED: ${SNAIL_AI_RAG_DOCLING_ENABLED:-true}
          SNAIL_AI_RAG_DOCLING_URL: ${SNAIL_AI_RAG_DOCLING_URL:-http://127.0.0.1:5100}
          SNAIL_AI_RAG_DOCLING_PADDLE_OCR_ENABLED: ${SNAIL_AI_RAG_DOCLING_PADDLE_OCR_ENABLED:-true}
          SNAIL_AI_RAG_DOCLING_PADDLE_OCR_URL: ${SNAIL_AI_RAG_DOCLING_PADDLE_OCR_URL:-http://127.0.0.1:8866/ocr}
        ports:
          - "8900:8900"
          - "18888:18888"
        volumes:
          - /docker/snailai/logs/:/ruoyi/snailai/logs
        privileged: true
        network_mode: "host"
  7. Configure MinIO via Docker Compose

    6.X

    The minio service uses a community-maintained image pgsty/minio:RELEASE.2026-04-17T00-00-00Z.

    Environment Variables:

    • MINIO_ROOT_USER: Admin username (default: ruoyi).
    • MINIO_ROOT_PASSWORD: Admin password (minimum 8 characters, default: ruoyi123).
    • MINIO_COMPRESS: Enables/disables compression (on or off).
    • MINIO_COMPRESS_EXTENSIONS: List of extensions to compress (e.g., .pdf,.doc). Leave empty to compress all types.
    • MINIO_COMPRESS_MIME_TYPES: List of MIME types to compress (e.g., application/pdf). Leave empty to compress all types.
    • MINIO_SERVER_URL: (Optional) Set the HTTPS domain for the API.
    • MINIO_BROWSER_REDIRECT_URL: (Optional) Set the HTTPS domain for the Console.

    Ports:

    • API: 9000
    • Console: 9001

    Volumes:

    • Data: /docker/minio/data maps to /data.
    • Config: /docker/minio/config maps to /root/.minio/.
    minio:
        image: pgsty/minio:RELEASE.2026-04-17T00-00-00Z
        container_name: minio
        ports:
          - "9000:9000"
          - "9001:9001"
        environment:
          TZ: Asia/Shanghai
          MINIO_ROOT_USER: ruoyi
          MINIO_ROOT_PASSWORD: ruoyi123
          MINIO_COMPRESS: "off"
          MINIO_COMPRESS_EXTENSIONS: ""
          MINIO_COMPRESS_MIME_TYPES: ""
        volumes:
          - /docker/minio/data:/data
          - /docker/minio/config:/root/.minio/
        command: server --address ':9000' --console-address ':9001' /data
        privileged: true
        network_mode: "host"
  8. Configure RuoYi Server instances

    6.X

    The ruoyi-server services (e.g., ruoyi-server1, ruoyi-server2) use the image ruoyi/ruoyi-server:6.0.0. Each instance can be configured with unique ports via environment variables.

    Environment Variables:

    • SERVER_PORT: The main application port (e.g., 8080, 8081).
    • SNAIL_JOB_PORT: Port for SnailJob integration (e.g., 28080, 28081).
    • SNAIL_AI_PORT: Port for SnailAI integration (e.g., 38080, 38081).
    • TZ: Timezone (e.g., Asia/Shanghai).

    Volumes:

    • Logs: /docker/serverX/logs/ maps to /ruoyi/server/logs/.
    ruoyi-server1:
        image: ruoyi/ruoyi-server:6.0.0
        container_name: ruoyi-server1
        environment:
          TZ: Asia/Shanghai
          SERVER_PORT: 8080
          SNAIL_JOB_PORT: 28080
          SNAIL_AI_PORT: 38080
        volumes:
          - /docker/server1/logs/:/ruoyi/server/logs/
        privileged: true
        network_mode: "host"
  9. Default JVM Configuration in ry.bat

    6.X

    When starting the application via the ry.bat script, the following JVM parameters are applied to ruoyi-admin.jar:

    • -Dname=ruoyi-admin.jar
    • -Duser.timezone=Asia/Shanghai
    • -Xms512m (Initial heap size)
    • -Xmx1024m (Maximum heap size)
    • -XX:MetaspaceSize=128m
    • -XX:MaxMetaspaceSize=512m
    • -XX:+HeapDumpOnOutOfMemoryError
    • -XX:+UseZGC (Uses the Z Garbage Collector)
    set JVM_OPTS="-Dname=%AppName%  -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC"
  10. Manage AggregateLambdaQueryWrapper state

    6.X

    The AggregateLambdaQueryWrapper maintains an internal state for the appended SQL. You can manage this state using:

    • resetAggregateSelect(): Clears the appended aggregate SQL, reverting the SELECT clause to the default entity fields.
    • clear(): Overrides the base clear() method to reset both the query conditions and the appended aggregate SQL.