A Hands-On Course

Building REST APIs with Spring Boot

From your first endpoint to a tested, portfolio-ready Library Management API β€” one tightly-scoped lesson at a time.

πŸ’» The course's code on GitHub GitHub stars

The mission Become job-ready as a Java backend developer. Every lesson builds one feature of a Library Management API (authors & books) you can show and discuss in interviews.

Lessons

  1. SDKMAN + Spring Boot CLI, @SpringBootApplication, @RestController, the embedded server β€” from empty folder to a live GET /hello.
    Ready
  2. Model a Book record, return objects and lists, and see how Jackson turns them into JSON; tidy routes with a @RequestMapping base path.
    Ready
  3. Extract a service, constructor injection, and why it makes code testable.
    Ready
  4. POST/PUT/DELETE, @RequestBody, @PathVariable, status codes & ResponseEntity.
    Ready
  5. @Entity, JpaRepository, a PostgreSQL database via Docker Compose, Liquibase migrations, derived queries.
    Ready
  6. @ManyToMany with a join table, a migration that carries existing data across, Set vs List, and DTOs to keep entities off the wire.
    Ready
  7. @Valid, Bean Validation, and global handling with @ControllerAdvice + ProblemDetail β€” clean 400, 404 and 409 responses.
    Ready
  8. Pageable/Page, ?page=&size=&sort=, a stable JSON page shape, and a max-page-size safety cap.
    Ready
  9. See N+1 in the SQL log, turn off open-session-in-view to fail loud, and fix it with @EntityGraph.
    Ready
  10. JUnit 5, Mockito & AssertJ β€” verify the service's logic with fakes, no Spring, no database.
    Ready
  11. @WebMvcTest and MockMvcTester: the controllers' routes, JSON, status codes and ProblemDetail bodies, tested without a server.
    Ready
  12. @DataJpaTest against a real PostgreSQL from Testcontainers: the derived queries, the @EntityGraph fetch and what a write leaves in the tables, tested for real.
    Ready
  13. @SpringBootTest on a random port with RestTestClient: the whole application, its real database and its HTTP API, tested the way a client uses them.
    Ready
  14. springdoc-openapi turns the controllers into an OpenAPI spec and a Scalar docs page; annotations in an interface beside each controller add what the code alone can't say.
    Ready

Reference

Community

Trusted resources