Skip to content

capraztarik/loan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Loan Management System 🏦

A Spring Boot application that allows customers and admins to manage loans, track payments, and apply discounts/penalties based on payment timing.

📌 Features

  • Admin Features: Create loans for any customer, view all loans, and process payments.
  • Customer Features: View their loans, pay installments, and track outstanding balances.
  • Loan Payments: Apply early payment discounts and late payment penalties.
  • Security: JWT-based authentication with role-based access control.

🚀 Technologies Used

  • Java 23
  • Spring Boot 3
  • Spring Security (JWT)
  • Spring Data JPA (H2 Database - In-Memory)
  • Gradle
  • JUnit & Mockito (for testing)

🔧 Prerequisites

Before running the application, make sure you have:


📥 Setup & Run the Application

1️⃣ Clone the Repository

git clone https://github.com/capraztarik/loan.git
cd loan-management

2️⃣ Build the Project with Gradle

./gradlew clean build

3️⃣ Run the Application

./gradlew bootRun

4️⃣ View the Database

Since we are using an H2 in-memory database, you can access the database console in your browser:

Open: http://localhost:8080/h2-console
Use the following credentials:
JDBC URL: jdbc:h2:mem:testdb
Username: sa
Password: password

API Endpoints

Authentication

Method	Endpoint	Description
POST	/auth/register	Register a new user (Admin/Customer)
POST	/auth/login	Authenticate and get JWT token

Loan Management

Method	Endpoint	Description
POST	/loans/create	Create a new loan (Admin/Customer)
GET	/loans/customer/{customerId}	Get loans for a customer
POST	/installments/pay	Pay installments
GET     /installments/loan/{loanId} Get installments of a loan

Run Tests

Run All Tests
./gradlew test 
With report: ./gradlew clean test jacocoTestReport 
You can find coverage report: build/reports/jacoco/test/html/index.html

Postman documentation

https://documenter.getpostman.com/view/39752670/2sAYXFiHRz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages