RuoYi-Cloud microservice development practice

Chapter 1 Development Environment Construction


Table of contents

Chapter 1 Development Environment Construction

foreword

1. What is RuoYi-Cloud?

2. Environment deployment

1. Install JDK

2. Install docker

3. Download mysql image

4. Download redis image

5. Download the nacos-server image

6. Install node.js

3. Project start



foreword

  • Development equipment:

        MacBook Pro (14-inch, 2021)

        System version: macOS Monterey

        Chip: Apple M1 Pro

        Memory: 16GB

  • Development related tools:

        ideaIU-2022.3.2-aarch64

        navicat161_premium_en


1. What is RuoYi-Cloud?

        RuoYi-Cloud is an extremely fast background development framework for front-end and back-end separation microservices based on Spring Boot, Spring Cloud & Alibaba, Vue, and Element. Based on the classic technology combination (Spring Boot, Spring Cloud & Alibaba, Vue, Element), built-in modules such as: department management, role users, menu and button authorization, data permissions, system parameters, log management, code generation, etc. Online scheduled task configuration; supports clusters and multiple data sources.

1. System environment

  • Java EE 8
  • Servlet 3.0
  • Apache Maven 3

2. Main frame

  • Spring Boot 2.3.x
  • Spring Cloud Hoxton.SR9
  • Spring Framework 5.2.x
  • Spring Security 5.2.x

3. Persistence layer

  • Apache MyBatis 3.5.x
  • Hibernate Validation 6.0.x
  • Alibaba Druid 1.2.x

4. View layer

  • Vue 2.6.x
  • Axios 0.21.0
  • Element 2.14.x

2. Environment deployment

1. Install JDK

 First open the JDK download address on Oracle's official website . The download requires the jdk version. I downloaded the jdk8 version.

After downloading the installation package, open the installation package and press the next step to install it directly

Check if the installation is successful 

wusq@helloworld ~ % java -version
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)

2. Install docker

For manual download, please click the link below to download  Install Docker Desktop on Mac 

Like other macOS software, the installation is very simple, double-click the downloaded .dmg file, and then drag the whale icon to the Application folder.

Check if the installation is successful   

wusq@helloworld ~ % docker -v
Docker version 20.10.22, build 3a2c30b

3. Download mysql image

pull in terminal

The first time I downloaded an error, because I am using apple m1 silicon, choose the correct chip architecture version arm64v8 

wusq@helloworld ~ % docker pull mysql:5.7.37
5.7.37: Pulling from library/mysql
no matching manifest for linux/arm64/v8 in the manifest list entries

Tips: Docker Documentation: How to Build, Share, and Run | Docker Documentation  Search for images on the docker official website, and filter to support the arm64v8 version

Download the correct version arm64v8/mysql:8.0.32, then use docker-compose to start in the idea

wusq@helloworld ~ % docker pull arm64v8/mysql:8.0.32
8.0.32: Pulling from arm64v8/mysql
7d4ed4ca78bc: Pull complete 
657a7ca448ac: Pull complete 
53bd78ce95ca: Pull complete 
c0e937b70acc: Pull complete 
c2bf3d14eb5e: Pull complete 
4f675b4a4ac0: Pull complete 
53482ccac7fa: Pull complete 
828f28210871: Pull complete 
1db57577e20b: Pull complete 
314e3cb90a9a: Pull complete 
408e09447dc6: Pull complete 
Digest: sha256:6499d4392110bbcd65518b96cb64d67110dd191bb462c2f77a81a4c01e4c52eb
Status: Downloaded newer image for arm64v8/mysql:8.0.32
docker.io/arm64v8/mysql:8.0.32

4. Download redis image

wusq@helloworld ~ % docker pull arm64v8/redis:6.2.10
6.2.10: Pulling from arm64v8/redis
5731adb3a4ab: Pull complete 
e78ad00da4bd: Pull complete 
acf81d284940: Pull complete 
3bb4963eea7d: Pull complete 
0e96d949c48c: Pull complete 
1f7b3a0544b2: Pull complete 
Digest: sha256:ee3fedb5b4af9efb8208d191bd1b148f134287bf52ac2c64354b1de06ef9c4e5
Status: Downloaded newer image for arm64v8/redis:6.2.10
docker.io/arm64v8/redis:6.2.10

Download the correct version arm64v8/redis:6.2.10, then use docker-compose to start in the idea 

5. Download the nacos-server image

wusq@helloworld ~ % docker pull nacos/nacos-server:v2.2.0-slim
v2.2.0-slim: Pulling from nacos/nacos-server
a9fe95647e78: Pull complete 
4015b6e8cc8d: Pull complete 
0e86b181efa0: Pull complete
94abd992e68d: Pull complete 
661feaa45879: Pull complete 
e0106ef68e8d: Pull complete 
40988fbfabef: Pull complete 
80ac9b361435: Pull complete 
0c728ca010e6: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:e9a4a10384399fce92f47e9115f5f3ee6375fef899735747b24f72468984619c
Status: Downloaded newer image for nacos/nacos-server:v2.2.0-slim
docker.io/nacos/nacos-server:v2.2.0-slim

Download the correct version nacos/nacos-server:v2.2.0-slim, then use docker-compose to start in the idea 

In the docker application, check whether the download is successful. Ignore the status in the screenshot, because I have already started the screenshot.

6. Install node.js

        Use the software package installation method to install, go to the official website to download and install the software installation package https://nodejs.org/zh-cn/download/

         The above has completed the most basic operating environment related software deployment

3. Project start​​​​​​

1. Download the project from gitee to the local and open it

        https://gitee.com/y_project/RuoYi-Cloud

2. Start by docker-compose, ruoyi-mysql, ruoyi-redis, ruoyi-nacos

        Connect the installed macos version of docker in the service panel of idea

         Modify the relevant content of docker-compose.yml, mainly to modify the corresponding downloaded software mysql, redis, nacos mirror version

         Modify the dockerfile file of nacos, specify the downloaded image version, and then modify the corresponding mysql connection address and username and password in the application.propertion file under the conf of nacos

 

    Start mysql, redis, nacos through docker-compose in the service panel

         After the startup is complete, you can view the startup status in docker

3. Open and run the basic module (starting in no order)

  • RuoYiGatewayApplication ( required for gateway modules  )
  • RuoYiAuthApplication ( required for authentication modules  )
  • RuoYiSystemApplication ( required for system modules  )
  • RuoYiMonitorApplication (monitoring center  is optional )
  • RuoYiGenApplication (code generation  is optional )
  • RuoYiJobApplication (timed task  optional )
  • RuoYFileApplication (file service  optional )

Before starting RouYiSystemApplication, you need to modify the corresponding ip in nacos

4. Run the front end

        Enter the command line under the ruoyi-ui directory

         Execute the relevant deployment startup command

# 安装依赖
wusq@helloworld ruoyi-ui % npm install

# 解决由m1芯片和高版本node.js引起的错误需要设置node v17中的OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响
wusq@helloworld ruoyi-ui % export NODE_OPTIONS=--openssl-legacy-provider

# 本地开发 启动项目
wusq@helloworld ruoyi-ui % npm run dev  

Summarize

        After the startup is complete, access the application through ip+1024/index

        http://localhost:1024/index

        http://localhost:8848/nacos/index.html#/login

Guess you like

Origin blog.csdn.net/woshuo424479703/article/details/128975328