How vardhanreddy024/risklensai works
RiskLens AI turns payment events into explainable risk decisions, then supports merchant review through investigation, reporting, and audit history. The documented primary flow is Razorpay webhook verification and normalization, transaction persistence, fraud scoring and decisioning, followed by AI investigation and dashboard visibility. The graph also includes the broader transaction and investigation APIs, tenant-aware storage, and graph-based investigation capability. Some subsystems are represented by their exact enclosing directories because their implementation files were not sampled; those relationships are omitted where the excerpts and README do not establish them.
Main entry points: index.ts Data Store · App.tsx Application Router · razorpay.service.ts Webhook Processing · server.ts Server Runtime
Components 26
Payment Ingestion
- Server Runtime
server.ts - Webhook Routes
server/routes/webhook.routes.ts - Webhook Controller
server/controllers/webhook.controller.ts - Webhook Processing
server/services/razorpay.service.ts - Transaction API
server/services/transaction.service.ts
Risk Intelligence
- Fraud Scoring
src/lib/ml_engine.ts - Risk Decisioning
server/services/razorpay.service.ts
Investigation
- Investigation Service
server/services/investigation.service.ts - Agent Orchestrator
server/agents/orchestrator.ts - Investigation Agents
server/agents - Similar Case Retrieval
server/agents/case_retriever.ts - Fraud Graph Analysis
src/lib/graph_engine.ts
Persistence And Audit
- Data Store
server/db/index.ts - Storage Adapters
server/db/adapters - Data Repositories
server/db/repositories - Audit And Store Contracts
server/db/interfaces/IDataStoreAdapter.ts - Logging And Metrics
server/middleware.ts
Merchant Workspace
- Merchant Dashboard
src/components/pages/DashboardPage.tsx - Investigation Workspace
src/components/pages/InvestigationPage.tsx - Payment Monitoring
src/components/pages/RazorpayMonitorPage.tsx - Transaction And Investigation State
src/context/TransactionContext.tsx - API Client
src/lib/api.ts - Merchant Authentication
src/context/AuthContext.tsx - Application Router
src/App.tsx
Other components
- Razorpay Test Mode
- Merchant User
Connections 31
- Razorpay Test Mode → Webhook Routes: sends events
- Server Runtime → Webhook Routes: mounts routes
server.ts - Webhook Routes → Webhook Controller: routes requests
server/routes/webhook.routes.ts - Webhook Controller → Webhook Processing: handles events
server/controllers/webhook.controller.ts - Webhook Processing → Data Store: claims and stores events
server/services/razorpay.service.ts - Webhook Processing → Fraud Scoring: scores transactions
server/services/razorpay.service.ts - Webhook Processing → Investigation Service: starts investigation
server/services/razorpay.service.ts - Webhook Processing → Logging And Metrics: records metrics
server/services/razorpay.service.ts - Server Runtime → Data Store: initializes
server.ts - Server Runtime → Logging And Metrics: configures middleware
server.ts - Data Store → Storage Adapters: selects adapter
server/db/index.ts - Data Store → Data Repositories: creates repositories
server/db/index.ts - Data Repositories → Audit And Store Contracts: implement contracts
server/db/repositories/AuditLogRepository.ts - Transaction API → Data Store: reads and writes transactions
server/services/transaction.service.ts - Transaction API → Fraud Scoring: scores transactions
server/services/transaction.service.ts - Investigation Service → Agent Orchestrator: orchestrates analysis
server/services/investigation.service.ts - Investigation Service → Data Store: persists dossiers
server/services/investigation.service.ts - Agent Orchestrator → Investigation Agents: dispatches agents
server/agents/orchestrator.ts - Investigation Agents → Similar Case Retrieval: retrieves cases
server/agents/orchestrator.ts - Similar Case Retrieval → Fraud Graph Analysis: uses graph analysis
- Merchant User → Application Router: uses workspace
- Application Router → Merchant Authentication: provides authentication
src/App.tsx - Application Router → Transaction And Investigation State: provides application state
src/App.tsx - Application Router → Merchant Dashboard: routes to
src/App.tsx - Application Router → Investigation Workspace: routes to
src/App.tsx - Application Router → Payment Monitoring: routes to
src/App.tsx - Transaction And Investigation State → API Client: calls API
src/context/TransactionContext.tsx - Transaction And Investigation State → Fraud Scoring: evaluates transactions
src/context/TransactionContext.tsx - Investigation Workspace → Fraud Graph Analysis: displays graph insights
- Payment Monitoring → API Client: loads payment data
- API Client → Data Store: requests backend data