Skip to content

suvinad/CreditManager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CreditManager

Credit Manager is an app, which gives ability to manage Credits.

Specification

  • Java: 11
  • Database: H2
  • Build automation tool: Apache Maven
  • Spring Boot starter version: 2.4.5
  • UI framework: Thymeleaf

Data Model

Persistence

Storage Layer

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.

Structure

structure

Spring application architecture

Credit Manager is created with typical architecture of a Spring application. img.png

default server.port=8090
default homepage adress: http://localhost:8090/home

Controller

Controller consists of GET and POST requests to handle REST APIs, both from web browser and tool for rest api testing (Postman).

UI interface

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")

home

@GetMapping(value = "/createCredit")

Thymeleaf form collects data needed to create Credit.

create

Additional feature

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 get

Postman

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")

Bank Application

Overview

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.

Prerequisites

  • Java 11
  • Maven

Setup

  1. Clone the repository:
    git clone <repository-url> 
    cd bank 
  2. Build the project: Use Maven to build the project:
    ./mvnw clean install 
  3. Run the application: Start the application using the Maven wrapper:
    ./mvnw spring-boot:run 

Environment Configuration

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 like dotenv). 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.

Accessing the Application

  • The application will be accessible at http://localhost:8090.
  • The H2 console can be accessed at http://localhost:8090/h2.

Additional Information

  • 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/.

License

This project is licensed under the MIT License.

About

Credit Manager Application written in JAVA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 82.8%
  • HTML 16.6%
  • CSS 0.6%