← all projects
Fintech Platform

TrustRail

B2B trust orchestration platform for Nigerian businesses. AI-powered bank statement analysis, trust scoring, automated installment payments via NIBSS direct debit.

AI-powered BNPL platform enabling businesses to offer installment payments. Features GPT-4 bank statement analysis, trust scoring (0-100), and automated payment collection via PayWithAccount/NIBSS.

React
TypeScript
Node.js
Express
MongoDB
OpenAI

Problem Statement

Nigerian businesses — schools, hospitals, e-commerce platforms, professional services — lose sales because customers can't pay large amounts upfront. Offering installment plans normally requires building payment infrastructure, integrating with a credit bureau, and absorbing default risk. For most SMEs that's prohibitive: there's no reliable consumer credit history to underwrite against, and direct-debit rails are hard to access.

Proposed Solution

TrustRail is a B2B trust-orchestration layer that lets any Nigerian business offer "pay-later" without writing a line of payment code. A business creates a TrustWallet (an installment offer), shares a public link with its customer, and TrustRail handles the rest: it collects the customer's bank statement, uses AI to assess real financial capacity (not credit history), issues a trust score (0–100), and — if approved — sets up automated direct-debit collection via PayWithAccount (PWA) on the NIBSS rail.

Full Solution Details

  • Business onboarding — register a business account, upload verification documents (multi-step registration with Nigerian-bank selection), and manage everything from a dashboard.
  • TrustWallet management — create installment products, view per-wallet analytics, and track the applications attached to each.
  • Customer-facing public flow — customers open a TrustWallet link, submit an application with a bank statement (PDF or CSV), and check their status — no account required.
  • AI underwriting — a background job picks up pending applications, runs the statement through GPT-4 with a tuned prompt, derives income/spending/behavior signals, and produces a trust score plus a human-readable decision rationale.
  • Automated collection — approved applications create a PWA/NIBSS direct-debit mandate; a payment-monitor job watches for overdue and defaulted payments and mandate-activation delays.
  • Manual override — businesses can approve/decline applications by hand, export applications to CSV, download reports, and contact customers.

Technical Documentation

Frontend is a Vite + React + TypeScript SPA organized by Feature-Sliced Design — each feature (auth, dashboard, trust-wallets, applications, public) owns its own api/ (TanStack Query hooks), screen/ (+ parts/), helpers/, guards/, and routes. Server state is handled entirely through TanStack Query and TanStack Table; routing via React Router with auth/guest route guards and a token-storage helper. Tests run on Jest with strict ESLint + Prettier + type-check gates.

Backend is Node 20 + Express + TypeScript on MongoDB (Mongoose), structured as config → models (9) → routes (11) → controllers (10) → services (11) → jobs (3) → middleware → validators. Two native Node background jobs run without Redis: a Statement Analysis Job (every 60s) that processes applications, calls OpenAI, scores, and creates PWA mandates; and a Payment Monitor Job (every 5min) that detects overdue/defaulted payments. Security: JWT + bcrypt auth, TripleDES encryption for the PWA API integration, Winston logging. Public, authenticated, webhook, and admin route groups are separated.

Tech Stack

React, TypeScript, Vite, TanStack Query, TanStack Table, React Router (frontend); Node.js 20, Express, TypeScript, MongoDB/Mongoose, OpenAI GPT-4, JWT, bcrypt, TripleDES, Winston (backend); PayWithAccount / NIBSS direct debit.

System Design

Customer ──link──> Public TrustWallet page ──apply (PDF/CSV)──> TrustRail API
                                                                   │
                                          ┌────────────────────────┤
                                          ▼                        ▼
                              Statement Analysis Job        MongoDB (9 models)
                              (60s) → OpenAI GPT-4                  ▲
                                          │ trust score 0-100      │
                                          ▼                        │
                              Create PWA/NIBSS mandate ───────────►│
                                          │
                              Payment Monitor Job (5min)
                              → overdue / default detection
                                          │
Business ──JWT──> Dashboard / Applications / Analytics ◄── webhooks ── PWA

Smart Architectural Decisions

  • Underwrite on cash-flow, not credit history. Nigeria lacks reliable consumer credit data, so the AI scores against the customer's actual bank statement — turning a data-availability problem into a product advantage (approval in 2–5 minutes, no bureau).
  • No Redis for background work. Two native interval-driven Node jobs handle async analysis and payment monitoring, keeping the deployment footprint minimal while still decoupling slow AI calls from the request path.
  • Trust orchestration, not execution. TrustRail deliberately leaves direct-debit execution to PWA/NIBSS and owns only eligibility, consent, retries, defaults, and auditability — a clean separation that avoids becoming a regulated payment processor.
  • Feature-Sliced Design on the frontend keeps each domain self-contained (api/screen/helpers/guards), which scales cleanly as new flows (public application, analytics) are added.

Impacts

Gives any Nigerian business risk-managed BNPL with zero technical integration and no upfront default risk — only AI-approved customers get installments. Customers get transparent, capacity-based approval (score + rationale) without a credit check.

Demonstrated Skills

Full-stack TypeScript; LLM-as-underwriter (prompt design, PDF/CSV ingestion, structured scoring); fintech domain modeling (mandates, consent, retries, defaults); payment-rail integration (PWA/NIBSS) with TripleDES crypto; background-job design without external infra; Feature-Sliced Design; TanStack Query/Table data layer; auth/security (JWT, bcrypt, route guards).

Notes

  • Solves a real market gap: consumer credit underwriting in a country with no reliable credit-bureau coverage, by scoring live bank-statement cash-flow with an LLM.
  • Demonstrates judgment in regulatory scoping — building the trust/consent/audit layer on top of PWA/NIBSS rather than becoming a payment processor.
  • Production-grade backend hygiene: 9 models / 11 services, separated public/auth/webhook/admin route groups, Winston logging, TripleDES for a partner API, and JWT+bcrypt.
  • Async AI underwriting via native Node jobs (no Redis) shows pragmatic, cost-aware infra decisions.
  • Clean, scalable frontend (Feature-Sliced Design + TanStack Query/Table) with CSV export, report download, and manual approve/decline override flows.
Ask me anything