Skip to content

Aryan27-max/SAR-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏦 SAR Narrative Generator with Full Audit Trail

Enterprise AML Compliance Platform for Barclays Hackathon.

Status Barclays License

An AI-powered compliance tool that helps analysts generate Suspicious Activity Reports (SARs) with complete transparency, audit trails, and regulatory compliance.


πŸ›  Technology Stack

🎯 Full-Stack Application

Frontend Stack
Next.js β€’ TypeScript β€’ Tailwind CSS
Analyst UI, approvals, audit views, API routes

βš™οΈ Orchestration & Workflow

Orchestration
n8n (Workflow Automation)
Ingestion, feature engineering, rules, scoring, AI calls, audit logging

πŸ€– AI & Vector Store

Llama LangChain ChromaDB

LLM (Llama/Mistral/GPT) β€’ LangChain β€’ ChromaDB
Controlled narrative generation from templates & guidelines (RAG architecture)

πŸ—„οΈ Database & ORM

Database
PostgreSQL β€’ Prisma ORM
Case data, SAR versions, immutable audit logs

πŸ” Access Control

RBAC
RBAC (Role-Based Access Control)
Analyst β€’ Supervisor β€’ Auditor roles inside Next.js

πŸš€ DevOps & Deployment

DevOps
Docker β€’ Docker Compose β€’ Git β€’ GitHub β€’ npm
Local development + cloud/on-prem ready containerization

πŸ“Š Data Visualization & UI Libraries

UI Libraries
Recharts β€’ Material UI β€’ Lucide Icons β€’ Motion
Interactive charts, enterprise components, smooth animations

πŸ“‹ Table of Contents


🎯 Overview

The SAR Narrative Generator is an enterprise-grade Anti-Money Laundering (AML) compliance platform designed as an internal banking tool. It revolutionizes the SAR creation process by combining:

  • πŸ€– AI-Powered Narrative Generation - Leveraging LLMs to create compliant, professional SAR narratives
  • πŸ“Š Structured Data Management - Handling customer, account, and transaction data with precision
  • πŸ” Complete Audit Trail - Every action tracked and logged for regulatory compliance
  • πŸ‘₯ Role-Based Access Control - Three-tier permission system for Analysts, Supervisors, and Auditors
  • πŸ“ˆ Risk Analytics Dashboard - Real-time insights into suspicious activity patterns

This platform addresses the critical need for transparency and auditability in AI-assisted compliance workflows, ensuring human oversight remains central to the decision-making process.


✨ Key Features

🎨 Seven Comprehensive Screens

Screen Description Access Level
Login Secure authentication with role selection All Users
Dashboard Overview of active cases, pending reviews, and metrics All Users
Generate SAR AI-assisted SAR narrative creation with rule engine Analyst, Supervisor
Audit Trail Complete history of all actions and decisions All Users
Case History Track status and progression of all SAR cases All Users
Risk Analytics Visual analytics and pattern detection Supervisor, Auditor
Role Management User permissions and access control Supervisor
System Logs Technical system audit logs Auditor

πŸ›‘οΈ Advanced Capabilities

  • βœ… Rule Engine Integration - Automated red flags and risk scoring
  • βœ… Real-time Collaboration - Multiple analysts can work on cases simultaneously
  • βœ… Version Control - Track all narrative edits with timestamps
  • βœ… Approval Workflows - Multi-stage review and escalation process
  • βœ… Export Compliance - Generate regulatory-compliant PDF reports
  • βœ… Dark Mode Enterprise UI - Professional banking aesthetics
  • βœ… Responsive Design - Works seamlessly on desktop and tablet devices

Core Dependencies

{
  "react": "^18.3.1",
  "react-router": "^7.13.0",
  "recharts": "^2.15.2",
  "tailwindcss": "^4.1.12",
  "@mui/material": "^7.3.5",
  "lucide-react": "^0.487.0",
  "motion": "^12.23.24",
  "sonner": "^2.0.3"
}

πŸ“Έ Screenshots

Dashboard Overview

Screenshot 2026-02-18 202242

Generate SAR Interface

Screenshot 2026-02-18 202909

Risk Analytics

Screenshot 2026-02-18 203014

πŸ‘₯ User Roles

The platform implements a three-tier role-based access control system:

πŸ”΅ Analyst

  • Create and edit SAR narratives
  • Submit cases for supervisor review
  • Access basic analytics and case history
  • View audit trails for own cases

🟑 Supervisor

  • All analyst permissions
  • Approve or reject SAR submissions
  • Escalate high-risk cases
  • Manage team member roles
  • Access advanced risk analytics
  • Override AI suggestions with justification

🟒 Auditor

  • Read-only access to all data
  • Full audit trail visibility
  • System logs access
  • Export compliance reports
  • No editing or approval capabilities

πŸš€ Getting Started

Prerequisites

  • Node.js 18.x or higher
  • npm or pnpm package manager
  • Modern web browser (Chrome, Firefox, Safari, Edge)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/sar-narrative-generator.git
    cd sar-narrative-generator
  2. Install dependencies

    npm install
    # or
    pnpm install
  3. Start development server

    npm run dev
  4. Open in browser

    Navigate to http://localhost:5173
    

πŸ”‘ Demo Credentials

Analyst Login:
- Username: analyst@barclays.com
- Password: (any)

Supervisor Login:
- Username: supervisor@barclays.com
- Password: (any)

Auditor Login:
- Username: auditor@barclays.com
- Password: (any)

πŸ—οΈ Build for Production

npm run build

The production-ready files will be generated in the dist/ directory.


πŸ“ Project Structure

sar-narrative-generator/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ MetricCard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RiskBadge.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ StatusBadge.tsx
β”‚   β”‚   β”‚   └── ui/              # Shadcn UI components
β”‚   β”‚   β”œβ”€β”€ context/             # React Context providers
β”‚   β”‚   β”‚   └── RoleContext.tsx  # Role-based access control
β”‚   β”‚   β”œβ”€β”€ pages/               # Screen components
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ GenerateSAR.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AuditTrail.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ CaseHistory.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RiskAnalytics.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RoleManagement.tsx
β”‚   β”‚   β”‚   └── SystemLogs.tsx
β”‚   β”‚   β”œβ”€β”€ routes.ts            # React Router configuration
β”‚   β”‚   └── App.tsx              # Application root
β”‚   └── styles/
β”‚       β”œβ”€β”€ index.css
β”‚       β”œβ”€β”€ theme.css            # Design tokens
β”‚       β”œβ”€β”€ tailwind.css
β”‚       └── fonts.css
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
└── README.md

🎨 Design System

Color Palette

The platform uses a professional enterprise banking theme with risk-based color coding:

/* Primary Background */
--background: #0F172A;        /* Dark Navy */

/* Card Surfaces */
--card-background: #1E293B;   /* Slate */

/* Risk Levels */
--risk-high: #EF4444;         /* Red - Critical Risk */
--risk-medium: #F59E0B;       /* Amber - Medium Risk */
--risk-low: #10B981;          /* Green - Low Risk */

/* Accents */
--primary: #3B82F6;           /* Blue - Primary Actions */
--text-primary: #F1F5F9;      /* Light Gray - Primary Text */
--text-secondary: #94A3B8;    /* Muted Gray - Secondary Text */

Typography

  • Font Family: Inter (Google Fonts)
  • Headings: 600-700 weight
  • Body: 400-500 weight
  • Code/Data: Monospace fallback

Design Principles

βœ… Regulatory Compliance - No gradients, playful elements, or distracting animations
βœ… High Contrast - WCAG AA accessibility standards
βœ… Data Density - Information-rich layouts for professional users
βœ… Consistent Spacing - 8px grid system
βœ… Clear Hierarchy - Visual weight reflects importance


πŸ”’ Security & Compliance

Audit Trail Features

  • Immutable Logs - All actions permanently recorded
  • Timestamp Precision - Millisecond-accurate tracking
  • User Attribution - Every change linked to specific user
  • Change History - Before/after comparisons for all edits

Data Handling

  • Mock Data Only - Prototype uses synthetic data
  • No Real PII - Compliant with data protection regulations
  • Session Management - Role-based context persistence
  • Input Validation - All forms validated client-side

Production Considerations

  • Implement backend API with proper authentication (OAuth 2.0 / SAML)
  • Use encrypted database for sensitive data
  • Add rate limiting and DDoS protection
  • Implement HTTPS and certificate pinning
  • Add comprehensive logging and monitoring
  • Conduct security penetration testing
  • Ensure GDPR/regulatory compliance

🚧 Future Enhancements

Planned Features

  • LLM Integration - Connect to GPT-4 or Claude for real narrative generation
  • Backend API - Node.js/Python backend with PostgreSQL
  • Real-time Collaboration - WebSocket support for multi-user editing
  • Advanced Analytics - ML-based pattern detection
  • PDF Export - Regulatory-compliant report generation
  • Email Notifications - Alert supervisors of pending approvals
  • Search & Filter - Advanced case search capabilities
  • Mobile App - React Native companion app
  • Multi-language - i18n support for global teams
  • Dark/Light Mode - User preference toggle

Technical Improvements

  • Unit and integration testing (Jest, React Testing Library)
  • E2E testing (Playwright)
  • CI/CD pipeline (GitHub Actions)
  • Docker containerization
  • Performance optimization (code splitting, lazy loading)
  • Accessibility audit and improvements

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors