CASE STUDY · SYSTEM

Loan Facilitation Engine

Bank-grade credit orchestration: satellite product frontends sync into one Flask API, Next.js bank portal, SHAP advisory, RCI policy plane, and an Ollama/Qwen memo sidecar.

Live systemProduction systemRead the publication ↓

TECHNICAL PUBLICATION

How it is built

USE CASE

Business challenge

A lending programme needed one application file of truth across vehicle, mobile, merchant, trade, and study-loan products — with the bank retaining final authority.

SYSTEM ARCHITECTURE

Architecture & data

Public topology: Consumer → Cleansing → SHAP scoring → RCI policy enforcement → Advisory recommendation → Bank API (RAAST/ACH). Nginx terminates TLS. Next.js bank portal (PM2) talks to Flask in Docker; PostgreSQL and Redis stay on loopback. memo-service (FastAPI) calls host Ollama; Flask falls back to a direct Qwen client if the sidecar is down. Product satellites are a factory: shared static shell, per-product sync prefixes, portal SSO bridge.

BACKEND

API design & authentication

JWT RS256 in HTTP-only cookies, CSRF on mutating routes, IAG roles for bank/admin/customer/partner. Advisory is explicitly non-binding — RCI is the bank’s master switch.

IMPLEMENTATION

Implementation & stack

Flask route modules for applications, documents, advisory, RCI, payments, underwriting, and customer/partner portals. Next.js App Router for the bank desk. Satellite HTML apps sync application_id, profile, status, and documents into a canonical applications table. SecureTrack enrols tracking assets after APPROVED.

SCALING

Performance & operations

Docker Compose for API; Gunicorn workers sized to the VPS; Redis for advisory/config cache; Ollama load-on-use / unload-on-idle to keep RAM bounded. Published system target on the LFE site: p99 under 400ms for the advisory path — a product SLO, not a personal KPI.

STACK

As shipped

Delivery packages

8 components

What this system runs on

The stack as deployed for Loan Facilitation Engine — chosen for the system's constraints, not for fashion.

Python 3.11FlaskNext.js 16PostgreSQL 15Redis 7Docker ComposeOllamaQwen 2.5

RELATED WORK

More systems

All systems

ENGAGE

Need a system like this?

Operational platforms, APIs, and AI-integrated systems — scoped as an engineer, with a stack and a boundary.