Credit Manager is an app, which gives ability to manage Credits.
- Java: 11
- Database: H2
- Build automation tool: Apache Maven
- Spring Boot starter version: 2.4.5
- UI framework: Thymeleaf
There are three Repositories to handle the main entities: Credit, Customer and Product. These Repositories are based on Spring JPA framework and what is basic for Spring JPA, these Repositories contains minimal code. Some of initial data is hard coded inside Application Class.
Credit Manager is created with typical architecture of a Spring application.
default server.port=8090
default homepage adress: http://localhost:8090/home
Controller consists of GET and POST requests to handle REST APIs, both from web browser and tool for rest api testing (Postman).
Interface is created from template framework - Thymeleaf. Main interfaces are: Home Page, Create Credit Page and Get Credits Page. On pages are implemented "Back" buttons to help with navigation.
Home page:
@GetMapping(value = "/home")
@GetMapping(value = "/createCredit")
Thymeleaf form collects data needed to create Credit.
Web form has validation to inserted values, every cell has to have lenght bigger than 0 and @NoNull, pesel number has to have 11 characters.
@GetMapping(value = {"/getList"})
Thymeleaf view shows table witch created Credits
It's possible to manage data or test from Postman or other similar tool, example requests:
@PostMapping("/create/credit")
@GetMapping("/get/credits")
@PostMapping("/create/customer")
@GetMapping("/get/customers")
@PostMapping("/create/product")
@GetMapping("/get/products")