File structure

Once Spring Initializr finishes the generation of the skeleton of the backend of our TaskAgile application, we can see the following structure:

.
├── .gitignore
├── .mvn
│ └── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
├── main
│ ├── java
│ │ └── com
│ │ └── taskagile
│ │ └── TaskAgileApplication.java
│ └── resources
│ ├── application.properties
│ ├── static
│ └── templates
└── test
└── java
└── com
└── taskagile
└── TaskAgileApplicationTests.java

Let's go through the items in this tree. First of all, the .mvn folder, and the mvnw and mvnw.cmd files, are for Maven Wrapper, which enables you to use a project-specific Maven version, and, when there is no Maven of that version installed or found on the path, it will download it automatically.

The pom.xml file, as we mentioned before, is the configuration file used by Maven, and, with the selected dependencies, Spring Initializer will add the following dependencies in this file:

  • spring-boot-starter-data-jpa
  • spring-boot-starter-thymeleaf
  • spring-boot-starter-web
  • spring-boot-devtools
  • spring-boot-starter-test

The com.taskagile.TaskAgileApplication.java class is the main entry of the application. And com.taskagile.TaskAgileApplicationTests.java is its unit test.

When Spring Initializr generates a project skeleton, it uses the value of the artifact field as the application's folder name. For TaskAgile, we will rename the application folder to vuejs.spring-boot.mysql.

The application folder's name follows the pattern, <front-end-technolgoy>.<back-end-technology>.<database-technology>. This doesn't mean you need to name it the same way in your application. The reason we named it in this way is that, in the future, we will implement TaskAgile using different technologies, such as react.spring-boot.mysql or vuejs.spring-boot.mongodb.

Before committing the application scaffold, let's add the following, .editorconfig, to the root directory.

Let's have a look at the .editorconfig file:

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

This .editorconfig file is used by EditorConfig (https://editorconfig.org) to maintain consistent coding styles. You will need to install the VS Code extension, EditorConfig for VS Code (EditorConfig.editorconfig), to enable this feature.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.188.244