Templates
Template Setup Guides

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 loan aggregator. It comes with card & 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, Stripe IDs), 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 and 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 regular 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 a share in funding a loan offer. 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 and Stripe API calls.

Card

Cards represent and hold information about cards. Which are brand, last4 and stripe_id.

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 and 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. 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 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.

Kyc

This page is for investors to upload their govt ID for Stripe verification. They are sent an email with a link to this page when they attempt a withdrawal which will cause them to reach Stripe's withdrawal threshold for accounts without ID verification.

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 address.

Reset_pw

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

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 sub pages 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 sub pages 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 or credit card.

Element

State

Note

Group Add Funds

method

Takes a text value of either bank, or card. It is set when either a card or bank is selected from the list of added banks or cards.

Group Add Funds

selected_card

Takes a card object and is set when a card is selected from the list of available cards.

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 sub pages 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 sub pages 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 either bank, or card. It is set when either a card or bank is selected from the list of added banks or cards.

Group Select Payment Method

selected_card

Takes a card object and is set when a card is selected from the list of available cards.

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 or card 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.

Monthly Loan Payments

When a successfully funded loan is originated, a monthly payment is immediately created with the due date set for 1 month ahead. An API workflow is also schedule for that due date which triggers a Stripe charge of that due amount, creates another monthly payment for the next month and schedules itself to happen again 1 month later.

The monthly payments are charged to borrowers bank accounts and rely on the bank_payment_successful API workflow triggered by a stripe webhook.

This API workflow when triggered will first search for a monthly_payment with the ID of the charge.succeeded object from Stripe. If found it triggers the monthly_payment_successful workflow which enriches the monthly_payment object with figures like you find in an amortization table. It also updates the relevant loan, transaction and investments and sends notification emails.

Flexible Loan Payments

Flexible payments can be made on a loan at any time and are of 3 types listed below. They rely on both bank_payment_successful and card_payment_successful API workflows depending on which payment method was used. The system is design to support paying of multiple loans at the same time. Each loan would have a separate transaction but will share the same Stripe charge. When the card or bank success endpoint is triggered the relevant transactions are set to successful after which a series of workflows are run on those transactions (of flexible payments) depending on their type.

  • Extra Payment: This is an additional payment made on a loan. In this template an additional payment will possibly reduce the term of the loan but maintain the same monthly payment until the balance on the loan is less than said payment. In the workflow the relevant loan balances are reduced and the normal monthly payment will be continue as usual.

  • Early Monthly Payment: This is simply an early monthly repayment which when made, is same as paying the next due monthly payment. In the card/bank successful workflow a check is run to see if the payment is for a monthly payment and if so 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. Also all future monthly payments are marked as paid.

Withdrawal

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

Note that if a withdrawal is going to trigger Stripe ID requirement on the investor's Stripe connect account, the kyc_check workflow will mark the investor's kyc_status field to needed and send an email telling them to upload their ID on the /kyc page. Such an investor's withdrawals won't be visible in admin until their ID is verified.

The admin then needs to approve this withdrawal after confirming that there are enough funds in the platform's Stripe account. When this transfer is successful it triggers the complete_withdrawal API workflow which then initiates a Stripe Payout to the investor.

Payments

This template uses Dwolla and Plaid for payments.

For more information, please check Dwoll Plugin setup.

Note: There are UI elements and workflows for Stripe card payment in the template on purpose, when the template owner wants to add a card processor that supports Lending business.

The UI elements and workflows are for adding and choosing cards for deposits and loan payments

Webhooks

This template uses four Stripe Webhooks for bank payments and withdrawals. Card payments are handled/verified in the front-end.

To configure them

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 previous page if they don't have admin access. You should enabled this workflow when you get this template. Step by step below:

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

  • 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 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 is where the investors share of the larger loan is calculated. admin can deduct a fee expressed as a decimal fraction and it would automatically mean 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 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 page has many overlapping elements as a single page application. All major sub 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 javascript used here does not need to be changed. It also relies on the JavascriptToBubble elements which must not be removed or edited.

  • HTML Voguepay element: This code is used for payment processing using VoguePay. Only one part of this code needs to be changed which is the merchant id. Replace the id within the quotes with your own merchant id gotten from Voguepay.

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.

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