PN
BackendCase Study

LendGraph

Private credit infrastructure for automated loan management and investor intelligence

KotlinSpring BootPostgreSQLReactTypeScriptNext.jsOpenAI API

The live demo runs the Next.js frontend on sample portfolio data. The Kotlin/Spring Boot backend is in the repository.

Problem

Private credit often suffers from fragmented data siloed in static documents. Lenders lack real-time visibility into portfolio health, and investors struggle with opaque capital allocation. Manual tracking of complex loan covenants leads to delayed risk detection and operational inefficiency.

Approach

Built a 'Heartbeat' system that centralises the loan lifecycle. The approach shifted from simple data entry to 'underwriting intelligence' by automating risk detection (LTV/ICR breaches) and using AI to parse unstructured legal documents into a relational PostgreSQL schema with a full audit trail.

Architecture

Decoupled architecture using a Kotlin backend for financial precision and a React-based high-density dashboard for data visualisation.

1

Presentation Layer

React/Next.js dashboard with professional-grade data viz (Recharts) and real-time status indicators.

2

AI Extraction Layer

Next.js API routes integrated with LLMs to parse PDF facility agreements into structured JSON objects.

3

API & Service Layer

Kotlin Spring Boot services handling complex financial math (IRR, WAC) and business logic.

4

Data Access Layer

JPA/Hibernate with Type-safe repositories ensuring strict relational integrity for loan-to-investor mappings.

5

Persistence Layer

PostgreSQL database with custom constraints to prevent invalid financial states (e.g., negative interest).

Key Engineering Decisions

Kotlin for financial precision

Chose Kotlin over Node.js for the core engine to leverage its strong typing and null-safety, important when handling large volumes of financial data without runtime precision errors.

Automated Covenant Breach Detection

Implemented a reactive monitoring service that flags loans (e.g., Brighton Marina Ventures) immediately when LTV exceeds thresholds, rather than waiting for manual monthly reviews.

Relational Mapping for Capital Allocation

Modelled a many-to-many relationship between Investors and Loans to power the 'Capital Allocation Engine,' allowing investors to see their exact exposure across the entire portfolio.

AI-Powered PDF Extraction

Integrated LLM parsing to automate the extraction of principal, interest, and covenants from legal documents, replacing manual data entry during borrower onboarding.

Security Considerations

Implemented JWT-based authentication with fine-grained access control to separate Lender admins from Capital Providers. All financial mutations are logged in an immutable audit trail. Database-level constraints enforce LTV and interest rate bounds to prevent data corruption.

Testing Strategy

Developed a test suite with a focus on financial-calculation accuracy (IRR/LTV), using JUnit 5 and MockK for the Kotlin backend. End-to-end flows were validated using Playwright.

Outcome

A fintech MVP that demonstrates how to automate private credit infrastructure. The system provides immediate visibility into high-risk assets and automates the most labour-intensive parts of loan management.

Interested in working together?

Let's discuss your next project.

System Audioclick to enable
OFF