NextJS + Prisma + Sign in with Ethereum
The lending platform provides the user interface which allows both borrowers and approvers to access the system.
There is some basic backend functionality through a few endpoints. We handle incoming proofs from Reclaim protocol when users connect their bank account.
There are also two pages which allow the platform to act as a Reclaim data provider to allow users to complete the proof creation flow.
- borrowers sign in with their wallet
- the borrower performs a kyc for their account address
- after the kyc, the borrower can apply for a loan by creating a loan request
- during the loan creation process, bank account transaction history as well as credit score are collected in order to process the loan
- approvers can review and accept/reject a loan application
First, you should set up the Loan Pool Smart Contracts and Cartesi instance for local development.
Copy the example.env
file and fill in the missing variables:
cp .example.env .env
You will need a local instance of postgres:
docker compose up db
Install all modules:
npm i
Run the database migrations:
npx prisma generate && npx prisma migrate dev
Run the dev server (for local dev, the local Cartesi machine should be running):
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
Sign in with Wallet Connect. This will create an account for you as a "BORROWER".
You can request loans.
If you would like to approve loans, make yourself a "APPROVER".
- You will be asked to KYC the first time. Follow the instructions on the top right for sandbox data.
- Create a new loan application
- Submit
- Click on the loan in the list
- Hit the approve button and the funds will be sent to the user
Normally notices are processed through a CRON job on vercel.
Trigger manually:
GET http://localhost:3000/api/cron/notices
with Authorization: Bearer {CRON_SECRET}
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.