Spring Boot—Framework, Project, and Package Structure

Let’s go over the basics of this course and Spring Boot, as well as the project and package structure.

Why this course?

This course will help you to learn the end-to-end design and development of REST APIs using a Spring application. You’ll receive a well-rounded learning experience that offers both hands-on practical examples and end-to-end implementations. This course will also cover advanced-level concepts like database integration, documentation, and monitoring.

Intended audience

The course is suitable for anyone with prior experience in the Java programming language who is also familiar with the basics of the Spring framework.

Additionally, knowledge of HTTP requests and databases will be useful in this course.

Course structure

The course is designed to start with beginner-level concepts before progressing to intermediate-level and then advanced-level topics. Every chapter discusses a core concept in detail through different lessons. Each topic in a lesson is discussed with examples and supporting playgrounds, for a reader to verify the concept on the platform itself. Also, a quiz is added in the summary of each chapter to firm the learning.

Course objectives

This is an advanced-level course about the creation of REST APIs using the Spring framework. It will cover various framework integrations, such as Spring Data JPA, Spring Data Rest, Spring AOP, Springfox, Spring Testing framework, and Spring Boot Actuator.

You’ll develop a Spring Boot application to expose REST APIs with database, monitoring, and documentation support. Therefore, after finishing the course, you’ll have a thorough knowledge of the design and development of REST APIs with practical examples.

What is Spring Boot?

Spring Boot is an open-source framework that provides an auto-configurable setup to run a Spring-based application. It allows developers to pick technologies like Java, Kotlin, and Groovy to build a web application that can run on an embedded web server like Tomcat and Netty.

The framework uses an opinionated approach to add Spring starter dependencies and essential third-party libraries, according to the need of a project. Also, Spring Boot provides easy setup and deployment capabilities with production-ready features such as, metrics, health checks, and externalized configuration.

Project structure for our Spring Boot project

Once the project setup is ready, we’ll find a few directories like gradle and src in the project structure.

Moreover, a few files such as build.gradle and settings.gradle, which are specific to the Gradle build tool, will be a part of the project.

Package structure for our Spring Boot project

Then, we’ll create separate directories in the todo application for different types of files:

  • controllers: This is the directory for RESTController.
  • domains: This is the directory for Entity.
  • repositories: This is the directory for the JPA repository.
  • services: This is the directory for the Service.

Also, we can create the utils directory for other helper classes.

In this chapter, we learned how to create a Spring Boot project and explored its structure with packages like controllers, domains, and repositories.