Enterprise AML Compliance Platform for Barclays Hackathon.
An AI-powered compliance tool that helps analysts generate Suspicious Activity Reports (SARs) with complete transparency, audit trails, and regulatory compliance.
Next.js β’ TypeScript β’ Tailwind CSS
Analyst UI, approvals, audit views, API routes
n8n (Workflow Automation)
Ingestion, feature engineering, rules, scoring, AI calls, audit logging
LLM (Llama/Mistral/GPT) β’ LangChain β’ ChromaDB
Controlled narrative generation from templates & guidelines (RAG architecture)
PostgreSQL β’ Prisma ORM
Case data, SAR versions, immutable audit logs
RBAC (Role-Based Access Control)
Analyst β’ Supervisor β’ Auditor roles inside Next.js
Docker β’ Docker Compose β’ Git β’ GitHub β’ npm
Local development + cloud/on-prem ready containerization
Recharts β’ Material UI β’ Lucide Icons β’ Motion
Interactive charts, enterprise components, smooth animations
- Overview
- Key Features
- Technology Stack
- Screenshots
- User Roles
- Getting Started
- Project Structure
- Design System
- Security & Compliance
- Future Enhancements
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.
| 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 |
- β 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
{
"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"
}The platform implements a three-tier role-based access control system:
- Create and edit SAR narratives
- Submit cases for supervisor review
- Access basic analytics and case history
- View audit trails for own cases
- 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
- Read-only access to all data
- Full audit trail visibility
- System logs access
- Export compliance reports
- No editing or approval capabilities
- Node.js 18.x or higher
- npm or pnpm package manager
- Modern web browser (Chrome, Firefox, Safari, Edge)
-
Clone the repository
git clone https://github.com/yourusername/sar-narrative-generator.git cd sar-narrative-generator -
Install dependencies
npm install # or pnpm install -
Start development server
npm run dev
-
Open in browser
Navigate to http://localhost:5173
Analyst Login:
- Username: analyst@barclays.com
- Password: (any)
Supervisor Login:
- Username: supervisor@barclays.com
- Password: (any)
Auditor Login:
- Username: auditor@barclays.com
- Password: (any)
npm run buildThe production-ready files will be generated in the dist/ directory.
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
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 */- Font Family: Inter (Google Fonts)
- Headings: 600-700 weight
- Body: 400-500 weight
- Code/Data: Monospace fallback
β
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
- 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
- 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
- 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
- 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
- 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


