
This course introduction explains building a real-time restful api with Spring Boot 2, using feature branches, and progressively covering Hello World, JPA, filtering, DTO mapping, versioning, Swagger, and monitoring.
Learn the fundamentals of restful APIs, including stateless architecture, resources identified by uris, http methods (get, post, put, delete), and how rest contrasts with soap.
Set up the development environment with spring tools for Eclipse, download and unzip the spring tool suite, clone the spring boot building blocks project, and import it in Eclipse.
Create a spring boot hello world rest API, manage the course project with github, generate the base project via start.spring.io, and push branches to remote.
Create a Spring Boot project from start.spring.io, configure dependencies (Spring Web Starter, Spring Boot Dev Tools, Spring Data JPA, H2), generate, import to Eclipse, and verify by running the app.
Manage Spring Boot projects with git and GitHub by creating incremental branches for each step, committing changes, and merging into master. Learn base setup and remote origins for practical workflows.
Add an existing local git repository to spring tool suite, view and manage changes via the git perspective, and commit and push to master and origin branches.
Create a hello world rest service with a rest controller and get mapping that returns a string, then extend to a json bean with first name, last name, and city.
Define a user details class with first name, last name, and city, and expose a hello world bean through a Spring Boot get mapping, returning JSON.
Commit and push the hello world rest service changes from the zero to hello world branch to master, then merge and sync with the remote repository.
Explore building restful APIs with Spring Data JPA and H2, implementing create, read, update, delete operations and a username query for a real-time project workflow.
Develop a simple user management service using Spring Boot Data JPA, implementing create, get all, get by id, update, and delete methods, plus queries like get by username.
Verify the pom.xml includes Spring Boot starter Web, data JPA, H2, and dev tools, and create dedicated Git branches for JPA user management and status code handling.
Update application.properties to enable spring.jpa.show_sql and spring.h2.console.enabled, allowing SQL queries to display in the console and the H2 database to be browsed for JPA-based RESTful services.
Create a user entity for a Spring Boot REST API, learn JPA annotations like @Entity, @Table, @Id, @GeneratedValue, and @Column, and enforce unique constraints on username and SSN.
Configure the @Table annotation to map a user entity to a specific table or schema, and understand default naming with h2’s testdb.
Define a user entity with a primary key id (generated value), multiple fields such as username and SSN, enforce uniqueness, and generate getters, setters, and constructors.
Explore how the H2 in-memory database integrates with Spring Boot, how dev tools reload drop and recreate tables, and how to pre-populate data via data.sql and the H2 console.
Create and annotate the user repository with @Repository for a Spring Boot REST API, extend JpaRepository, and wire the User entity with a long primary key.
Implement the get all users RESTful method by creating a service and a controller, wiring the user repository, and returning repository.findAll from the H2 database.
Test the get all users RESTful service with Postman by sending a GET request to /users and reviewing id, username, first name, last name, email, role, and SSN.
Implement a create user restful endpoint with @PostMapping using @RequestBody in the service and controller layers, test with Postman, and persist data to the database.
Implement the get user by ID in service and controller layers using an optional return type, with path variable and get mapping for the user/{id} uri, tested in Postman.
Implement update user by id in service and controller layers using put mapping, with id from the path variable and user details from the request body, and test with Postman.
Implement delete user by id in the service and controller layers using @DeleteMapping, verifying user exists via repository lookup before deleting by id, and test with postman.
Implement get user by username as a restful service using @GetMapping, define find by username in the repository, and route through the service and controller to return a single user.
Commit changes in the IDE via git staging, push the zero three jpa user management base branch to GitHub, merge into master, and push the updated master to remote.
Explore exception handling for RESTful APIs with the ResponseStatusException in Spring five, including http status, reason, and cause, plus benefits and tradeoffs.
Create a new git branch from master for exception handling and response status codes, push it to remote, and verify the branch in the repository.
Implement response status exception for update user by id by validating user existence in the repository, throwing user not found when absent, and handling the exception in the controller.
Implement a response status exception for create user by adding a user exists exception, validating username uniqueness, and returning a 400 bad request via the controller, with Postman validation.
Implement http 201 created and a location header for the createUser endpoint using a component builder in the controller, constructing the path /users/{id} from the created user id.
Master spring boot validations with hibernate validator and jsr 380, using annotations like not null, size, and email, and implement global exception handling via controller and rest controller advice.
Create and push a new git branch for validations and global exception handling, verify git status on the master branch, and set upstream origin to sync with the remote repository.
Implement bean validation on user entities with @NotEmpty and @Size(min=2), enable @Valid in the controller, and handle MethodArgumentNotValidException via a global exception handler.
Implement a custom global exception handler with @ControllerAdvice by extending ResponseEntityExceptionHandler, create a custom error details bean, and override handle method argument not valid to return a 400 bad request.
Implement a global exception handler for http request method not supported, override it, and test with Postman using patch to create a user, confirming 405 with custom error details.
Implement path variable validation with min value one on the get user by id endpoint, apply @Validated, and handle ConstraintViolationException via a global exception handler, tested with Postman.
Implement global exception handling with rest controller advice to return a 404 for username not found, using a custom global exception handler and postman tests.
Switch between @ControllerAdvice and @RestControllerAdvice to manage global exception handling in Spring Boot, enabling and then disabling the global risk controller to ensure username not found exception is handled.
Explore how to implement a bi-directional JPA one-to-many relationship between users and orders in Spring Boot, covering many-to-one mappings, lazy fetching, and order retrieval, creation, and detail queries.
Create a git branch for the JPA one-to-many association in a Spring Boot project and push upstream. Then proceed to implement the Spring Boot JPA one-to-many in the next step.
Create an order entity mapped to the orders table with a many-to-one user association, using lazy fetch and json ignore to prevent recursion.
Define a one-to-many relationship between users and orders in Spring Boot, using @OneToMany and mappedBy, add getters, populate data with data.sql, and verify via the H2 console and REST endpoints.
Implement get all orders for a user in order controller via /users/{id}/orders, using a user repository to fetch by id and return the user's orders, or throw user not found.
Implement a get order by order ID RESTful service in a Spring Boot 2 course, validating user and order existence and returning the order via the repository.
Commit changes, push to the remote, switch to master, merge the feature branch into master, and push the updated master to the remote to keep local and remote in sync.
Master spring boot hateoas to build discoverable rest APIs with hypermedia links. Implement self and relationship links for users and orders, including get all users and get user by ID.
Create and push a new git branch for spring boot OS, using git checkout -b, set upstream to origin, and verify local and remote branches for subsequent steps.
Add the HATEOAS dependency in pom.xml, restart the Spring Boot app to reflect the new dependency changes.
Extend user and order entities with resource support to enable user.add and order.add links, update the id to user id, and generate getters, setters, and constructors to resolve errors.
Create new HATEOAS controllers for users and orders to isolate the HATEOAS implementation, copy get all users and get user by id methods, and test with Postman.
Implement self linking for the getUserById method by extracting the user ID, creating a self link with controller link builder, attaching it to the user resource, and returning a resource.
Commit code and push to the remote repository, merge to master, and complete this section, preparing for the next lecture on internationalization.
Implement spring boot internationalization using a locale resolver and resource bundle message source to enable multilingual rest services with i18n. Create language-specific message properties such as message.properties and message_fr.properties.
Create a new git branch for internationalization, verify you are on master, check out the 08-spring-boot-internationalization branch, and set upstream to create and confirm the remote branch.
Develop internationalization in Spring Boot by creating an accept-header locale resolver with default locale US, adding messages.properties and messages_fr.properties, and configuring a resource bundle message source with base name messages.
Develop a simple rest service and extend it for internationalization by wiring a message source and using accept language to serve localized messages; test with postman and local context holder.
Review and execute Git workflow to commit changes on the Spring Boot internationalization branch, switch to master, merge the i18n branch, and push updates to both local and remote repositories.
Explore static filtering in spring boot using @JsonIgnore and @JsonIgnoreProperties to hide fields from json responses, and understand implications for get versus post operations.
Learn to implement dynamic field filtering in Spring Boot with MappingJacksonValue and Json filter, building a Jackson filter controller and moving from static to dynamic parameter-based results.
Implement dynamic filtering with MappingJacksonValue and @RequestParam in a Spring Boot REST service. Send fields via request params to tailor the response, including username, SSN, and orders.
Commit the new file and Json filter, mapping Jackson value in the Spring Boot project. Push the changes to create a remote branch and complete the dynamic filtering mapping step.
Learn to implement static filtering in Spring Boot using Jackson @JsonView by creating views with external and internal classes, annotating entity fields, and exposing separate views via controller endpoints.
Explore how model mapper eliminates manual mapping by converting entity objects to DTOs with a simple fluent API, type-safe, convention-based approach for secure REST endpoints.
Create a new git branch, add the model mapper dependency to the pom.xml, and implement a Spring configuration class that exposes a ModelMapper bean.
Implement methods using model mapper to convert user entities to user DTOs in a new rest controller, test via postman, and commit changes to the repository.
MapStruct introduces a compile-time code generator that automates bean mappings between entities and DTOs with no runtime reflection, easing Spring Boot RESTful mappings.
Create a new branch and configure map struct in the project by updating pom.xml with map struct dependencies and processor plugin, and add a user dto class for email mapping.
Create a mapstruct mapper for users, implement user to user DTO and list<User> to List<UserDTO>, expose get all users via spring REST, and map email and role fields.
Implement a get user by id endpoint using MapStruct and the user mapper, retrieving the user via repository find by id and converting to a user DTO for the API.
******* Course Overview *******
Welcome to this Amazing course on Master RESTful API s using Spring Boot 2 in 100 Steps. The below are the list of modules covered in this course.
Course Modules
01. Introduction
02. Manage Spring Boot Projects via Github & HelloWorld REST service
03. Build RESTful APIs using Spring Data JPA and H2 Database
04. Exception Handling with ResponseStatusException - Spring 5 Latest
05. Validations & Global Exception Handling
06. SpringBoot - JPA OneToMany Association
07. SpringBoot - HATEOAS
08. SpringBoot - Internationalisation
09. SpringBoot - Filtering
10. SpringBoot - DTOS - Data Transfer Objects
11. SpringBoot - Versioning & Content Negotiation
12. SpringBoot - Swagger Integration
13. SpringBoot - Actuator & Admin
14. SpringBoot - Actuator & Micrometer
Each of my courses come with
Amazing Hands-on Step By Step Learning Experiences
Real Implementation Experience
Friendly Support in the Q&A section
30 Day "No Questions Asked" Money Back Guarantee!
***************Section wise course details**********************
Module 1: Introduction
Module 01: Introduction
01 Step 01: Course Introduction
01 Step 02: Introduction to RESTful API
Module 02: Manage Spring Boot Projects via Github & HelloWorld REST service
02 Step 00: Github & HelloWorld Introduction
02 Step 01: Create Spring Boot base project from spring initializer
02 Step 02: Introduction for managing Spring Boot projects via github
02 Step 03: Github Base Setup
02 Step 04: Add GIT Repository to Spring Tool Suite IDE
02 Step 05: Create a Simple Hello World RESTful Service which returns a String
02 Step 06: Create a Simple Hello World REST Service which returns a Bean (JSON)
02 Step 07: GIT Commit & Push Hello World RESTful service changes to Github
Module 03: Build RESTful APIs using Spring Data JPA and H2 Database
03 Step 00: Introduction to Build RESTful APIs with JPA
03 Step 01: Usecase Introduction
03 Step 02: Verify pom.xml for all Dependencies
03 Step 03: Update application.properties required for JPA based RESTful Services
03 Step 04 01: Create User Entity - Understand @Entity Annotation
03 Step 04 02: Create User Entity - Understand @Table Annotation
03 Step 04 03: Create User Entity - Define Variables, Getters & Setters
03 Step 05: Understand and Implement changes related to H2 Database
03 Step 06: Create User Repository - @Repository
03 Step 07: Implement getAllUsers RESTful Service - @Service, @RestController
03 Step 08: Test getAllUsers RESTful Service - Using REST Client POSTMAN
03 Step 09: Implement createUser RESTful Service - @PostMapping
03 Step 10: Implement getUserById RESTful Service - @GetMapping
03 Step 11: Implement updateUserById RESTful service - @PutMapping
03 Step 12: Implement deleteUserById RESTful Service - @DeleteMapping
03 Step 13: Implement getUserByUsername RESTful Service - @GetMapping
03 Step 14: GIT Commit, Push, Merge to Master and Push
Module 04: Exception Handling with ResponseStatusException - Spring 5 Latest
04 Step 00: Introduction to Exception Handling using ResponseStatusException
04 Step 00: Create git branch - local & remote
04 Step 01: Implement ResponseStatusException handling for getUserById
04 Step 02: Implement ResponseStatusException for updateUserById RESTful Service
04 Step 03: Implement ResponseStatusException for deleteUserById RESTful Service
04 Step 04: Implement ResponseStatusException for createUser RESTful Service
04 Step 05: Implement HTTP Status code & Location Header for createUser Service
04 Step 06: GIT Commit, Push, Merge to Master and Push
Module 05: Validations & Global Exception Handling
05 Step 00: Introduction to Spring Boot - Validations & Global Exception Handling
05 Step 00: Create git branch for Validations & Global Exception Handling
05 Step 01: Implement Bean Validation - @Valid
05 Step 02: Implement custom Global Exception Handler - @ControllerAdvice
05 Step 03: Implement HttpRequestMethodNotSupportedException in GEH
05 Step 04: Implement UserNameNotFoundException in GEH - @ExceptionHandler
05 Step 05: Path Variable Validation & ConstraintViolationException in GEH
05 Step 06: Implement Global Exception Handling using @RestControllerAdvice
05 Step 07: Switching between @ControllerAdvice and @RestControllerAdvice
Module 06: SpringBoot - JPA OneToMany Association
06 Step 00: Need for JPA OneToMany for HATEOAS
06 Step 00: Introduction to JPA OneToMany Association
06 Step 01: Create git branch for JPA OneToMany Association
06 Step 02: Create Order Entity and @ManyToOne Association
06 Step 03: Update User entity with @OneToMany Association
06 Step 04: Implement "getAllOrders" RESTful Service
06 Step 05: Implement "createOrder" RESTful Service
06 Step 06: Implement "getOrderByOrderId" RESTful Service
06 Step 07: GIT Commit, Push, Merge to Master and Push
Module 07: SpringBoot - HATEOAS
07 Step 00: Introduction to Spring Boot - HATEOAS
07 Step 00: Create git branch for HATEOAS
07 Step 01: Add HATEOAS Dependency in pom.xml
07 Step 02: Extend User and Order Entities with ResourceSupport
07 Step 03: Create new User and Order Controllers for HATEOAS Implementation
07 Step 04: Implement self link in getUserById Method
07 Step 05: Implement self and relationship links in getAllUsers Method
07 Step 06: GIT commit code, push to remote, merge to master
Module 08: SpringBoot - Internationalisation
08 Step 00: Introduction to Internationalisation
08 Step 00: Create git branch for Internationalisation
08 Step 01: Create LocaleResolver and ResourceBundleMessageSource Beans
08 Step 02: Implement RESTful Service with Internationalisation
08 Step 03: GIT Commit, Push, Merge to Master and Push
Module 09: SpringBoot - Filtering
09 Step 01: Implement Static Filtering using @JsonIgnore and @JsonIgnoreProperties
09 Step 02: Implement Dynamic Filtering using MappingJacksonValue
09 Step 03: Implement Dynamic Filtering with MappingJacksonValue & @RequestParam
09 Step 04: Dynamic Filtering - git Commit and Push code
09 Step 05: Introduction to Filtering using @JsonView
09 Step 06: Implement Filtering using @JsonView
Module 10: SpringBoot - DTOS - Data Transfer Objects
10 Step 01: ModelMapper Introduction
10 Step 02: ModelMapper Configuration Setup
10 Step 03: Implement Methods using ModelMapper
10 Step 04: MapStruct Introduction
10 Step 05: MapStruct Configuration Setup
10 Step 06: MapStruct - Create UserMapper and Implement getAllUsers Method
10 Step 07: MapStruct - Implement getUserById Method using MapStruct UserMapper
Module 11: SpringBoot - Versioning & Content Negotiation
11 Step 00: Versioning Introduction
11 Step 01: Create DTO's required for Versioning Implementation
11 Step 02: Implement URI Versioning
11 Step 03: Implement Request Parameter Versioning
11 Step 04: Implement Custom Header Versioning
11 Step 05: Implement Media Type Versioning
11 Step 06: Implement & Test Content Negotiation
11 Step 07: GIT Commit Code & Push for Content Negotiation branch
Module 12: SpringBoot - Swagger Integration
12 Step 00: Introduction to Swagger
12 Step 01: Add Springfox Dependencies to pom.xml and Create SwaggerConfig file
12 Step 02: Adding API Info to modify header part of our documentation
12 Step 03: Restrict scope of swagger document generation using API Base packages
12 Step 04: Auto populate documentation for JSR-303 Validations
12 Step 05: Adding Swagger Core Annotations to Model class
12 Step 06: Adding Swagger Core Annotations to Controller classes
Module 13: SpringBoot - Actuator & Admin
13 Step 00: SpringBoot Actuator Introduction
13 Step 01: Add Actuator Dependency in pom.xml
13 Step 02: Expose all Actuator Endpoints and discuss about them
13 Step 03: SpringBoot Admin Introduction
13 Step 04: SpringBoot Admin - Base Setup
13 Step 05: Point SpringBoot Client Application to SpringBoot Admin Server
13 Step 06: Test the features in SpringBoot Admin Server
Module 14: SpringBoot - Actuator & Micrometer
14 Step 00: Introduction to SpringBoot Micrometer
14 Step 01: Add Micrometer Dependency to pom.xml
14 Step 02: Integrate with JMX and view metrics in JConsole
14 Step 03: Integrate with AppOptics to export metrics and View metrics in AppOptic
14 Step 04: Verify Metrics in AppOptics and Create Metrics Dashboards.