Plugins
Templates

Lendy - P2P Lending Template

Template page link: https://zeroqode.com/template/lendy---p2p-lending-template-1558607966599x278265862713751520

Introduction

Lendy is a full-featured peer-to-peer lending application built without code. This is a great no-code template for a microfinancing company, small quick loans, or even a loan aggregator. It comes with bank payments, multiple loan repayment options, loan grading/rating system, admin & investor dashboards and more.

Features

  • Fully responsive pages and user dashboard

  • Fully responsive Admin Dashboard for Management

  • Secure & Fintech Compliant Signup Process

  • Bank payments powered by Dwolla and Plaid

  • Withdrawals powered by Dwolla and Plaid

  • Flexible loan repayment system

  • Standard Email Notifications

Data Structure

User

Users are either investors or borrowers on the platform. They store the usual profile info (Photo, Name, Email Address), more detailed personal info (Address, Income, etc), payment- related info (Bank accounts, cards), role-specific objects (investments or loans) and a host of other things.

Loan

Loans represent loan offers or actual loans given to borrowers on the platform. They contain information about the loan like amount, interest rate, relevant dates and many other fields most of which are annotated in the editor.

Loan_grade

Loan_grades or Ratings are guides used to help determine the interest rate to be offered to an intending borrower based on their credit score. Each loan_grade has a min and max credit score field and borrowers that have scores within that range will have the loan_grades' interest_rate applied to their offers.

Monthly_payment

Monthly_payments are the regularly scheduled payments that are made over the term of the loan. They are created every month with the first one created right after the related loan is originated. At the same time, an API workflow is scheduled for 1 month ahead which makes the Stripe charge on the user's default_bank_account, creates a new monthly_payment and schedules itself again for 1 month ahead.

Investment

Investments represent an amount of money used to fund a loan. They contain information about the investment like amount, share of loan amount, total_interest_gained, loan_id status etc.

Withdrawal

Withdrawals are used to handle fund withdrawals by investors. They contain information like amount, reference, destination bank_account, status etc.

Bank_account

Bank_accounts represent and hold information about bank accounts authenticated via plaid. They contain some reference information like name, type, sub_type and some important tokens and ids for Plaid calls.

Transactions

Transactions are used to track all major financial operations on the platform which are loan payments, account funding, and withdrawals.

Pages

Index

This is the main landing page of the template. It contains basic information for new users to learn more about the platform. It has a header, hero, "benefits" section, "how it works" section, statistics section, testimonials section call-to-action, and footer.

Borrow

The borrow page is where intending borrowers sign up, check their applicable interest rate, and submit a loan request (or accept a loan offer).

Element

State

Note

Page borrow

step

Takes a text value of either details, ssn, loanoffer or notfound and shows the relevant group in the process.

Group Final Steps

step

Takes a number value gotten from the user's current loan requests application_step field. The value ranges from 1 (New Offer) to 5 (Submitted Application).

Signup

This page is where intending investors sign up.

Element

State

Note

Group Steps Desktop

step

Takes a number value gotten from the current user's investor_signup_step field. Value ranges from 1 (Yet to sign up) to 4 (Sign up completed).

Signin

This contains the login form and allows users (investors and borrowers) to login with their email.

Invest

This is similar to the main landing page of the template and contains basic information for prospective investors to learn more about the platform. It has a header, hero, "benefits" section, "how it works" section, statistics section, testimonials section call-to-action and footer.

Loans

This is similar to the main landing page of the template but is meant for showcasing the loan types supported by the platform contains basic information for prospective investors to learn more about the platform. It has a header, hero with a form, loan types section, how it works section, statistics section, testimonials section call-to-action and footer.

Listings

The listings page showcases a list of loan requests that potential investors can fund.

Element

State

Note

Group Filter Loans Rating

current

This is either empty or contains a loan rating letter which can be A, B, C, D or E. It is used to constrain the search for loans when not empty.

Group Filter Loans Term

current

This is either empty or contains a loan term which can be 36 OR 60. It is used to constrain the search for loans when not empty.

Loan List

selected_loans

This is a list of loans that have been selected by the investor as possible loans to fund.

Listings

show_count

This takes a number value which determines how many loans are displayed.

Popup Confirm Investments

investments

This is a list of investments which the investor will be making it selected loans.

About

This page is for the company information and has 3 sections which are

  • About us

  • Team

  • Press

Forgot-password

This page is for users to request a password reset link with their email addresses.

Reset_pw

This page is where users can set a new password for their accounts.

Confirm-email

This page is the success page where users are directed to after successfully verifying their email address.

Dashboard

This is the user dashboard for investors to manage their accounts, add or withdraw funds, browse and invest in loans and view their transactions. It is broken down into the subpages listed after this table.

Element

State

Note

Dashboard Menu

current

Takes a text value of either dashboard, investments, loans, transactions, addfunds, withdrawfunds or settings. This determines which of the subpages below will be visible.

Dashboard Group

This is an overview of the investor's account. It hosts the add fund & withdraw buttons, email verification alert, pending investments, and some summary/breakdown of the investor's portfolio.

Investments Group

This shows a list of all investments made by the user with a group for detailed view of these investments.

Element

State

Note

Group Filter Investment Status

current

This is either empty or contain an investment status which can be active, pending, late or completed. It is used to constrain the search for investments when not empty.

Group Filter Investment Term

current

This is either empty or contains an investment term which can be 36 OR 60. It is used to constrain the search for investments when not empty.

Group Filter Investment Grade

current

This is either empty or contains an investment rating letter which can be A, B, C, D OR E. It is used to constrain the search for investments when not empty.

Add funds Group

This is where investors can deposit funds into their account via bank accounts.

Element

State

Note

Group Add Funds

selected_account

Takes a bank_account object and is set when a bank account is selected from the list of available bank accounts.

Withdraw funds Group

This is where investors can withdraw funds into their bank account.

Element

State

Note

Group Add Funds

selected_account

Takes a bank_account object and is set when a bank account is selected from the list of available bank accounts.

Transaction History Group

This shows investors a list of all their past transactions and their respective statuses.

Loans Group

This group is similar to the /listings page which showcases a list of loan requests that potential investors can fund.

It has the same custom states available on that page.

Element

State

Note

Group Filter Loans Rating

current

This is either empty or contains a loan rating letter which can be A, B, C, D OR E. It is used to constrain the search for loans when not empty.

Group Filter Loans Term

current

This is either empty or contains a loan term which can be 36 OR 60. It is used to constrain the search for loans when not empty.

Loan List

selected_loans

This is a list of loans that has been selected by the investor as possible loans to fund.

Listings

show_count

This takes a number value which determines how many loans are displayed.

Popup Confirm Investments

investments

This is a list of investments which the investor will be making it selected loans.

Settings Group

Here investors can manage some aspects of their profile info like name & address as well as change their email or password.

Account

This is the user dashboard for borrowers to manage their accounts, repay their loans & view their transactions. It is broken down into the subpages listed after this table.

Element

State

Note

Dashboard Menu

current

Takes a text value of either dashboard, makepayment, selectpayment, documents, transactions or settings. This determines which of the subpages below will be visible.

Dashboard Group

This is an overview of the investor's account. It hosts the email verification alert, pending loan application, a summary/breakdown of the borrower's account and most importantly the list of loans they've taken.

Make Payment Group

This is where borrowers can select the loans they would like to make a payment for and choose which kind of payment they want to make.

Element

State

Note

Group Make a Payment

selected_loans

This is a list of loans selected by the borrower that they'll like to make a payment for.

Select Payment Method Group

This is usually displayed after selecting loans to repay and is where borrowers choose a payment method.

Element

State

Note

Group Select Payment Method

method

Takes a text value of bank. It is set when a bank is selected from the list of added banks.

Group Select Payment Method

selected_account

Takes a bank_account object and is set when a bank account is selected from the list of available bank accounts.

Group Select Payment Method

current_payment

Takes a monthly_payment. It is used when selecting a payment method to pay off a single monthly payment which is due on a loan.

My Documents Group

This is where borrowers can upload their required documents like Govt ID and Payslip.

Transaction History Group

This shows borrowers a list of all their past transactions and their respective statuses.

Settings Group

Here borrowers can manage some aspects of their profile info like name & address as well as change their email or password.

Specific References

Signing up (Investors)

Investor sign up is broken down into 3 steps which are

  • Setup Account: This is step one add the setup group is visible for those yet to sign up. Once they sign up with their email and password the field investor_signup_step in their user account is set to 2 and they move on to step two below.

  • Personal Details: The personal details form is visible once signed up and after filling it

    the field investor_signup_step in their user account is set to 3 and they move on to step three below.

  • Fund Account: Here investors must deposit some funds into their account via bank account after which the field investor_signup_step in their user account is set to 4 and they would have now completed the sign up process with the success group becoming visible.

Signing up (Borrowers)

Borrower sign up is broken down into 4 steps with the first step having some sub steps. They are outlined below:

  • Check your Rate: This is where users sign up and check their interest rate.

    • Main form: This contains a form for some loan & personal info as well as the signup form with email and password.

    • SSN form: Next they are showed the form to collect their social security number and credit score. From their credit score their loan_grade is set and loan offers are computed. The loans application_step will be set to 1.

    • Apply for Loan: After their loan_grade is set they are given loan offers and they can select one to "Apply for a loan" after which the field application_step in their loan is set to 2 and they move on to step two (personal details) below

    • Not found: If their score is not found they are shown this failure message group.

  • Personal Details: The personal details form is visible once they've signed up and selected a loan offer. Here they provide more personal details after which the field application_step in their loan is set to 3 and they move on to step three below.

  • Loan Terms: Here they are presented with a legal loan terms document they must read and accept after which the field application_step in their user account is set to 4 and they move on to step 4.

  • Bank Information: Here they must connect their bank account to the platform via Plaid and this account will be used for loan payments and to send the loan to them if successfully funded. After this the field application_step in their user account is set to 5 and they would have now completed the sign up process with the success group becoming visible.

Loan computations are in two folds. One part in the front-end and the second part in the backend. On the borrow page, loan computations are handled by two Loan elements. They run the calculations and provide near-instant results used in displaying the loan offers. The second part is after the user accepts a loan offer. An API workflow (loan_complete) is triggered which runs same calculations in the backend but this time saves the results on the selected loan.

Navigation between tab on the /account and /dashboard page is powered by the custom state current on the element Dashboard menu and conditional statements on the sub page groups that make them visible when true.

Loans & payments

This template uses Dwolla and Plaid for payments.

For more information, please check Dwoll Plugin setup.

Requesting a loan happens on the borrow page. There all the necessarily details are requested and upon the part (check "Loan offers") where you select one of the available offers a Schedule API Workflow loan_complete will be triggered which will calculate the monthly payments, total interest, total payments and other loan related details using the Loan Calculations plugin (check "Loan calculations)".

Loan offers
Loan calculations

After the loan request was submitted the admin will have to approve it before it can be eligible for investments. Upon approval the status of the loan will be changed to "listed" and the loan will be visible to investors.

When a loan was approved an investor can make an investment to it. After confirming the investment a Schedule API Workflow fund_loan will be set to start 4 hours from now. During this time frame, the investor can increase his investment or cancel it altogether. While his investment is attached to the loan, other investors can't invest to it.

Making an investment

When the fund_loan workflow is triggered the borrower will receive his funds from the investor trough Dwolla and the first monthly payment will be created as well as setting the recurring event monthly_repayment which is used for creating monthly payments for the each period end of the loan.

Sending funds to borrower

Monthly Loan Payments

When a loan is successfully funded, a monthly payment is immediately created with the due date set for 1 month ahead. The recurring event monthly_repayment is initialized to create monthly payments at the end of each period end.

The monthly payments are charged to the borrower's bank accounts and rely on the dwolla_payment_successful API workflow triggered by a Dwolla webhook.

This API workflow receives information about all the transactions that happen in the app. It updates the relevant loan, transaction and investments as well as account funding and sends notification emails.

Flexible Loan Payments

Flexible payments can be made on a loan at any time and are of 2 types listed below. They rely on both dwolla_payment_successful API workflow. The system is designed to support paying off multiple loans at the same time.

  • Monthly Payment: This can simply be an early monthly repayment or the next due monthly payment. If the bank transaction is successful, a workflow check is run to see if the payment is for a monthly payment and if yes it triggers the monthly payment successful workflow. The relevant loan balances are reduced & next due date updated, the next due monthly payment is marked as paid.

  • Payoff: This is a final payment that closes the loan afterwards. The borrower will be paying the entire loan balance. In the workflow, the loan balance & next payment amount is cleared and it is marked as a paid loan. All future monthly payments are marked as paid.

Withdrawal

Withdrawals are powered by Dwolla. When an investor requests a withdrawal a new withdrawal object is created with status as pending.

The admin then needs to approve this withdrawal and after that the funds will be sent to the receiver account through Dwolla.

Webhooks

To receive webhooks in Dwolla, you need to subscribe to them with the plugin action "Create webhook subscription".

Ideally, you are going to create 2 subscriptions. The first one is to initialize the API endpoint to fetch the request data.

On a test page in your app add a workflow to create a webhook subscription. The URL to be subscribed should be that of the API endpoint wherein you wish to receive these webhooks.

The API workflow endpoint URL should be copied from the detecting request data mode of the API endpoint like below

After you have subscribed to the URL gotten above, trigger a webhook event by creating an unverified customer so that your endpoint can detect the request data and then you can save it.

Once this is done, create another subscription for this URL but without the /initialize portion.

If you want, you can delete the first initialize webhook subscription using the delete webhook subscription plugin action.

Handling Webhook events

The most common use of webhooks is to confirm the success or failure of transfers to or from users. In your API endpoint which receives all Dwolla webhook events, you can trigger other API workflows depending on the kind of webhook event received.

As seen in the image above, a workflow called monthly_payment_successful is triggered when a search for monthly payment which has the ID fetched from the transfer resource URL and when the webhook event has a topic of transfer_completed. It then terminates the workflow based on the same condition. If this condition is not met, it moves on to the next one workflow action whose condition is met.

Email Confirmation

The /account and /dashboard pages have workflows that will redirect a user back to the sign in page if they haven't verified their email 1 day after they signed up. You can decide to disable this workflow or adjust the number of days. You would also need to change the number of days in the blue email confirmation alert box in the alert tab.

Admin

The admin page is currently open to all visitors logged in or not but with read-only access (they can't perform any actions). To have full access the user must have their current user's is_admin field set to yes. There is also a disabled workflow that redirects users back to the previous page if they don't have admin access. You should enable this workflow when you purchase this template.

Follow step by step guidelines:

  • Signup as a borrower or investor (Or create a simpler quicker signup form if needed)

  • Find your user in the Bubble database and set is_admin field to yes

  • Go to the /admin page workflow tab and enable the 3rd workflow

  • Go to the /admin page design tab, click Group Page element, untick "This element is visible on page load"

  • Freely visit the admin page with full access as long as you are logged in while users without is_admin set to yes would have no access.

Admin fees

Admins (platform) can get fees from either investors or borrowers.

For borrowers, loan fees can be added to loan computations and then deducted from the amount sent to the borrowers if their loans are funded and originated. These fees can be referred to as prepaid financing fees as can be seen in this calculator: https://www.calculatorsoup.com/calculators/financial/apr-calculator.php

For investors, fees collection is not setup by default as there is no really standard way to do it. Below is an example of one way you can collect fees from investors:

The image below shows how the investors' share of the larger loan is calculated. The admin can deduct a fee expressed as a decimal fraction and it would automatically mean an investor will receive all returns less that fraction.

For example, if an investor puts in $10 for a $100 loan, their share is 10% stored as 0.1 in the database. If the admin wants to take a fee of 1% of the investor's returns, then the admin will remove 0.001 (1% of 10%) from the investor's share. So the 0.1 share will become 0.099.

Notes

You will find notes for this template in Bubble. They are for workflows and fields that need explaining. Mostly in User data fields, dashboard workflows and API workflows.

Things to Note:

Overlapping Elements

The Dashboard design page has many overlapping elements as a single page application. All major pages, data views and forms are overlapping each other. In addition, in major repeating groups, there exist desktop and mobile versions overlapping each other.

Custom Code

Dashboard Page

  • Page is loaded workflow: The custom CSS code used for styling here does not need to be changed. It relies on the CSS Tools plugin action which must not be removed or edited to maintain the correct styles across browsers.

Index, About, & Invest Pages

  • Page is loaded workflow: The custom javascript used here does not need to be changed. It is used for jumping/scrolling to sections. It also relies on the JavascriptToBubble elements which must not be removed or edited.

Loan_terms_not

  • Page is loaded workflow: The custom javascript used here to convert an integer words representation does not need to be changed. It also relies on the JavascriptToBubble elements which must not be removed or edited.

Borrow Page

  • Do when Current User's current_loan_request is not empty and Current User's current_loan_request's apr is empty and Current User's loan_grade is not empty workflow: he custom javascript used here does not need to be changed. It is used for APR calculations. It also relies on the JavascriptToBubble elements which must not be removed or edited.

Signup Page

  • Do when Group Fund is visible workflow: The custom javascript used here does not need to be changed. It is used for card validation and feedback. It also relies on the JavascriptToBubble elements which must not be removed or edited.

Tip: You can find the above workflows & elements using the search bars in design tab or workflow tab as the case may be.

Demo to preview the template