It will be National Day soon after the Mid-Autumn Festival. During the holiday, I began to exchange technology with chedan friends. Low code was mentioned a lot, mainly from JEECG-boot and AMIS.


preface

Perhaps many programmers can’t use low-code platform in their work, but I think playing with a low-code platform and learning the technology stack of low-code platform can improve my technical reserve systematically. 1. Low code platform usually provides a complete set of solutions, involving workflow, reports, front and back end environment and deployment, data center, distributed lock, mobile payment, SMS verification code platform access, etc. It is a very good choice to use low code platform as a technology learning and practice application platform; 2. Learn advanced application of low code platform to programming language; 3. The full table design and template code generation provided by the low-code platform also helped reduce rework.


Concepts and Features

A low code development platform (LCDP) is a development platform that generates applications quickly with no coding (zero code) or with a small amount of code. The visual approach to application development enables developers of all levels of experience to create Web and mobile applications using drag-and-drop components and model-driven logic through a graphical user interface. While the official name of the Low Code Development Platform (LCDP) was not officially established until June 2014, the entire field of low code development can be traced back even further to fourth-generation programming languages and rapid application development tools. (From Baidu Encyclopedia)


Through the interpretation of the introduction of Baidu Encyclopedia, low code platform needs to have the following characteristics:

  • 0 code or a small amount of code to quickly generate applications
  • Provide visual interface for program development
  • Use drag and drop operations to build the client

Based on these characteristics, we can understand what constitutes a low-code platform, and thus what low-code can do. Mybatis plus, which is very popular in our development, can be called a low code persistence framework if platform is thrown out, because frameworks help us reduce the amount of code. With the popularity of low-code platforms, one of the advantages of a framework is that it helps us reduce the amount of code, so many low-code platforms refer to frameworks like Mybatis – Plus and Lombok.

Jeecg-boot Trampling guide

JEECG official website development document

In the link above, I have attached the official development documentation provided by JeECG-Boot. The documentation is very detailed, including the environment preparation, setup, deployment and use. However, in practice, there are still minor problems, which is not the problem of JeECG-Boot itself, but the problem of using the default environment.

The problem

An error occurred in initializing the database script

  • According to the official procedure, we pulled down the code related to JeECG-boot, installed the database (I used mysql5.7.20), and installed the Docker

The jeECG-boot database uses the uFT8MB4 character set to support storing emojis, and utF8 will report errors when storing emojis

  • Execute initial database initialization script (Jeecgboot -mysql-5.7)

Navicat initialization script execution, after 1084 execution stopped execution, usually this situation we may go to check whether there is a problem with the SQL script, after checking the script error position, copy out the single execution is OK, so after various investigations (Baidu), it turns out that mysql limits the size of the execution script. The default is 2M, and the mysql script is 6M in size

  • Script information

The solution

  • Split the script into multiple scripts smaller than 2M and execute them in sequence, taking care not to break them into the middle of a statement.
  • Modify the database configuration to increase the script size limit

The modification method varies slightly according to the deployment mode. We need to modify the configuration item max_allowed_packet. After modification, delete the data generated by the error before execution and execute the script again

Docker exec -it mysql bash 2 Go to the directory where the configuration file is stored: CD /etc/mysql.conf.d / 3. Modify the configuration file vi mysqld. CNF 4. Add max_allowed_packet=200M 5 in the line under [mysqld] in the file. 6. Exit the container exit 7. Restart the mysql service docker restart mysqlCopy the code

If the container does not contain VIM, you need to install viM. You are advised to accelerate the configuration before performing operations. Otherwise, the operation will be slow

Start the error

Handle the initialization problem of the database, modify the database address in the configuration file according to the official document, configure redis, and then start the JEECG-boot service after an error

The solution

Mysql > select * from ‘QRTZ_LOCKS’; mysql > select * from ‘jeECG-boot’; mysql > select * from ‘jeecG-boot’; To solve this problem, change the case-sensitive configuration item lower_case_table_names=1 of the mysql table name. For details, see the preceding configuration item

The back-end service is started

Solve these two problems and the server of JeECG-boot can start smoothly!!

The front end

The front-end service only needs to modify related configurations according to the documents on the official website and start after construction

Docker minimalist deployment

In order to facilitate the deployment of a learning environment, I officially recommended by the minimalist deployment plans put front-end code in the back-end service jeecg – the boot – module – system of the project/SRC/main/resources/static directory, and then use the JAR deployment scheme will back-end services reach the JAR package, Then upload the JAR package to the Docker host environment and build a Docker image for deployment. The detailed operations are as follows:


  • Modify the front-end service configuration (refer to the official documentation – Minimalist Deployment Solution)

  • After modifying the front-end configuration file, perform step 3 and subsequent steps in the minimalist deployment solution
  • When the back-end code is ready, modify the mysql and redis configurations in the back-end configuration file to the corresponding service name in the Docker container, for example, mysql:3306… , note that the yaml file with prod suffix is modified

  • Follow step 4 and the following steps of the JAR deployment scheme in the official documentation
  • Jar package is ready, change the name to jeecg.jar, docker host using rz command to upload to the server
  • Create a Dockerfile file in the directory where the server JAR is located
FROM frolvlad/alpine-java
COPY jeecg.jar /app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app.jar"]
Copy the code
  • Run the command in the current directory to create the image docker build -t jeecg.
  • Docker run -d –name jeecg -p 8080:8080 –link redis –link mysql jeecg
  • –link is used because I did not add containers to the same network when creating other containers, so I need to use –link to ensure the communication between mysql and Redis. Docker network related knowledge can refer to the link of the nuggets article
  • Service started

The deployment summary

Because docker deployment of official documents needs to use Docker for Windows, I am more used to deploying Ubuntu using virtual machines to install Docker and deploy some self-development and learning environments, so COMBINED with the official tutorial to complete a docker minimal deployment. It is suitable for beginners to build a development environment on their own computers and learn docker at the same time. Students who do not know Docker can learn about docker stand-alone environment construction, which is relatively simple

use

Using low jeecg – the boot code platform, official document has detailed introduction in use owing to lack of understanding of the whole platform business, after I in the use of code generation, the generated code added to the service before and after the end, the page is not displayed, later found that add menu need to configure the permissions, so proposal after building a good learning environment, Fully understand the business design of the entire platform before use, so as not to take normal business as a problem because of lack of understanding.

Erupt (Lightweight Low Code Platform)

Erupt website

Compared to JeECG-Boot, Erupt is lighter and more convenient for pure back-end applications (no front-end infrastructure required). All you need to do is add maven dependencies to the SpringBoot2. x project, and the official Quick Start manual can be followed to successfully build the platform. I also found the problems and solutions in the official documents, just refer to the link.

conclusion

Low code platform is very much, as a programmer, in addition to the code to understand the use of some mainstream low code platform and building is also very necessary, this mainly introduced jeecg – the boot fit and problem solutions, to Erupt to build and use without what environmental problems, the competitors, recommend everyone can be deployed to learn.