Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 17, 2021 03:04 am GMT

Spring Boot Boilerplate for Your Next Projects

The source code and the content of this article will be updated frequently. For this reason, please follow my article and my Github in order to get update-to-date information.

The last updated date: 17/07/2021.

Please give me Github if you like the project. Pull requests are highly appreciated.

Github link: https://github.com/hieptl/spring-boot-boilerplate

If you want to learn about React. I also have an article about Learning React By Building Netflix: https://dev.to/hieptl/learn-react-by-building-netflix-1127. The article will explain React concepts in details.

A boilerplate/starter project for quickly building RESTful APIs:

  • Spring Boot
  • Spring Data JPA.
  • Spring Security / JWT.
  • Swagger.
  • Mapstruct (converting entities to dtos and vice versa).

In this project, I am using MySQL. However, the boilerplate will work well with different databases including SQL databases and NoSQL databases.

Getting Started

In the most cases you need to have Maven and JDK8+. The best way to run the sample applications is with IDEs like IntelliJ IDEA or Eclipse.

In order to run the project, you need to follow the below steps:

  • Step 1: Clone the project.
  • Step 2: Access to your MySQL database and run the minimalist_db_boilerplate.sql file.
  • Step 3: cd to spring-boot-boilerplate folder and run mvn clean package -DskipTests.
  • Step 4: Run the jar file in the target folder with jar -jar target/spring-boot-boilerplate-0.0.1-SNAPSHOT.jar

Project Structure

  • config: stores configuration of the project.
  • controller: stores controllers of the project.
  • dto: stores data transfer objects of the project.
  • exception: stores custom exception of the project.
  • mapper: stores mappers of the project. Mappers will be used to convert to entities and vice versa.
  • model: stores models of the project.
  • repository: stores repositories of the project.
  • response: stores response of the project.
  • security: stores configuration about security of the project.
  • service: stores services of the project.
  • utils: stores common functions that could be used in different placces in the project.

Thanks and Best Regards,
Hiep


Original Link: https://dev.to/hieptl/spring-boot-boilerplate-for-your-next-projects-3ccj

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To