PROJECT 02 • EXPLAINABLE FINTECH AI

TRUSTCART AI
RECOVERY ENGINE.

An AI-assisted e-commerce checkout recovery platform that observes live behavioral telemetry, scores 0–100 checkout friction, diagnoses root payment failure causes with evidence, and enforces bounded recovery rules with immutable audit logging.

Next.js 14TypeScriptFastAPI17 ORM ModelsRazorpay HMACDocker Compose
TrustCart AI Preview
TELEMETRY
12+ Signals
SAFETY GUARD
MAX_RETRIES = 2
17 Entities
SQLAlchemy ORM Schema
12+ Signals
Real-Time Friction Features
0–100 Score
LOW to CRITICAL Risk Tiers
MAX_RETRIES=2
No-Double-Charge Policy
01 / Overview

TURNING CHECKOUT FAILURES INTO SAFE RECOVERIES.

When digital checkouts fail due to gateway drops or bank declines, blind retry loops risk double charges. TrustCart AI pairs deterministic feature extraction with explainable policy guardrails.

01

Indian E-Commerce Storefront

Complete Next.js 14 App Router storefront covering Home, Product Catalog, Details, Cart, and Checkout flows.

02

12+ Telemetry Signals

Captures checkout failures, session duration, idle time, field validation errors, cart value, and retry timing.

03

0–100 Friction Scoring

Computes transparent checkout friction across LOW, MEDIUM, HIGH, and CRITICAL tiers with explicit factor breakdowns.

04

XAI Root-Cause Diagnosis

Classifies PAYMENT_METHOD_FAILURE, NETWORK_FAILURE, BANK_DECLINE, and VALIDATION_ERROR with confidence scores and evidence lists.

05

Bounded Policy Engine

Hard-enforces MAX_RETRIES = 2 and double-charge state machine prevention while surfacing a transparent Recovery Modal.

06

Razorpay HMAC & Audit Trail

Verifies server-side Razorpay signatures + event_id webhook idempotency and logs every decision step to /merchant/audit-logs.

02 / Architecture

HOW IT WORKS.

Frontend telemetry streams to FastAPI routers, evaluates payment state machines in SQLAlchemy, and updates Merchant BI.

STAGE 01

Telemetry

12+ checkout & idle signals captured.

→
STAGE 02

Friction Score

0–100 risk index with factor weights.

→
STAGE 03

XAI Diagnosis

Evidence-backed root failure reason.

→
STAGE 04

Bounded Policy

MAX_RETRIES = 2 & double-charge lock.

→
STAGE 05

Verified Audit

Razorpay HMAC + /merchant/audit-logs.

03 / Screenshots

APPLICATION SCREENSHOTS.

Live screens captured from the running application. Click any image to view full size, or follow setup instructions in the GitHub repository.

04 / Technical Details

PAYMENT SAFETY & EXPLAINABILITY ARCHITECTURE.

Key modules, rules, safety checks, and automated test results documented in the repository.

Component Mechanism Guarantee
Webhook Security Raw-body HMAC SHA256 + event_id table Idempotent duplicate webhook defense
Policy Guardrails State machine + MAX_RETRIES = 2 lock Zero accidental double charges
Merchant Analytics /merchant Recharts funnels & KPIs Database-backed recovery metrics
Demo Sandbox Interactive /demo telemetry simulator Live step-by-step decision replay
05 / Tech Stack

CORE TECHNOLOGIES.

Frameworks, databases, visualization tools, and testing libraries used in TrustCart AI.

FRONTEND APP
Next.js 14 • React 18 • TypeScript
BACKEND API
FastAPI • Pydantic v2
PERSISTENCE
SQLAlchemy (17 Models) • SQLite / Postgres
PAYMENTS
Razorpay Test API • HMAC-SHA256
VISUALIZATION
Tailwind CSS • Recharts • Lucide
DEVOPS & QA
Docker Compose • Pytest Suites
06 / Next Steps

FUTURE ENHANCEMENTS.

Upcoming improvements planned for TrustCart AI.

Live UPI intent fallback routing when netbanking latencies spike.
Redis-backed sliding-window velocity throttling per customer session.
Calibration curves comparing predicted vs actual recovery conversion rates.
Multi-merchant tenant isolation with API key management.
Webhook dead-letter queue with exponential backoff replay.
A/B holdout experiment analyzer inside the /merchant console.
OPEN-SOURCE PROJECT • GITHUB.COM/RAGURAMRRP

EXPLORE SOURCE & DOCS.

View the complete codebase, sample datasets, quick-launch scripts, and automated test suites on GitHub.