Introduction

SmartBank is an Enterprise Predictive Lead Scoring platform designed to revolutionize how banks identify potential customers using Artificial Intelligence. We bridge the gap between raw data and actionable sales insights.

The Problem

Traditional Banking Inefficiencies

Banks currently rely on cold-calling lists with no intelligence, leading to wasted resources.

Low conversion rates (~2%)
High Customer Acquisition Cost (CAC)
Agent burnout from rejection
Generic, impersonal offers
The Solution

AI-Driven Intelligence

An advanced machine learning pipeline that processes customer data to predict intent.

Analysis of 20+ data points
Macroeconomic context aware
Real-time inference engine
Seamless API integration
The Impact

Measurable Business Growth

Transforming cost centers into profit centers by focusing on high-probability targets.

3x Higher conversion rates
40% Reduction in call volume
Personalized customer journey
Data-backed decision making

Why SmartBank?

Unlike traditional CRM tools that only store data, SmartBank understands it. By combining customer demographics with dynamic macroeconomic indicators (such as Euribor rates and Consumer Price Index), our models adapt to changing market conditions, ensuring your sales team is always one step ahead.

High-Level Architecture

Visualization of SmartBank's cloud-native infrastructure. The system is designed with a clear separation of concerns between the User Interface, API Gateway, and Intelligence Engine.

Client Zone
App Cluster
3rd Party
Web BrowserChrome / Edge
Mobile AppPWA View
CloudflareWAF & DNS
FrontendNext.js Container
Backend APINestJS Core
ML EnginePython/Flask
MongoDBAtlas Cluster
Blob StorageCloudinary
Email ServiceResend / SMTP
Auth ProviderJWT / OAuth

Main App Flow

Handles user interactions via Next.js and orchestrates business logic through the NestJS API Gateway.

Data Persistence

Secure storage layer using MongoDB Replica Sets for high-availability customer data and audit logs.

AI Inference Engine

Isolated Python environment that normalizes data and runs Scikit-learn models for real-time scoring.

Security & Edge Layer

Protection via Cloudflare WAF and Identity Management (OAuth/JWT) ensuring zero-trust access control.

Backend Services

A robust, modular, and type-safe backend architecture built with NestJS to ensure scalability and maintainability.

Modular Architecture

We leverage NestJS Modules to encapsulate business logic. Each domain (Users, Campaigns, Predictions) works in isolation, exposing only necessary services via exports.

Dependency InjectionSingleton ServicesDecorators
Strict Type-Safety

Input validation is handled globally using Zod pipes. This ensures that no malformed data ever reaches the controller layer.

Zod DTOsTypeScriptGlobal Pipes
campaigns.module.ts
@Module({
  imports: [PrismaModule, MlModule],
  controllers: [CampaignsController],
  providers: [CampaignsService],
  exports: [CampaignsService],
})
export class CampaignsModule {}

Frontend Application

A modern, high-performance web client built with Next.js 16 App Router. Designed for rich interactivity, accessibility, and seamless data synchronization.

Core Framework
Next.js 16App Router

A modern full-stack application built using the latest React ecosystem standards.

TypeScriptZod Schema
UI System
Tailwind + ShadcnUtility-First

Built on Radix UI primitives for uncompromised accessibility, styled with Tailwind CSS v4 for rapid development.

Data Synchronization
TanStack Queryv5

Manages server state with features like automatic refetching, caching, and optimistic updates for a snappy UX.

Interaction
  • Framer MotionComplex gestures & layout animations.
  • RechartsResponsive SVG-based data visualization.

ML Integration Logic

The intelligence layer. How SmartBank bridges the gap between raw customer data and actionable AI predictions.

1. Pre-Processing

Raw data from MongoDB is sanitized. Categorical strings (e.g., "blue-collar") are validated against known schemas before normalization.

NestJS Mapper
2. Inference

Data is sent to the Python microservice hosted on HuggingFace. The model (Random Forest/XGBoost) calculates probabilities.

Scikit-Learn
3. Persistence

The result (YES/NO) and confidence score are stored in the `Prediction` table, linked to the Customer ID for history tracking.

Prisma Write

API Contract

POST /api/predictJSON
{
  "personal_info": { 
    "age": 45, 
    "job": "admin", 
    "marital": "married",
    "education": "university.degree"
  },
  "financial_info": { 
    "default": false, 
    "housing": true, 
    "loan": false 
  },
  "macro_info": { 
    "euribor3m": 1.2, 
    "cpi": 93.2,
    "emp_var_rate": -1.8
  }
}

Live Specs

Syncing...
Algorithm
Training Accuracy
AUC Score
HostingHuggingFace
Avg Latency~150ms
Input Features21 Dimensions

Context Aware

The model doesn't just look at the user. It pulls real-time Euribor 3M and CPI rates to adjust predictions based on current economic conditions.

Deployment & DevOps

Production readiness guide. From environment configuration to CI/CD pipelines for both Frontend and Backend services.

Standard Deployment Pipeline

Git Push
main branch
Build & Lint
GitHub Actions / Vercel
Production
Live URL

Backend Service

Vercel
build_script.sh
1. Generate Client
npx prisma generate
2. Transpile NestJS
npm run build
3. Start Production
node dist/main.js

Frontend Application

Vercel / Edge

The Next.js app is optimized for Vercel. Ensure the following Environment Variables are configured in your Project Settings before deployment.

Required Variables
NEXT_PUBLIC_APP_URL
Base URL of the frontend (e.g., https://smartbank.ai)
Required
NEXT_PUBLIC_API_URL
Base URL of the backend API
Required
AUTH_SECRET
Random string for NextAuth encryption
Required
Build Command
npm run build