Corefin Save

The open-source lending infra

Project README

image

Open-Source Lending Infrastructure

Corefin is a highly scalable open-source loan management system that allows you to build and launch lending products. It uses the Actual/365 method for calculating interest. See information from the CFPB.

Getting started

Quick demo

Here's a demo on creating a loan, making a payment, and seeing all installments.

https://github.com/getcorefin/corefin/assets/3644245/673273d2-98f6-4d8e-a541-53ff7bbd43e6

Prerequisites

  1. Make sure you have Docker installed on your machine.
  2. Make sure you have Java17 installed on your machine.

To install Java17, run the following commands in the shell:

# Install Java17
brew install openjdk@17

# Check which Java versions you have installed
/usr/libexec/java_home -V

# Set your java version to Java17
export JAVA_HOME=$(/usr/libexec/java_home -v 17.0.10)

Running locally

To start running Corefin, run the commands in the shell:

# Get the code
git clone https://github.com/getcorefin/corefin.git

# Go to the folder
cd corefin

# Create docker stubs
make docker-stubs

# Perform DB migrations
make db-migrate

# Start
make run-server

Using Corefin

Create a loan

Here's an example of creating a 6 month term loan for $1000 at a 5% target interest rate.

curl --location 'http://localhost:8080/loans' \
--header 'Content-Type: application/json' \
--data '{
    "term": 6,
    "originatedAmount": 1000.00,
    "currency": "USD",
    "targetInterestRate": 0.05,
    "effectiveInterestRate": 0.05,
    "externalReference": "orderId_12345",
    "startDate": "2024-03-01",
    "endDate": "2024-09-01",
    "timezone": "America/Los_Angeles",
    "region": "US",
    "state": "CA"
}'

Make a payment

curl --location 'http://localhost:8080/payments/$LOAN_ID/makePayment' \
--header 'Content-Type: application/json' \
--data '{
    "amount": "171.56",
    "paymentType": "PAYMENT",
    "paymentDateTime" : "2024-03-01T12:00:00Z"
}'

View the installment schedule

# Connect to the DB
make db-shell

# Execute the following SQL
mysql> select loan_installment_id, num_term, principal_amount, interest_amount from loan_installment where loan_id="132b124a-e247-11ee-bf07-0242ac140002";
+--------------------------------------+----------+------------------+-----------------+
| loan_installment_id                  | num_term | principal_amount | interest_amount |
+--------------------------------------+----------+------------------+-----------------+
| 132b124a-e247-11ee-bf07-0242ac140002 |        1 |           129.62 |          424.66 |
| 132d3525-e247-11ee-bf07-0242ac140002 |        2 |           196.59 |          357.69 |
| 132e2291-e247-11ee-bf07-0242ac140002 |        3 |           268.15 |          286.13 |
| 132eab9b-e247-11ee-bf07-0242ac140002 |        4 |           405.64 |          166.70 |

Roadmap

Check out our public roadmap for a more detailed view.

At a high level, we're working on the following features next:

  • Early/on-time/late payments
  • Custom installment amount payments
  • Support for other lending products such as MCAs
  • Robust reporting API

... and many more!

Corefin community

Contributions and development environment

Coming soon!

Open Source Agenda is not affiliated with "Corefin" Project. README Source: getcorefin/corefin
Stars
166
Open Issues
18
Last Commit
4 weeks ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating