How yangzongzhuan/ruoyi-vue works
Main Components
• Frontend Component: Represented by the ruoyi-ui module. This layer is built using Vue and Element UI. It handles user interactions, routing, and visualization.
• Backend Component: This is subdivided into several modules:
• ruoyi-admin: Contains the main Spring Boot application entrypoints, web controllers (e.g., common, monitor, system, tool) and servlet initializers.
• ruoyi-system: Manages system-level domain entities and services (e.g., user management, department management, menu management, etc.).
• ruoyi-framework: Houses core configurations, aspects (such as logging, data source, security), interceptors, and common manager/utility classes. It is the backbone that all other modules leverage.
• ruoyi-common: Provides shared libraries (POJOs, utility classes, exception handling, annotations, filters) that are used across other backend modules.
• ruoyi-generator: Offers functionality to automatically generate code (controller, domain, mapper, service, etc.) for CRUD operations.
• ruoyi-quartz: Implements scheduling jobs and task configurations using Quartz, including job log recording.
• External Services & Integrations:
• Spring Security & JWT: For permission control and authentication.
• Redis: Used for caching and managing session/auth token data.
• Database: Though not explicitly shown, typical MySQL or other RDBMS connections are managed via MyBatis configurations.
• Possibly external configuration and logging services as evident from the presence of logback and Spring Boot configuration files.
Relationships and Interactions
• The ruoyi-ui (frontend) sends API requests (HTTP/REST) to backend endpoints provided by modules like ruoyi-admin.
• The backend architecture is layered:
• Controller Layer: Handles incoming requests (organized in multiple packages under ruoyi-admin, ruoyi-system, etc.).
• Service Layer: Implements business logic; these are coordinated by components in ruoyi-framework and ruoyi-common.
• Persistence Layer: Uses MyBatis in combination with XML/annotation-based mappers to interact with the database.
• Security is integrated across controllers and services via Spring Security configurations and JWT-based filters (handled in ruoyi-framework).
• The ruoyi-generator module, while a standalone functionality, can be seen as a utility that helps generate code for other parts of the system.
• The ruoyi-quartz module triggers scheduled tasks that may interact with various parts of the system (logging, notifications, etc.).
Important Architectural Patterns & Design Principles
• Multi-Module Maven Project: Each module handles a specific concern (core framework, system management, code generation, scheduling).
• MVC Pattern: Controllers, services, and DAOs are clearly separated within the backend modules.
• Separation of Concerns: There is a clear division between frontend (ruoyi-ui) and backend services.
• Use of Aspect-Oriented Programming (AOP): Aspects used for logging, data source management, rate limiting, etc.
• Security & Caching: Implementation of JWT for authentication and Redis for caching.