building-rest-apis-spring-boot icon indicating copy to clipboard operation
building-rest-apis-spring-boot copied to clipboard

Code for my presentation on Building REST APIs in Spring Boot

Building REST APIs with Spring Boot

In this live coding session, you will learn how to build REST APIs in Java with Spring Boot. You will learn how to bootstrap your application using https://start.spring.io and the New Project Wizard in IntelliJ. You will learn some best practices to keep in my while creating your APIs. By the end of this session, you will be able to create a basic CRUD REST API in Spring Boot.

Recording: https://www.youtube.com/watch?v=q_RLfOB7axQ&t=2315s

Agenda

  • Introduction
    • Agenda
    • About Me
    • What is an API
    • What is REST
  • Create a new Spring Boot Project
    • start.spring.io
    • IntelliJ Initializr
  • Model (this is the resource)
    • LiveStream (Mutable and Immutable)
    • Unit Tests
    • Move to a Record
  • Controller
  • Repository
  • Dependency Injection (IoC)
  • LiveStream Controller CRUD methods
  • Spring Bean Validation
  • Controller Integration Tests

IntelliJ Plugins

I was asked a lot of questions about which plugins I use for IntelliJ. I am using 2021.3 Ultimate Edition at the time of this recording. The plugins I was asked about the most are:

  • Live Templates: https://www.jetbrains.com/help/idea/using-live-templates.html
  • Http Client: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html
  • Github Copilot: https://copilot.github.com/

I created a video on Github Copilot for Java developers https://youtu.be/97C3fQqzj-I