Skip to content

r4fcode/loan-rules-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loan Rules Engine

This is a Spring Boot application that demonstrates the use of the Drools rules engine to evaluate loan eligibility based on dynamic business rules.

🧰 Tech Stack

  • Java 17
  • Spring Boot
  • Drools (rules engine)
  • MongoDB (for rule storage, optional)
  • Maven
  • Docker & Docker Compose

🚀 Running Locally with Docker

1. Clone the repository

git clone https://github.com/oliveira-a-rafael/loan-rules-engine.git
cd loan-rules-engine

2. Build the application

mvn clean package

This will create the loan-rules-engine.jar in the target/ directory.

3. Run with Docker Compose

docker-compose up --build

The application will be available at:
http://localhost:8080


🧪 API Endpoints

GET /health

Returns basic health status.

{
  "status": "UP",
  "timestamp": "2025-08-14T15:00:00Z"
}

POST /loan/evaluate

Evaluate loan eligibility for a person.

Request Body

{
  "name": "Alice",
  "score": 720
}

Response

{
  "name": "Alice",
  "score": 720,
  "eligible": true
}

📁 Environment Variables

Set in .env (should not be committed):

MONGODB_URI=mongodb://mongo:27017/loanrules
SERVER_PORT=8080

📜 License

MIT

About

This is a Spring Boot application that demonstrates the use of the Drools rules engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors