PN
BackendCase Study

LendGraph

Private credit infrastructure for automated loan management and investor intelligence

KotlinSpring BootPostgreSQLReactTypeScriptNext.jsOpenAI API

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 centralizes 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, ensuring 100% data auditability.

Architecture

Enterprise-grade decoupled architecture utilizing a high-performance Kotlin backend for financial precision and a React-based high-density dashboard for data visualization.

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, critical for handling billions of pounds in loan 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

Modeled 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, reducing borrower onboarding time from hours to seconds.

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 robust test suite focusing on financial calculation accuracy (IRR/LTV). Utilized JUnit 5 and MockK for the Kotlin backend, aiming for high coverage to meet kennek's 3,500+ test standard. End-to-end flows were validated using Playwright.

Outcome

A production-ready fintech MVP that successfully demonstrates how to automate private credit infrastructure. The system provides immediate visibility into high-risk assets and automates the most labor-intensive parts of loan management, directly aligning with kennek's product vision.

Interested in working together?

Let's discuss your next project.

System Audioclick to enable
OFF