The project notes are project summary notes. If there are any errors, please point them out~
[Project Column]
[java+vue+WeChat Mini Program Project] Building from Scratch - Gym Management Platform (1) Project Construction
Continuously updating...
Java+vue+WeChat applet project】Build from scratch - gym management platform
- Project Description
- Java project construction (IDEA)
-
- 1. Create a new project
- 2.Project type
- 3.Project settings
- 4. Project storage location and project name
- 5. Install the Lombok plug-in in idea
- 6.Project structure
- 7. Modify the Maven project configuration file pom.xml
- 8. Modify the application configuration file application.yml
- 9. Start the Spring Boot application
- 9. Test whether the startup is successful
- Vue project construction
- WeChat Mini Program Project Construction (WeChat Developer Tools)
- Project technology stack introduction
Project Description
The project is based on a B/S architecture system and adopts Java object-oriented programming ideas. Mainly relying on SpringBoot, Vue, WeChat applet development and other technologies, system users are divided into two categories: administrators and customers, who log in to the system through computer browsers and mobile phone WeChat applets respectively.
Java project construction (IDEA)
1. Create a new project
2.Project type
3.Project settings
- Group: The Group ID of the project, usually the reverse of the company domain name, such as
com.example
. - Artifact: Artifact ID of the project, which is the project name.
- Type: Select "Maven" or "Gradle" as the build tool.
- Language: Select "Java".
- Packaging: Select "Jar".
- Java Version: Select the Java version you wish to use.
- Version: Select the Spring Boot version.
The installed IDEA version only supports Java versions 17 and 21. Select first and then change the pom.xml file.
- Dependencies: Select the dependencies you need, such as "Spring Web" for building web applications.
4. Project storage location and project name
5. Install the Lombok plug-in in idea
In idea: file——>settings——>plugins (plug-in)
6.Project structure
The standard directory structure of Spring Boot is as follows:
my-spring-boot-project/
├── src/
│ ├── main/
│ │ ├── java/ # Java 源代码目录
│ │ │ └── com/
│ │ │ └── example/
│ │ │ └── myapp/
│ │ │ ├── config/ # 自定义配置类目录
│ │ │ ├── controller/ # 控制器类目录
│ │ │ ├── model/ # 实体类目录
│ │ │ ├── repository/ # 数据访问层目录
│ │ │ ├── service/ # 业务逻辑层目录
│ │ │ ├── util/ # 工具类目录
│ │ │ └── MySpringBootApplication.java # Spring Boot 应用程序入口
│ │ └── resources/ # 资源文件目录
│ │ ├── static/ # 静态资源目录
│ │ ├── templates/ # 模板文件目录
│ │ ├── application.properties # 应用程序配置文件
│ │ └── logback.xml # 日志配置文件
│ └── test/ # 测试代码目录
│ └── java/
│ └── com/
│ └── example/
│ └── myapp/
│ ├── controller/ # 控制器类测试目录
│ ├── repository/ # 数据访问层测试目录
│ └── service/ # 业务逻辑层测试目录
├── pom.xml # Maven 项目配置文件
└── README.md # 项目说明文档
Among them,src/main
directory contains the main Java code and resource files. src/test
The directory contains test case code and resource files.
In thesrc/main/java
directory, it usually contains the MySpringBootApplication
class that starts the application and other related business logic codes, including controllers, services, entities, etc. .
In the src/main/resources
directory, it usually contains the configuration file of the application, such as application.properties
or application.yml
. In addition, some static resource files (such as HTML, CSS and JavaScript files) and template files (such as Thymeleaf templates) can also be stored here.
In the src/test/java
directory, it usually contains the test case code for the application. These test classes are usually in the same package as the class being tested, and have names ending in xxxTests.java
.
In the src/test/resources
directory, it usually contains the resource files required for test cases.
pom.xml
It is the configuration file of the Maven project, including project dependencies, plug-ins and other information.
The above is just the standard directory structure of Spring Boot, you can modify or extend it according to actual needs.
7. Modify the Maven project configuration file pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.hui</groupId>
<artifactId>java-fitnesscenter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>java-fitnesscenter</name>