RuoYi-Vue Documentation

repository·master·Indexed 25 days ago

https://github.com/yangzongzhuan/ruoyi-vue

A rapid development framework for enterprise-level management systems using Spring Boot for the backend and Vue for the frontend. It features a modular architecture with built-in support for RBAC, code generation, system monitoring, and dynamic permission menus. The framework supports multiple versions, including Spring Boot 2.x, 3.x, and 4.x, as well as Vue 2 and Vue 3 (JavaScript and TypeScript) frontend options.

Tokens
11K
Snippets
10
Records
81
Agent score
82%

What's inside RuoYi-Vue

  1. Overview of RuoYi-Vue Framework

    master

    RuoYi-Vue is an open-source rapid development framework based on a Spring Boot and Vue frontend-backend separation architecture. It is designed for high-efficiency development and provides a complete set of management features out of the box.

    Core Technology Stack:

    • Frontend: Vue, Element UI
    • Backend: Spring Boot, Spring Security, Redis, and JWT
    • Authentication: JWT (supports multi-terminal authentication)
    • Permissions: Supports dynamic permission menus and multiple methods of access control.
    • Code Generation: Includes a code generator to automatically produce both frontend and backend code (Java, HTML, XML, SQL) for CRUD operations.
  2. Explore built-in RuoYi-Vue features

    master

    RuoYi-Vue comes with several built-in modules for system management and monitoring:

    • User & Organization Management: User management, Department management (tree structure with data permissions), and Post management.
    • Access Control: Menu management (permissions/button identifiers), Role management (data scope partitioning), and Dictionary management.
    • System Configuration: Parameter management and Notification/Announcement management.
    • Logging & Monitoring: Operation logs, Login logs, Online user monitoring, Service monitoring (CPU, Memory, Disk, Stack), Cache monitoring, and Connection pool monitoring (SQL performance analysis).
    • Task & Automation: Scheduled tasks (with execution logs), Code generation (CRUD support), and System API documentation generation.
    • Utilities: Online builder (HTML generation via drag-and-drop form elements).
  3. Setup and run the RuoYi-Vue frontend development environment

    master

    To set up the local development environment for the ruoyi-ui project, clone the repository, install dependencies using npm, and start the development server.

    Note on dependency installation: It is recommended to avoid using cnpm as it may cause unexpected bugs. If npm is slow, use the official npmmirror registry instead.

  4. Select the appropriate RuoYi-Vue backend version

    master

    The backend project maintains multiple parallel branches based on Spring Boot versions. Choose the branch that matches your required JDK and Spring Boot version:

    Branch NameDescriptionRepository Link
    master (Default)Spring Boot 4.x (Requires JDK 17+)Link
    springboot3Spring Boot 3.x (Requires JDK 17+)Link
    springboot2Spring Boot 2.x (Requires JDK 8+)Link
  5. Build RuoYi-Vue for staging or production environments

    master

    Use the following commands to build the project for different deployment environments:

    • Staging Environment: Use npm run build:stage to generate builds for testing/staging.
    • Production Environment: Use npm run build:prod to generate optimized builds for production.
  6. Select the appropriate RuoYi-Vue frontend version

    master

    The frontend project offers several versions depending on your preference for Vue versions, scripting languages, and build tools. You can mix and match these with the corresponding backend branches.

    Project NameFrontend FrameworkScripting LanguageBuild ToolUI LibraryState ManagementRouter
    RuoYi-VueVue 2JavaScriptVue CLIElement UIVuexVue Router 3
    RuoYi-Vue3Vue 3JavaScriptViteElement PlusPiniaVue Router 4
    RuoYi-Vue3-TypeScriptVue 3TypeScriptViteElement PlusPiniaVue Router 4
  7. Install the DictData component plugin

    master
    The DictData component provides a way to handle dictionary data (labels and values) within Vue components. It integrates with the Vuex store to cache dictionary data and uses the getDicts API to fetch missing data. To use it, call the install method, which registers the plugin with Vue and configures default metadata for dictionary lookups.
  8. Install custom Vue directives

    master

    To use the built-in custom directives in your Vue application, import the default export and call the install function, passing your Vue instance. This registers the following directives globally:

    • v-hasRole: Permission control based on user roles.
    • v-hasPermi: Permission control based on specific permissions.
    • v-clipboard: Facilitates clipboard operations.
    • v-dialogDrag: Enables dragging for dialog components.
    • v-dialogDragWidth: Enables resizing the width of dialog components.
    • v-dialogDragHeight: Enables resizing the height of dialog components.
  9. Use the ThemePicker component to change application colors

    master

    The ThemePicker component provides a UI interface (using el-color-picker) that allows users to select a new primary color for the application. When a color is selected, the component dynamically updates the application's CSS styles by calculating a color cluster (tints and shades) and replacing existing color values in the document's style tags. It also fetches the base theme-chalk CSS to ensure consistency.

    Key behaviors:

    • Automatic Updates: It watches the theme value and triggers setTheme automatically.
    • State Integration: It reads the initial theme from the Vuex store at this.$store.state.settings.theme.
    • Event Emission: Emits a change event with the new color value when the theme is updated.
    <template>
      <ThemePicker />
    </template>