Giter VIP home page Giter VIP logo

corefin's Introduction

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.

demo.mp4

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!

corefin's People

Contributors

huberttsen avatar albertjo avatar chahakgoswami avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.