AI Instructor Live Labs Included

Building REST APIs with Spring Boot

Build a production-quality REST API with Spring Boot and PostgreSQL. Covers controllers, service layers, JPA, Bean Validation, error handling, and pagination through incremental hands-on exercises.

Intermediate
18h 30m
14 Lessons
SMU-JAVA-REST
Building REST APIs with Spring Boot Badge

View badge details

About This Course

Build a production-quality Task Manager REST API from scratch using Spring Boot, Spring Data JPA, and PostgreSQL. This course covers Spring Boot fundamentals, REST controllers, service layer design, JPA persistence, Bean Validation, global exception handling, and pagination. Students incrementally build a fully functional API that serves as a portfolio piece.

Course Curriculum

14 Lessons
01
AI Lesson
AI Lesson

Spring Boot Fundamentals & Project Setup

1h 0m

Learn what Spring Boot is and why it exists. Covers auto-configuration, the Spring application context, Maven project structure, @SpringBootApplication, embedded Tomcat, application.properties, Spring Boot starter dependencies, and running and verifying a Spring Boot app.

02
Lab Exercise
Lab Exercise

Spring Boot Setup - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises verifying the Spring Boot starter project, creating a HelloController with REST endpoints, and adding a health check endpoint. Students confirm the Meridian Logistics API starts and responds correctly.

03
AI Lesson
AI Lesson

REST Controllers & HTTP Methods

1h 0m

Learn REST conventions, Spring MVC controller annotations (@RestController, @GetMapping, @PostMapping, @PutMapping, @DeleteMapping), path variables, request parameters, request body deserialization, ResponseEntity for status codes, and the importance of DTOs over exposing JPA entities directly.

04
Lab Exercise
Lab Exercise

REST Controllers - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises implementing stub methods in TaskController: returning a hardcoded task list, echoing a POST request body, returning a single task, and testing all endpoints with curl commands.

05
AI Lesson
AI Lesson

Service Layer & Dependency Injection

1h 0m

Learn why the service layer exists, how Spring manages beans (@Service, @Component, @Repository), constructor injection vs field injection, interface-based service design, and the controller-service-repository chain. Emphasizes why constructor injection is preferred over @Autowired field injection.

06
Lab Exercise
Lab Exercise

Service Layer - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises implementing TaskService interface and TaskServiceImpl with an in-memory List backing store, wiring TaskController to use constructor-injected TaskService, and verifying the full controller-service chain with curl POST and GET commands.

07
AI Lesson
AI Lesson

Spring Data JPA & Repositories

1h 0m

Learn JPA entity annotations (@Entity, @Table, @Id, @GeneratedValue, @Column, @Enumerated), entity lifecycle, Spring Data JpaRepository with built-in CRUD methods, derived query methods, @Transactional, and ddl-auto settings. Students understand how to configure PostgreSQL persistence for the Task API.

08
Lab Exercise
Lab Exercise

JPA & Repositories - Lab Exercises

1h 30m 3 Exercises

Hands-on exercises annotating Task.java as a JPA entity, creating TaskRepository with derived query methods, switching TaskServiceImpl from in-memory List to repository calls, and verifying that tasks persist across server restarts using PostgreSQL.

09
AI Lesson
AI Lesson

Request Validation & Error Handling

1h 0m

Learn Bean Validation (@Valid, @NotBlank, @NotNull, @Size, @FutureOrPresent), @RestControllerAdvice for global exception handling, structured ApiError response body, custom TaskNotFoundException, and proper HTTP status codes for validation failures (400) vs missing resources (404).

10
Lab Exercise
Lab Exercise

Validation & Errors - Lab Exercises

1h 50m 4 Exercises

Hands-on practice adding Bean Validation and global error handling to the Task Manager REST API. Annotate DTOs, build a GlobalExceptionHandler, and implement custom exceptions with meaningful error responses.

11
AI Lesson
AI Lesson

Pagination, Filtering & Sorting

30m

Learn how Spring Data JPA's Pageable abstraction enables efficient large-dataset queries, how to add filtering by status and sorting by dueDate, and how to return Page objects with metadata to API consumers.

12
Lab Exercise
Lab Exercise

Pagination - Lab Exercises

1h 40m 3 Exercises

Hands-on practice adding Pageable support to the Task Manager API, implementing status filtering, enabling dueDate sorting, and verifying the Page response structure.

13
AI Lesson
AI Lesson

Capstone Briefing

20m

A comprehensive review of all API development skills covered in the course and a detailed briefing on the Task Manager capstone project requirements including the Category entity that students will implement in the final lesson.

14
Lab Exercise
Lab Exercise

Capstone Project

3h 10m 6 Exercises

The final capstone project for Building REST APIs with Spring Boot. Students implement a complete Category management feature including entity relationships, full CRUD endpoints, validation, error handling, and paginated task listing.

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 7 Hands-on Lessons
  • Completion Badge
Building REST APIs with Spring Boot Badge

Earn Your Badge

Complete all lessons to unlock the Building REST APIs with Spring Boot achievement badge.

Skill Level Intermediate
Total Duration 18h 30m
Building REST APIs with Spring Boot Badge
Achievement Badge

Building REST APIs with Spring Boot

Awarded for completing the Spring Boot REST API course, demonstrating proficiency in building, securing, and documenting RESTful APIs with Spring Boot.

Course Building REST APIs with Spring Boot
Criteria Complete all lessons and pass assessments in the Building REST APIs with Spring Boot course.
Valid For 730 days

Skills You'll Earn

Spring Boot REST API Design Spring MVC API Documentation Input Validation Error Handling

Complete all lessons in this course to earn this badge