Skip to content

Latest commit

 

History

History
1042 lines (819 loc) · 28.2 KB

File metadata and controls

1042 lines (819 loc) · 28.2 KB

Spring Boot 3, Spring 6 & Hibernate for Beginners

📚 Course Overview

This comprehensive Spring Boot 3 course teaches you how to build enterprise-level Java applications using Spring Boot and Hibernate. The course covers everything from basic setup to advanced features like REST APIs, database integration, and security.


🎯 Main Objectives

  • Develop Spring Boot applications from scratch
  • Leverage Hibernate/JPA for database access
  • Build REST APIs using Spring Boot
  • Create Spring MVC applications
  • Connect Spring Boot apps to databases for CRUD operations
  • Apply Spring Security to control application access
  • Use all Java configuration (no XML) with Maven

🛠️ Prerequisites

Required Knowledge

  • Java programming experience (OOP, classes, interfaces, inheritance, exception handling, collections)

Required Software

  • Java Development Kit (JDK): Version 17 or higher (required for Spring Boot 3)
  • IDE: Any Java IDE works

Environment Setup Checkpoint

Before starting the course, ensure you can:

  • Run a basic "Hello World" Java application in your IDE
  • Verify JDK 17+ is installed and configured

🚀 What is Spring Boot?

The Problem Spring Boot Solves

Traditional Spring applications are difficult to set up:

  • Complex JAR dependency management
  • Tedious XML or Java configuration
  • Manual server installation (Tomcat, JBoss, etc.)

Spring Boot Solution

  • Minimize manual configuration: Auto-configuration based on properties and classpath
  • Resolve dependency conflicts: Simplified Maven/Gradle dependency management
  • Embedded HTTP server: No need for separate server installation (Tomcat, Jetty, Undertow)
  • Easier to get started: Focus on business logic, not boilerplate

Key Points

  • Spring Boot uses Spring Framework behind the scenes
  • It doesn't replace Spring MVC, Spring REST, etc. - it makes them easier to use
  • No performance difference from regular Spring applications
  • Works with any IDE (no special IDE required)

🔧 Getting Started

Spring Initializr

Create Spring Boot projects quickly using: http://start.spring.io

Features:

  • Select dependencies visually
  • Generate Maven or Gradle projects
  • Download and import into any IDE

Development Process

  1. Configure project at Spring Initializr website
  2. Download the ZIP file
  3. Unzip the file
  4. Import into your IDE

💻 Complete Hello World Example

Step 1: Create Main Application Class

File: src/main/java/com/example/HelloWorldApp.java

package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication  // Enables auto-configuration + component scanning
@RestController
public class HelloWorldApp {
    
    public static void main(String[] args) {
        SpringApplication.run(HelloWorldApp.class, args);
    }
    
    @GetMapping("/")
    public String hello() {
        return "Hello, Spring Boot!";
    }
    
    @GetMapping("/api/welcome")
    public String welcome() {
        return "Welcome to Spring Boot 3!";
    }
}

Step 2: Configure Application Properties

File: src/main/resources/application.properties

# Server Configuration
server.port=8080
server.servlet.context-path=/

# Application Name
spring.application.name=HelloWorldApp

# Logging
logging.level.root=INFO
logging.level.com.example=DEBUG

Step 3: Run the Application

# Option 1: From IDE
# Right-click on HelloWorldApp.java → Run

# Option 2: Maven command
./mvnw spring-boot:run

# Option 3: Package and run JAR
./mvnw package
java -jar target/hello-world-app.jar

Step 4: Test the Application

# Test endpoint 1
curl http://localhost:8080/

# Test endpoint 2
curl http://localhost:8080/api/welcome

# View actuator endpoints
curl http://localhost:8080/actuator/health

Expected Output:

Hello, Spring Boot!
Welcome to Spring Boot 3!
{"status":"UP"}

🏗️ Multi-Module Application Example

Project Structure

spring-boot-project/
├── pom.xml                          # Parent POM
├── src/
│   ├── main/
│   │   ├── java/com/example/
│   │   │   ├── SpringBootApp.java   # Main class
│   │   │   ├── controller/
│   │   │   │   └── UserController.java
│   │   │   ├── service/
│   │   │   │   └── UserService.java
│   │   │   ├── repository/
│   │   │   │   └── UserRepository.java
│   │   │   └── model/
│   │   │       └── User.java
│   │   └── resources/
│   │       ├── application.properties
│   │       └── application-prod.properties
│   └── test/java/com/example/
│       └── UserControllerTest.java

Example 1: Main Application Class

File: src/main/java/com/example/SpringBootApp.java

@SpringBootApplication
public class SpringBootApp {
    
    public static void main(String[] args) {
        SpringApplication.run(SpringBootApp.class, args);
        System.out.println("✓ Application started successfully!");
    }
}

Example 2: Entity Model

File: src/main/java/com/example/model/User.java

package com.example.model;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "users")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    
    @Column(nullable = false)
    private String firstName;
    
    @Column(nullable = false)
    private String lastName;
    
    @Column(unique = true, nullable = false)
    private String email;
    
    private String phoneNumber;
}

Example 3: Repository

File: src/main/java/com/example/repository/UserRepository.java

package com.example.repository;

import com.example.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User, Integer> {
    
    Optional<User> findByEmail(String email);
    
    List<User> findByFirstName(String firstName);
    
    List<User> findByFirstNameAndLastName(String firstName, String lastName);
}

Example 4: Service Layer

File: src/main/java/com/example/service/UserService.java

package com.example.service;

import com.example.model.User;
import com.example.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;

@Service
public class UserService {
    
    @Autowired
    private UserRepository userRepository;
    
    public List<User> getAllUsers() {
        return userRepository.findAll();
    }
    
    public Optional<User> getUserById(Integer id) {
        return userRepository.findById(id);
    }
    
    public User createUser(User user) {
        return userRepository.save(user);
    }
    
    public User updateUser(Integer id, User userDetails) {
        return userRepository.findById(id)
            .map(user -> {
                user.setFirstName(userDetails.getFirstName());
                user.setLastName(userDetails.getLastName());
                user.setEmail(userDetails.getEmail());
                user.setPhoneNumber(userDetails.getPhoneNumber());
                return userRepository.save(user);
            })
            .orElseThrow(() -> new RuntimeException("User not found"));
    }
    
    public void deleteUser(Integer id) {
        userRepository.deleteById(id);
    }
}

Example 5: REST Controller

File: src/main/java/com/example/controller/UserController.java

package com.example.controller;

import com.example.model.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/users")
public class UserController {
    
    @Autowired
    private UserService userService;
    
    // GET all users
    @GetMapping
    public ResponseEntity<List<User>> getAllUsers() {
        List<User> users = userService.getAllUsers();
        return ResponseEntity.ok(users);
    }
    
    // GET user by ID
    @GetMapping("/{id}")
    public ResponseEntity<User> getUserById(@PathVariable Integer id) {
        return userService.getUserById(id)
            .map(ResponseEntity::ok)
            .orElse(ResponseEntity.notFound().build());
    }
    
    // POST - Create new user
    @PostMapping
    public ResponseEntity<User> createUser(@RequestBody User user) {
        User createdUser = userService.createUser(user);
        return ResponseEntity.status(HttpStatus.CREATED).body(createdUser);
    }
    
    // PUT - Update user
    @PutMapping("/{id}")
    public ResponseEntity<User> updateUser(@PathVariable Integer id, 
                                           @RequestBody User userDetails) {
        User updatedUser = userService.updateUser(id, userDetails);
        return ResponseEntity.ok(updatedUser);
    }
    
    // DELETE - Delete user
    @DeleteMapping("/{id}")
    public ResponseEntity<Void> deleteUser(@PathVariable Integer id) {
        userService.deleteUser(id);
        return ResponseEntity.noContent().build();
    }
}

Example 6: Configuration with Properties

File: src/main/resources/application.properties

# ==================== SERVER ====================
server.port=8080
server.servlet.context-path=/

# ==================== DATABASE ====================
spring.datasource.url=jdbc:mysql://localhost:3306/springboot_db
spring.datasource.username=root
spring.datasource.password=root123
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# ==================== JPA / HIBERNATE ====================
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect

# ==================== LOGGING ====================
logging.level.root=INFO
logging.level.com.example=DEBUG
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate.SQL=DEBUG
logging.file.name=logs/application.log

# ==================== APPLICATION ====================
spring.application.name=User Management API
app.version=1.0.0

Example 7: Testing

File: src/test/java/com/example/UserControllerTest.java

package com.example;

import com.example.model.User;
import com.example.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Optional;

import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

@SpringBootTest
@AutoConfigureMockMvc
public class UserControllerTest {
    
    @Autowired
    private MockMvc mockMvc;
    
    @MockBean
    private UserService userService;
    
    @Test
    public void testGetUserById() throws Exception {
        User user = new User(1, "John", "Doe", "john@example.com", "1234567890");
        when(userService.getUserById(1)).thenReturn(Optional.of(user));
        
        mockMvc.perform(get("/api/users/1"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.firstName").value("John"))
            .andExpect(jsonPath("$.email").value("john@example.com"));
    }
    
    @Test
    public void testCreateUser() throws Exception {
        User user = new User(null, "Jane", "Smith", "jane@example.com", "0987654321");
        User savedUser = new User(1, "Jane", "Smith", "jane@example.com", "0987654321");
        
        when(userService.createUser(any(User.class))).thenReturn(savedUser);
        
        mockMvc.perform(post("/api/users")
            .contentType(MediaType.APPLICATION_JSON)
            .content(new ObjectMapper().writeValueAsString(user)))
            .andExpect(status().isCreated())
            .andExpect(jsonPath("$.id").value(1));
    }
}

📦 Maven Basics

What is Maven?

Maven is a project management and build tool that:

  • Manages JAR dependencies automatically
  • Downloads required libraries from Maven Central Repository
  • Handles transitive dependencies
  • Provides standard directory structure
  • Simplifies build and run processes

Standard Directory Structure

project-root/
├── src/main/java/          # Java source code
├── src/main/resources/     # Properties/config files
├── src/main/webapp/        # JSP, web config, assets (for WAR)
├── src/test/java/          # Unit testing code
├── target/                 # Compiled code (auto-created)
└── pom.xml                 # Project configuration

Maven POM File (pom.xml)

The Project Object Model file contains:

  • Project metadata (name, version, packaging type)
  • Dependencies (Spring, Hibernate, etc.)
  • Build plugins and custom tasks

Project Coordinates

Every Maven project is uniquely identified by:

<groupId>com.myapp</groupId>        <!-- Organization -->
<artifactId>mycoolapp</artifactId>     <!-- Project name -->
<version>1.0.FINAL</version>           <!-- Version -->

Finding Dependencies


🎁 Spring Boot Starters

What Are Starters?

Curated collections of Maven dependencies grouped together and tested by Spring team.

Benefits

  • No need to list individual dependencies
  • Compatible versions guaranteed
  • Reduces Maven configuration significantly

Popular Starters

Starter Description
spring-boot-starter-web Web apps, REST, validation (includes Tomcat)
spring-boot-starter-security Spring Security support
spring-boot-starter-data-jpa Database support with JPA and Hibernate
spring-boot-starter-test Testing frameworks (JUnit, Mockito, etc.)

Full list: Spring Boot Starters Reference

Example: Web Starter

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

This single dependency includes:

  • spring-web
  • spring-webmvc
  • hibernate-validator
  • tomcat
  • JSON libraries
  • And more...

👨‍👩‍👧 Spring Boot Starter Parent

Benefits

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.x.x</version>
</parent>

Provides:

  • Maven defaults (compiler level, UTF-8 encoding)
  • Dependency version management
  • No need to specify versions for Spring Boot starters
  • Default Spring Boot plugin configuration

Override Defaults

<properties>
    <java.version>17</java.version>
</properties>

📁 Spring Boot Project Structure

Key Files and Directories

Maven Wrapper Files

  • mvnw.cmd (Windows) / mvnw.sh (Linux/Mac)
  • Allows running Maven without installing it
  • Auto-downloads correct Maven version if needed
# Use Maven wrapper
./mvnw clean compile test
./mvnw spring-boot:run

# Or use installed Maven (if available)
mvn clean compile test
mvn spring-boot:run

Application Properties

File: src/main/resources/application.properties

Configure Spring Boot and custom properties:

# Server configuration
server.port=8585

# Custom properties
coach.name=Mickey Mouse
team.name=The Mouse Crew

Inject Properties

@RestController
public class FunRestController {
    @Value("${coach.name}")
    private String coachName;
    
    @Value("${team.name}")
    private String teamName;
}

Static Content

  • Location: src/main/resources/static/
  • Serves: HTML, CSS, JavaScript, images
  • ⚠️ Warning: Don't use src/main/webapp/ for JAR packaging (only for WAR)

Templates

  • Location: src/main/resources/templates/
  • Supported engines: FreeMarker, Thymeleaf, Mustache
  • Thymeleaf is popular and covered later in course

🔄 Spring Boot DevTools

Problem

Manual application restart required after code changes.

Solution

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
</dependency>

Features:

  • Automatic application restart on code changes
  • No additional code required

IntelliJ Configuration

  1. Preferences → Build, Execution, Deployment → Compiler

    • ✅ Check "Build project automatically"
  2. Preferences → Advanced Settings

    • ✅ Check "Allow auto-make to start even if developed application is running"

📊 Spring Boot Actuator

What is Actuator?

Production-ready features to monitor and manage your application.

Setup

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

Key Endpoints

Endpoint Description
/actuator/health Application health status
/actuator/info Application information
/actuator/beans All Spring beans
/actuator/mappings All @RequestMapping paths
/actuator/metrics Application metrics

Configuration

# Expose all endpoints
management.endpoints.web.exposure.include=*

# Expose specific endpoints
management.endpoints.web.exposure.include=health,info

# Exclude endpoints
management.endpoints.web.exposure.exclude=beans,mappings

# Enable info endpoint
management.info.env.enabled=true

# Custom info
info.app.name=My Super Cool App
info.app.description=A crazy and fun app!
info.app.version=1.0.0

🔒 Actuator Security

Add Security

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency>

Configure Credentials

spring.security.user.name=admin
spring.security.user.password=secret123

Note: /health remains public by default. All other endpoints require authentication.


🏃 Running Spring Boot Applications

Embedded Server

Spring Boot apps are self-contained:

  • Application code + embedded server (Tomcat) in one JAR
  • No separate server installation needed

Option 1: Run from IDE

  • Simply run the main application class
  • Contains @SpringBootApplication annotation

Option 2: Command Line with java -jar

# Package the application
./mvnw package

# Run the JAR
java -jar target/mycoolapp-0.0.1-SNAPSHOT.jar

Option 3: Spring Boot Maven Plugin

./mvnw spring-boot:run

Deploying as WAR

Spring Boot apps can also be packaged as WAR files for deployment to external servers (Tomcat, JBoss, WebSphere).


⚙️ Common Spring Boot Properties

Core - Logging

# Log levels
logging.level.org.springframework=DEBUG
logging.level.org.hibernate=TRACE
logging.level.com.myapp=INFO

# Log file
logging.file.name=my-app.log
logging.file.path=c:/logs

Log Levels: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF

Web

# Server port
server.port=7070

# Context path
server.servlet.context-path=/my-app

# Session timeout
server.servlet.session.timeout=15m

Access: http://localhost:7070/my-app/

Actuator

# Base path
management.endpoints.web.base-path=/actuator

# Expose endpoints
management.endpoints.web.exposure.include=*
management.endpoints.web.exposure.exclude=beans

Security

spring.security.user.name=admin
spring.security.user.password=topsecret

Data (Database)

spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=dbuser
spring.datasource.password=dbpass

🎓 Additional Resources

  • Spring Boot Properties Reference: Over 1,000+ configuration properties available
  • Spring Projects: Spring Cloud, Spring Data, Spring Batch, Spring Security, Spring Web Services, Spring LDAP, and more
  • Course Materials: All source code and PDF slides available for download
  • Questions: Post in the classroom discussion forum

🔰 Getting Help

If you have questions or need assistance:

  1. Post in the classroom discussion forum
  2. Review the comprehensive documentation
  3. Check the official Spring Boot documentation

📝 Quick Reference Commands

# 🔨 Maven Wrapper (if Maven not installed)
./mvnw clean compile test     # Clean, compile, and test
./mvnw package               # Create JAR/WAR file
./mvnw spring-boot:run       # Run application directly

# 🔧 Regular Maven (if installed)
mvn clean compile test       # Clean, compile, and test
mvn package                  # Create JAR/WAR file
mvn spring-boot:run          # Run application directly

# 🚀 Run packaged application
java -jar target/mycoolapp.jar

# 🐳 Docker Commands (if using Docker)
docker build -t myapp .
docker run -p 8080:8080 myapp

# 🔍 Useful Development Commands
./mvnw dependency:tree       # View dependency hierarchy
./mvnw spring-boot:build-info # Generate build information
./mvnw clean install -DskipTests # Skip tests during build

✨ Course Philosophy

  • All Java Configuration: No XML configuration files
  • Maven-based: Simplified dependency management
  • Practical Approach: Hands-on coding and real-world examples
  • Production-Ready: Learn industry best practices

🎯 Learning Path Roadmap

journey
    title Spring Boot Learning Journey
    section Basics
      Setup Environment    : 5: Student
      Create First App     : 4: Student
      Understand Structure : 3: Student
    section Core Concepts
      Dependency Injection : 4: Student
      Auto Configuration   : 3: Student
      Properties Config    : 5: Student
    section Database
      JPA/Hibernate       : 3: Student
      CRUD Operations     : 4: Student
      Query Methods       : 3: Student
    section Web Development
      REST APIs           : 4: Student
      MVC Controllers     : 3: Student
      Thymeleaf Templates : 2: Student
    section Advanced
      Security            : 2: Student
      Testing             : 3: Student
      Microservices       : 1: Student
Loading

🔗 Quick Links & Resources

Official Documentation

Development Tools

Community & Support


📊 Performance Tips

⚡ Optimization Checklist:
├── 🚀 Use appropriate starter dependencies
├── 🎯 Configure connection pooling
├── 💾 Enable caching where appropriate
├── 📊 Monitor with Actuator metrics
├── 🔧 Profile-specific configurations
└── 🧪 Load testing in staging environment

🛠️ IDE Shortcuts & Best Practices

IntelliJ IDEA Shortcuts

  • Ctrl + Space - Code completion
  • Ctrl + Alt + O - Organize imports
  • Ctrl + Shift + F - Format code
  • Alt + Enter - Quick fix / show intentions
  • Ctrl + D - Duplicate line
  • Ctrl + Shift + Up/Down - Move statement
  • Ctrl + / - Toggle comment

Eclipse Shortcuts

  • Ctrl + Space - Content assist
  • Ctrl + Shift + O - Organize imports
  • Ctrl + Shift + F - Format code
  • Ctrl + 1 - Quick fix
  • Ctrl + Alt + Down - Duplicate line

🐛 Common Issues & Troubleshooting

Issue: Application Fails to Start

Symptoms: ClassNotFoundException or port already in use

# Solution 1: Change port
server.port=8081

# Solution 2: Kill process using the port
# Linux/Mac: lsof -ti:8080 | xargs kill -9
# Windows: netstat -ano | findstr :8080 → taskkill /PID <PID>

Issue: Dependencies Not Found

Solution:

./mvnw clean install -U    # Force update of dependencies
./mvnw dependency:tree     # Check dependency tree

Issue: DevTools Not Restarting Application

Solution:

  1. Enable build automatically: IntelliJ → Preferences → Compiler
  2. Enable auto-make: IntelliJ → Preferences → Advanced Settings
  3. Rebuild project: Ctrl+Shift+F9

Issue: Actuator Endpoints Returning 404

# Solution: Make sure endpoints are exposed
management.endpoints.web.exposure.include=*
management.endpoints.web.exposure.exclude=

# Verify endpoint: http://localhost:8080/actuator

🔍 Debugging Techniques

Enable Debug Logging

# application.properties
logging.level.root=INFO
logging.level.org.springframework=DEBUG
logging.level.org.springframework.boot=DEBUG
logging.level.com.myapp=DEBUG

# File-based logging
logging.file.name=app.log
logging.file.max-size=10MB
logging.file.max-history=30

Debug in IDE

  1. Set Breakpoint: Click on line number (IntelliJ/Eclipse)
  2. Debug Mode: Right-click project → Debug As → Spring Boot App
  3. Step Through:
    • F6 - Step over
    • F5 - Step into
    • F7 - Step out
    • F8 - Resume

Using Browser DevTools

  • F12 - Open DevTools in Chrome/Firefox
  • Network Tab - Monitor API calls and responses
  • Console Tab - Check for JavaScript errors
  • Application Tab - View cookies and session storage

📝 Development Checklist

✅ Setup:
  ├── JDK 17+ installed
  ├── Maven installed or using wrapper
  ├── IDE configured with Spring plugins
  └── Database drivers configured

✅ Development:
  ├── Spring Boot DevTools enabled
  ├── Logging configured
  ├── Properties externalized
  └── Hot reload working

✅ Testing:
  ├── Unit tests written
  ├── Integration tests created
  ├── Mock external services
  └── Test coverage > 70%

✅ Deployment:
  ├── Application packaged as JAR
  ├── Properties externalized for environments
  ├── Security configured
  └── Database migrations planned

💡 Pro Tips

  1. Use Spring Profiles: Create application-dev.properties, application-prod.properties for different environments
  2. Enable Build Cache: Speeds up Maven builds significantly
  3. Use VS Code REST Client: Install REST Client extension for easy API testing
  4. Monitor Memory: Use Actuator /actuator/health endpoint to monitor application health
  5. Use Postman Collections: Export API collections from Postman for team collaboration
  6. Enable CORS Selectively: Don't use @CrossOrigin("*") in production
  7. Version Your APIs: Use URL versioning or header versioning for backward compatibility
  8. Document with Swagger/OpenAPI: Generate API documentation automatically

Happy Coding! 🚀

"The best way to learn Spring Boot is by building real applications. Start small, think big, and iterate often!" 💡