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")
This is a demo project for a Spring Boot application that manages banking operations such as handling credits, customers, and products. The application uses an H2 database for data storage and provides a web interface for interaction.
- Java 11
- Maven
- Clone the repository:
git clone <repository-url> cd bank
- Build the project:
Use Maven to build the project:
./mvnw clean install
- Run the application:
Start the application using the Maven wrapper:
./mvnw spring-boot:run
Before starting the application, ensure that the following environment variable is set:
DB_PASSWORD
: The password for the database connection. You can set this environment variable in your operating system's environment settings or in a.env
file (if using a tool likedotenv
). Example for Unix-based systems:
export DB_PASSWORD=your_secure_password
Example for Windows:
set DB_PASSWORD=your_secure_password
Ensure this variable is set before running the application to establish a successful database connection.
- The application will be accessible at
http://localhost:8090
. - The H2 console can be accessed at
http://localhost:8090/h2
.
- The application uses Spring Boot DevTools for automatic restarts and live reloads during development.
- Swagger is integrated for API documentation and can be accessed at
http://localhost:8090/swagger-ui/
.
This project is licensed under the MIT License.