Building a REST API with Spring Boot

Beginner
20 Lessons
5h 13m

In this beginner course, you’ll learn how to build a complete REST API from start to finish with Spring Boot. With our interactive labs, you’ll get hands-on practice every step of the way — bootstrapping with Spring Initializr, through authenticating & authorizing with Spring Security.

Share:

Looking to build a real world REST API using Spring Boot? Ranked as the #1 Java-based development framework for web apps, Spring Boot is an outstanding choice! Here's Spring Developer Advocate, Josh Long, with a quick word on Spring's continuing commitment to education, and why we're so excited to bring you this Spring Boot course.

In This Course

In this course, you’ll build a Family Cash Card service—an app for families to manage allowances in the form of digital debit cards. By building this service from start to finish, you'll learn about REST APIs, Spring Security, data persistence, metrics, and modern application development.

Each lesson follows the same realistic project setting to build a software product. This better prepares you to solve realistic problems that you may encounter throughout the software development lifecycle.

Course Outcomes

  • Build a fully functional REST API with Spring Boot.
  • Utilize Spring Security to authenticate and authorize your application.
  • Implement test-driven development.
  • Convert database and Java objects automatically using Spring Data JDBC.

Prerequisites

A working knowledge of the Java language and Java ecosystem

Course Outline

Introduction

Introduction

Article
5m
Spring and Spring Boot
Locked

Spring and Spring Boot

Learn about the difference between Spring and Spring Boot, and how to bootstrap a project in 60 seconds with Spring Initializr.

Article
5m
Lab: Spring Initializr
Locked

Lab: Spring Initializr

Generate and explore the codebase we will use for our Family Cash Card API.

Lab
5m
API Contracts & JSON
Locked

API Contracts & JSON

APIs have collaborators; how should you collaborate? Learn how to design and transfer data for your Cash Card API.

Article
5m
Testing First
Locked

Testing First

Explore the core principles and benefits of Test Driven Development, and why it pays to test first.

Article
5m
Lab: Testing First
Locked

Lab: Testing First

Practice Test Driven Development by test-driving the JSON Contracts that will define our API.

Lab
10m
Implementing GET
Locked

Implementing GET

HTTP, CRUD, and REST – oh my! Learn the basics of API design and implement your first endpoint - the GET endpoint - to retrieve a single Cash Card.

Article
10m
Lab: Implementing GET
Locked

Lab: Implementing GET

Put your newfound knowledge to good use by implementing the GET endpoint in our Family Cash Card API.

Lab
25m
Repositories & Spring Data
Locked

Repositories & Spring Data

Learn about Separation of Concerns, the Repository pattern, and using Spring Data Repositories to store and retrieve Cash Cards.

Article
10m
Lab: Repositories & Spring Data
Locked

Lab: Repositories & Spring Data

Find out how much code you don't have to write, as you store and retrieve data in our application.

Lab
20m
Implementing POST
Locked

Implementing POST

Learn the HTTP and REST semantics of creating Cash Cards by implementing the HTTP POST endpoint.

Article
15m
Lab: Implementing POST
Locked

Lab: Implementing POST

Our application will start to feel real after you've implemented the ability to create and store new Cash Cards.

Lab
25m
Returning a list with GET
Locked

Returning a list with GET

You get a Cash Card! And you get a Cash Card! Add additional GET endpoints to your Spring Boot API to retrieve, sort, filter, and paginate multiple Cash Cards.

Article
30m
Lab: Returning a list with GET
Locked

Lab: Returning a list with GET

Find out how much more Spring Data has to offer as you easily implement paging and sorting lists of Cash Cards.

Lab
30m
Simple Spring Security
Locked

Simple Spring Security

Learn the differences between authentication and authorization, and how Spring Security can protect against common security vulnerabilities.

Article
30m
Lab: Simple Spring Security
Locked

Lab: Simple Spring Security

Add authentication and authorization to our Family Cash Card API using Spring Security, and implement additional best practices for securing our application.

Lab
30m
Implementing PUT
Locked

Implementing PUT

Learn how the PATCH, POST, and PUT HTTP verbs are used for Update and Create operations. Make some choices about how to support Update for our API, in preparation for implementing the endpoint!

Article
10m
Lab: Implementing PUT
Locked

Lab: Implementing PUT

In this lab, implement an HTTP PUT endpoint that allows an authenticated, authorized owner to update their Cash Cards.

In addition, learn how Spring Security automatically manages error handling by Spring Web to ensure that no sensitive information is accidentally revealed when a Controller encounters an error.

Lab
20m
Implementing DELETE
Locked

Implementing DELETE

Explore different patterns for deleting Cash Cards – sometimes without deleting them at all. You’ll implement one pattern using an HTTP DELETE endpoint.

Article
5m
Lab: Implementing DELETE
Locked

Lab: Implementing DELETE

Complete our Family Cash Card API by implementing the Delete operation!

Lab
15m