 In this video we are going to do a code review of the Spring Boot application that we are going to be working with. On the screen here you can see that I have an API definition so the Spring Boot application that we are going to be working with in this course is a simple Spring MVC REST type application. Here I have a beer service and you can see that we've implemented endpoints for list beers, great beer, get beer by ID, update beer by ID, delete beer by ID and then also get beer by UPC so a variety of RESTful style operations that we can work with. This API documentation I will leave a link to it in the course resources and then the implementation that we are going to be working with in the course is here. It's under KBE REST Brewery so this is a Spring Boot project that implements that RESTful API and I will also leave a link to this in the course resources. Now I do want to prefix this. The course is for people that already know how to develop Spring so I'm not going to be teaching how to build a Spring REST API that's well covered in other content I have and a lot of other people cover that as well so to proceed you do need to understand fundamental Spring MVC creating RESTful APIs but I do want to go through and do a quick code review to get you orientated to the Spring Boot project that we are going to be working with in the course. I'm going to toggle over to IntelliJ where I have the project uploaded. So here I'm in IntelliJ. This is the checked out project from GitHub and I want to do just a code review on this so first let's take a look at the dependencies. So here is the Maven Palm. Let me scroll up to the top here. We are using Spring Boot version 2.4.5 that is the most recent version at the time of recording of Spring Boot and you can see here in the properties we are using Java 11. I am using MapStark and Project Lombok on that. More on those in a little bit. I do want to look at the Spring dependencies. We are bringing in Spring Starter for actuator web that is going to be web MVC not web flux. We have the Starter for Spring Data JPA so that is going to bring in data or JPA and hibernate that is the ORM that we will be using and then we are explicitly bringing in validation. There was a recent change to Spring Boot where the Starter validation was previously included in web within I forget the exact version within the last year so that is no longer included so you do have to bring those in and if you forget this is one of those things that might fail silently where the validation is not getting picked up that can be a problem because you forget that and then your validation silently fails to work. Then you can see on line 50 we are bringing in H2. We will be utilizing the H2 in memory database dev tools. Can we see Project Lombok, MapStark and then our test dependencies. Let's go up to the build plugins. We do have the Spring Boot Maven plugin because I am using a different version of Lombok than was being curated. I am excluding that from the Maven plugin so that doesn't get automatically built in. And here is an important part if you are not familiar with MapStark and Project Lombok. You do need to configure Maven like this to add in these annotation processors. I can't remember if the sequence is important but it is important to have these annotation processors there. I would recommend trying to keep the same sequence here because I know this works. If you have a different sequence I don't know if that will work. And then finally on line 115 I want to point out this is a compiler argument and this is what tells MapStark to annotate the generated mappers with a Spring Component annotation so that those mappers get brought in and have Spring Boot components and we can do dependency injection on them. Without that the project will fail to work properly. Let's come in here. I do want to take a look at the beer loader under Bootstrap. So this is going to be implementing the Spring Boot command line runner. What this does it initializes our H2M memory database with 30 different beer objects. So you scroll down and you can see the various beers that I am loading up into the database. It just goes with some data so every time we bring up the application they get initialized into the database. Speaking of the database we are using traditional JPA here. I'm not going to be covering JPA specifically but you can go through. We can see that we are using project Lombok annotations for data. Also the builder pattern is being implemented as well as a variety of JPA annotations for the yield and what not. This is the what's getting persisted to the database. Now we do have here we are using a DTO model so I do have MapStark mappers defined to convert from the database entity to a DTO. So the DTOs are kept under the model directly and all that works pretty well. Coming from the ground up we are using Spring Data JPA repositories. We are following the repository pattern so we do have a repository defined that is utilized in our services so we do have an interface that we are coding to. That does the basic CRUD operations for us and then here you can see the actual implementation of the service. I close down some of these packages real quick. And then finally we do have a Spring MVC controller so this is what's going to be handling the web request that takes in an instance of the beer service to support the CRUD operations. And we can see that we are using basic Spring MVC mapping so we have request mapping the path parameters are being set up all that's being handled by Spring MVC and then we are following through using our service. Our service is going to be handling that. The service takes care of working with the database and then using the MapStark mappers to convert to and from the web facing DTO objects. So let's go ahead and I'm going to run this application. From IntelliJ, if you're using that you just come up and say run. I'm just going to do a stop and rerun there. Sorry I had it running in the background already. And here you can see the basic initialization and I do want to point out here you can see that there is a console output saying that we've initialized the database. So at this point we're running on port 8080. You can see that a couple lines above. The API documentation we could utilize that to use Postman or something and exercise those CRUD operations against port 8080 on local host. So we have 30 beers loaded into the H2M memory database and then those restful APIs are now exposed and working. And if you want to take a moment on your own and go through and utilize a tool like Postman or Quirrell to exercise the API just to see that see that's working to prove that it does work at this point, go ahead. I encourage you to do so, but I'm not going to be covering that specifically in the course. You should be able to start the application at this point. What this will do is tell you that you checked it out and you have your environment set up properly. It is building and it is coming up and functioning properly.