How karthikeyan-s-developer/fraud-risk-engine works
Acentra Aegis detects location-aware financial fraud and gives investigators an explainable review cockpit. Its main workflow accepts transaction events through the API, evaluates deterministic rules using transaction history and entity relationships, adds an auxiliary ML signal, persists flags and alerts on high risk, then supports dashboard monitoring and human review. The README also describes mobility analysis, audit history, live simulation, and geospatial/entity-graph investigations. Some backend wiring is only partially excerpted; edges rely on shown references or explicit README statements, and unsampled details are not inferred.
Main entry points: main.py Transaction API · FlagDetail.jsx Flag Investigation · App.jsx Cockpit App · config.js API Configuration
Components 27
Ingestion and API
- Transaction API
backend/main.py - API Schemas
backend/schemas.py - Transaction Simulator
backend/simulator/simulator.py
Fraud Detection
- Rule Engine
backend/engine/engine.py - Deterministic Rules
backend/rules - Rule Contract
backend/engine/base.py - Entity Graph
backend/engine/graph.py - Mobility Analysis
backend/engine/mobility.py - ML Risk Signal
backend/ml/pipeline.py - SHAP Explainer
backend/ml/explainer.py
Persistence and Alerts
- Fraud Data Models
backend/models.py - Database Access
backend/db.py - Neon PostgreSQL
- Alert Notifier
backend/services/notifier.py - AWS SNS / SES
Reviewer Cockpit
- Cockpit App
frontend/src/App.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Flag Queue
frontend/src/pages/FlagList.jsx - Flag Investigation
frontend/src/pages/FlagDetail.jsx - Audit Log
frontend/src/pages/AuditLog.jsx - Review Actions
frontend/src/components/ActionPanel.jsx - Geo Investigation Map
frontend/src/components/GeoInvestigationMap.jsx - Entity Graph View
frontend/src/components/EntityGraphView.jsx - Rule Breakdown
frontend/src/components/RuleBreakdownCard.jsx - API Configuration
frontend/src/config.js
Other components
- Financial Event
- Investigator
Connections 30
- Financial Event → Transaction API: submits
README.md - Transaction Simulator → Transaction API: submits events
backend/main.py - Transaction API → API Schemas: validates with
backend/main.py - Transaction API → Rule Engine: evaluates with
backend/main.py - Rule Engine → Deterministic Rules: discovers and runs
backend/engine/engine.py - Deterministic Rules → Rule Contract: implement contract
backend/rules/amount.py - Transaction API → Entity Graph: uses graph
backend/main.py - Transaction API → Mobility Analysis: uses mobility
backend/main.py - Transaction API → ML Risk Signal: scores transaction
backend/main.py - SHAP Explainer → ML Risk Signal: explains signals
backend/ml/explainer.py - Transaction API → Fraud Data Models: reads and writes
backend/main.py - Fraud Data Models → Database Access: uses database
backend/models.py - Database Access → Neon PostgreSQL: connects to
README.md - Transaction API → Alert Notifier: dispatches alerts
README.md - Alert Notifier → AWS SNS / SES: publishes alerts
backend/services/notifier.py - Investigator → Cockpit App: uses cockpit
README.md - Cockpit App → Dashboard: renders
frontend/src/App.jsx - Cockpit App → Flag Queue: renders
frontend/src/App.jsx - Cockpit App → Flag Investigation: renders
frontend/src/App.jsx - Cockpit App → Audit Log: renders
frontend/src/App.jsx - Dashboard → API Configuration: configures requests
frontend/src/pages/Dashboard.jsx - Flag Queue → API Configuration: configures requests
frontend/src/pages/FlagList.jsx - Flag Investigation → API Configuration: configures requests
frontend/src/pages/FlagDetail.jsx - Audit Log → API Configuration: configures requests
frontend/src/pages/AuditLog.jsx - Dashboard → Transaction API: opens live stream
frontend/src/pages/Dashboard.jsx - Flag Investigation → Review Actions: renders
frontend/src/pages/FlagDetail.jsx - Flag Investigation → Geo Investigation Map: renders
frontend/src/pages/FlagDetail.jsx - Flag Investigation → Entity Graph View: renders
frontend/src/pages/FlagDetail.jsx - Flag Investigation → Rule Breakdown: renders
frontend/src/pages/FlagDetail.jsx - Review Actions → API Configuration: configures requests
frontend/src/components/ActionPanel.jsx