The bald

Hello, I’m Nai Nai.

Spent a small half year, liver a management background rapid development of open source projects, hey hey.

The project address is:

  • Github:github.com/YunaiV/ruoy…
  • Gitee:gitee.com/zhijiantian…

Recently began to learn uniAPP, ready to micro letter small program to do a C end, hey hey.

Get a star, ok?

V1.0.0 update log

The first version, based on Ruoyi-Vue refactoring, mainly covers three aspects:

  • Refactoring of code
  • Technical selection adjustment
  • New background functions

Therefore, the v1.0.0 update log is written in these three areas.

Refactoring of code

  • Adjust the overall code structure, merge multiple Maven Modules into a single one, and use Java Package for separation and isolation, as shown in the figure. The reason: As the business logic becomes more complex, managing the dependencies of multiple Maven Modules can be a big problem.
  • Split the framework into multiple Maven modules, which are encapsulated and expanded according to different components such as Web, Security, MyBatis and Redis.
  • Based on JUnit5 and Mockito, the realization of unit testing, ensure the correctness of the function, and the maintainability of the code. Always automatic, straight!
  • Add SpringBoot multi-environment configuration files, complete deploy.sh deployment scripts, and Jenkins deployment tutorials.
  • Optimized code for Spring Security implementation permissions to improve readability and maintainability.
  • Add local caches (menus, roles, data dictionaries, and so on) to improve performance. Real-time refresh of the cache through Redis subscription publishing.
  • Add VO classes as response objects for API interfaces to avoid direct coupling of database entities to the front end.
  • Optimized operation logs to support reading Swagger as log content.
  • Optimizes scheduled tasks, supports retry of execution failures, and improves execution logging.
  • Optimized codeGen code generator to generate additional VO and unit test codes on the basis of Controller, Service, Mapper, database entity and Vue codes previously generated.
  • Adjust files to be stored in a database instead of a file system. The reason is that when a project deploys multiple service nodes, the files need to be synchronized. In the future, aliyun, Qiuniuyun and other storage cloud services will be added.
  • Remove the original database even table query, recursive query, changed to a single table operation, multiple read + memory splicing.
  • Optimize the format of Java code to solve the problem of IDEA code alarm.

New background functions

  • Add API access and exception logs to troubleshoot online API problems.
  • Added global error codes to manage service exceptions in a unified manner. The management background supports the management of error codes and the configuration of prompt documents.
  • Add SMS module, provide management of SMS channel, SMS template and SMS log, and connect with mainstream SMS platforms such as Aliyun and Yunbao.
  • Increase Redis Key management, know the format, data type, expiration time, description and other information of Redis Key used in the project.

Technical selection adjustment

  • Upgrade the Spring Boot version from 2.1.3 to 2.4.5.
  • Add BOM files to unify Maven dependency management.
  • MyBatis Plus component is introduced to simplify the use of MyBatis and improve the development efficiency.
  • Redisson components are introduced as clients of Redis to provide more powerful Redis operations.
  • The function of distributed message queue is realized based on Redis. Access Redis Pub/Sub to achieve broadcast consumption, access Redis Stream to achieve cluster consumption.
  • Removal of FastJSON, unified use of Jackson as JSON library, old explosion of security vulnerabilities sad.
  • MapStruct component is introduced to realize the transformation between database entities and VO classes.
  • Lombok components are introduced to generate common methods such as setters and getters to remove redundant code.
  • Spring Async is introduced to implement asynchronous tasks. For example, asynchronous logging of API access logs, administrator operation logs, and so on.
  • The magic changeApolloComponent, access to a local database, to achieve embedded configuration center. In layman’s terms, we can add the original toapplication.yamlChange the configuration item to add to the database, which the project starts to read.
  • The Hutool component was introduced to remove a large number of duplicate utility classes and avoid some of the original Util bugs.
  • Screw component is introduced to achieve the generation of database documents, although it seems to be less useful now.
  • EasyExcel is introduced to provide Excel import and export functions.
  • Implement Idempotent component, realize Idempotent function, can be used to resolve the problem of HTTP repeated requests.
  • The introduction ofLock4JTo realize the function of declarative distributed lock. Although Redisson has distributed locks built in, one is declared through annotations@Lock4jAnnotations can be used in a more convenient way and satisfy most scenarios.
  • Remove the original service monitoring and use SpringBoot Admin instead to provide more complete monitoring capabilities.
  • The SkyWalking component is introduced to realize the functions of link tracking and log service. Through link tracing, we can see the MySQL, Redis and other operations involved in an API request. With the logging service, we can easily see the logs of each service instance.
  • Introduce the Resilience4j component to realize the functions of current limiting and fusing to ensure the stability of the service.
  • Knife4j was introduced to beautify the interface documentation. Originally all API interface document is missing, already all completion, visible API – dashboard. Yudao. Iocoder. Cn/doc. HTML addresses.

Introduction of platform

Taro road, a set of open source enterprise rapid development platform, without reserve for personal and enterprise free use.

Any questions, or desired features, can be addressed to Nai in Issues.

  • Vue-element-admin is used at the front end.
  • The back-end uses Spring Boot, MySQL and Redis.
  • Permission authentication uses Spring Security & Token and supports multi-terminal authentication system.
  • Supports loading dynamic permission menu, easy permission control in multiple ways.
  • High efficiency development, the use of code generator can be a key to generate back and forth code.

The built-in function

Divided into three built-in functions:

  • System function
  • infrastructure
  • Research and development tool

Friendly tip: This project is modified based on Ruoyi-Vue, reconstructs and optimizes the back-end code and beautify the front-end interface.

For additional new features, we use the 🚀 tag.

🙂 All functions are unit tested to ensure high quality.

System function

function describe
User management The user is the operator of the system. This function is used to configure system users
Online users Active user status is monitored in the current system, and manual logout is supported
Role management Role Menu Permission assignment and setting Role Data scope permissions are divided by organization
Menu management Configure system menus, operation permissions, and button permissions
Department of management Configure the system organization (company, department, and group) to display data permissions in a tree structure
Post management Set the position of a system user
The dictionary management Maintenance of some relatively fixed data frequently used in the system
🚀 SMS management SMS channels, SMS templates, SMS logs, connect with Mainstream SMS platforms such as Ali Cloud and Cloud Chip
🚀 The operation log Normal operation logs of the system are recorded and queried. Swagger is integrated to generate logs
Log on to log System login logs are queried, including login exceptions
🚀 Error code Management You can manage all error codes in the system and modify error messages online without restarting the service
Announcements, System notices and bulletins are released and maintained

infrastructure

function describe
🚀 Configuration management Dynamically configure common parameters for the system and support SpringBoot loading
Timing task Online (add, modify, delete) task scheduling includes execution result logs
🚀 File service Supports local file storage, cloud services and open source components compatible with Amazon S3 protocols
🚀 The API log RESTful API access logs and exception logs help you troubleshoot API-related problems
MySQL monitor Monitor the current system database connection pool status and analyze SQL to find system performance bottlenecks
Redis monitoring Monitor the usage of Redis database, using Redis Key management
🚀 Java monitoring Implementation of Java application monitoring based on Spring Boot Admin
🚀 Link to track Access the SkyWalking component to achieve link tracking
🚀 Log center Access the SkyWalking component to realize the log center
🚀 A distributed lock Distributed lock based on Redis to meet concurrent scenarios
🚀 Power components such as Realize idempotent components based on Redis to solve the problem of repeated requests
🚀 Service guarantee Based on Resilience4j, the stability of the service is realized, including the functions of current limiting and fusing
🚀 The log service Lightweight log center for viewing logs from remote servers
🚀 Unit testing Unit test based on JUnit + Mockito to ensure the correctness of functions, code quality, etc

Research and development tool

function describe
🚀 Code generation Generation of front and back end code (Java, Vue, SQL, unit tests), support CRUD download
🚀 The system interface Automatically generate RESTful API documents based on Swagger
🚀 Database document Based on Screw automatically generate database documents, support export Word, HTML, MD format
The form building Drag the form element to generate the appropriate HTML code

Online experience

Demo address: dashboard. Yudao. Iocoder. Cn

  • Account password: admin/admin123

The document address: www.iocoder.cn/categories/…

  • How to Build an Environment

In the future, documents and videos will be added to facilitate fat friends to flush!

Technology stack

project instructions
yudao-dependencies Maven relies on version management
yudao-framework Java Framework Extension
yudao-admin-server Manage the server in the background
yudao-admin-ui Manage the UI interface in the background
yudao-user-server The server side of the user foreground
yudao-user-ui The UI interface of the user foreground

The back-end

The framework instructions version Study guide
Spring Boot Application Development Framework 2.4.5 The document
MySQL Database server 5.7
Druid JDBC connection pool, monitoring component 1. The document
MyBatis Plus MyBatis Enhancement Kit 3.4.1 track The document
Dynamic Datasource Dynamic data source 3.3.2 rainfall distribution on 10-12 The document
Redis The key – value database 5.0
Redisson Redis client 3.1.46 The document
Spring MVC The MVC framework 5.4.6 The document
Spring Security Spring Security Framework 5.4.6 The document
Hibernate Validator Parameter checking module 6.1.7 The document
Quartz Task scheduling component 2.3.2 The document
Knife4j Swagger enhances UI implementation 3.0.2 The document
Resilience4j Service Assurance Component 1.7.0 The document
SkyWalking Distributed application tracking system 8.5.0 The document
Spring Boot Admin Spring Boot monitoring platform 2.3.1 The document
Jackson JSON tool library 2.11.4
MapStruct Java Bean conversion 1.4.1 The document
Lombok Eliminate verbose Java code 1.16.14 The document
JUnit Java unit testing framework 5.7.1
Mockito Java Mock framework 3.6.28

The front end

The framework instructions version
Vue JavaScript framework 2.6.12
Vue Element Admin Back-end front-end solutions

Demo figure

System function

The module biu biu biu
Login & Home page
The user
Department & Position
Menus & Characters
The audit log
SMS
The dictionary
Error code & notification

infrastructure

The module biu biu biu
Files & Configuration
Timing task
The API log
MySQL & Redis
Monitoring platform

Research and development tool

The module biu biu biu
Code generation
The document