Spring Boot is the fastest way to get a production-grade Java service running, and the most widely used server-side Java framework there is. This track teaches it from the beginning, and every code sample is lifted from one real application rather than invented for the article.
What Spring Boot actually gives you
Plain Spring is a dependency injection container plus a large family of libraries. It is powerful and it asks you to wire everything yourself: XML or Java configuration, a servlet container to deploy into, versions of thirty libraries that have to agree with each other.
Spring Boot keeps the container and removes the wiring. Three ideas do almost all of the work:
- Starters. One dependency pulls in a coherent set of libraries at versions known to work together.
- Auto-configuration. Boot looks at what is on your classpath and creates the beans you would have written by hand — and backs off the moment you define your own.
- An embedded server. Your application is the process. No WAR file, no
Tomcat to install,
java -jarand it is serving.
The result is a REST endpoint in about fifteen lines and no configuration at all.
Versions this track is written against
Spring Boot 4 is a genuine break from 3, and Spring Framework 7 with it. Several things in this track will not compile on Boot 3, and they are called out where they appear.
| Component | Version |
|---|---|
| Spring Boot | 4.1.0 |
| Spring Framework | 7.0.8 |
| Java | 21 (the minimum for Boot 4) |
| Build | Maven, with a Gradle equivalent in lesson 33 |
| Database | MySQL, schema owned by Liquibase |
| springdoc-openapi | 2.8.6 |
| MapStruct | 1.6.3 |
| jjwt | 0.12.6 |
Java 21 is not optional. Spring Boot 4 requires it. If java -version
reports 17, stop here and upgrade — every sample below assumes 21.
Create a project
The Spring Initializr generates the skeleton. Use the web UI at start.spring.io, or curl it directly:
curl https://start.spring.io/starter.zip \
-d type=maven-project \
-d language=java \
-d bootVersion=4.1.0 \
-d javaVersion=21 \
-d groupId=com.example \
-d artifactId=demo \
-d dependencies=web,data-jpa,validation,lombok \
-o demo.zip
unzip demo.zip -d demo && cd demoYou get a pom.xml, one Java class, an empty
application.properties and a Maven wrapper. That is the whole project.
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}@SpringBootApplication is three annotations in one:
@SpringBootConfiguration, @EnableAutoConfiguration and
@ComponentScan. That last one scans this class's package and everything below
it, which is the single structural decision you cannot get wrong — a class in a sibling package
is invisible to Spring, and the failure is a confusing "no qualifying bean" rather than anything
that mentions packages. Lesson 4 covers the layout that follows from this.
Your first endpoint
Add one class:
package com.example.demo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@GetMapping("/hello")
public String hello(@RequestParam(defaultValue = "world") String name) {
return "Hello, " + name;
}
}./mvnw spring-boot:run
# in another terminal
curl "http://localhost:8080/hello?name=Spring"
# Hello, SpringNo server installed, no XML, no web.xml, no deployment step. That is the pitch, and
the rest of this track is about what Boot is doing on your behalf and when you should take over.
The application every example comes from
Tutorial snippets invented to illustrate a point tend to fall apart the moment you try to use them, because they never had to survive contact with anything. Every snippet in this track is copied from a working pizza-ordering API — the backend of a Pizza Hut-style storefront:
- Browse a menu, build a pizza, add to a server-side cart, check out as a guest or signed in
- Stripe payments, with the server recomputing every price
- JWT authentication, customer profiles, saved addresses and cards
- An admin area with catalogue management and reports built on real database aggregates
It runs on Java 21 and Spring Boot 4.1.0, is covered by 60 tests, and its package layout is the one lesson 4 recommends. When a lesson says "here is how the pizza API does it", that is code that compiles and runs, not a sketch.
How to read this track
The lessons build on each other and are meant to be read in order, but each one stands alone well enough to be used as a reference later.
Part 1 — Getting started
- Get Started — you are here
- What Spring Boot actually does — starters, auto-configuration, the embedded server
- From Spring to Spring Boot, and Boot 3 to 4
- Structuring a project
Part 2 — The container
- Beans, scopes and lifecycle
- Dependency injection
- Configuration, profiles and properties
- Aspect-oriented programming
- Application events
Part 3 — The web layer
- Spring Web MVC
- Building a REST API
- Exception handling
- File upload
- API docs with springdoc-openapi
- Server-rendered pages with Thymeleaf
Part 4 — Data
- JPA and Hibernate
- JdbcTemplate
- Schema migrations with Liquibase
- Mapping DTOs with MapStruct
- Lombok
- Caching
- Elasticsearch
Part 5 — Security
- How Spring Security authenticates
- Configuring the filter chain
- Stateless API auth with JWT
- Method-level security
- OAuth2
Part 6 — Async and integration
Part 7 — Build, test, reference
What you need before lesson 2
- JDK 21. Check with
java -version. - An IDE — IntelliJ IDEA or VS Code with the Java extensions.
- Java fundamentals — classes, interfaces, generics, lambdas. This track teaches Spring, not Java.
- MySQL, from lesson 16 onwards. Nothing before that needs a database.
Next: what Spring Boot actually does — how one dependency becomes twelve, and how to see every decision auto-configuration made on your behalf.