The Pivotal team has done a great job of coming with Spring Boot microservice application stack. In the next few blogs, I will demonstrate the capabilities of Spring Boot to write a Medium Complex application (Not a Todo application) using Industry leading polyglot stack like, Angular.js, Spring JPA, Spring Boot and Postgres Database in the backend. I will also demonstrate how to run this application in Heroku.
- With respect to Spring Boot
- Takes off lot of xml headaches of Spring MVC and follows a strong convention over configuration
- Works like Ruby, with lot of starter jar dependencies like spring-boot-starter-web or like spring-boot-starter-data-jpa, which helps in quickly setup all the dependencies. There are whole bunch of them
- Encourages the concept of Microservices, where we can build low foot print self contained services, which we can deploy in PaaS like Heroku
- In addition to these goodies, this sample application also imposes few of its own,
- Minimum Boilerplate coding. Minimum amount of Handcrafted POJOs. Almost no xml configuration.
What it does?
This is a sample application that helps user to register himself and purchases books online. It has roughly 10 screens and 2 actors the user and the admin. It will have below capabilities,
- User can do following actions
- Register himself
- Login to the system
- View the books, and add to the shopping card
- Checkout the books
- Currently Admin is hardcoded in the system and admin can do the following,
- Approve the order to be shipped
Spring Boot: spring-boot-starter-web, spring-boot-starter-jpa, spring-boot-starter-test
Postgres for the application and H2 for Junit testing.
The blog is divided into multiple section:
- Setup the environment for development
- JUnit testing of DAO layer
- JUnit testing of Service layer
- JUnit testing of Controller