# aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system architecture

> Architecture diagram of the GitHub repository aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system
- Repository: https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system

## Overview

NIGRANI is a public-funds audit and risk-intelligence platform for MPLADS works. The documented workflow runs from batch ingestion and hybrid anomaly scoring to a Flask analytics API, then to role-scoped dashboards, case review, work investigation, vendor and cost analysis, and Excel reporting. The excerpts establish frontend routing, API requests, transformations, and export calls; README claims cover backend analytics and ingestion, but sampled backend source does not establish their internal call graph, so those links are documented or omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/App.tsx) (Application Shell), [`frontend/src/services/mpladsApi.ts`](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/services/mpladsApi.ts) (API Client), [`frontend/src/utils.ts`](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/utils.ts) (Audit Utilities), [`frontend/src/components/RiskCasesView.tsx`](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/RiskCasesView.tsx) (Risk Case Registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data Ingestion"]
  node_ingest["MPLADS Ingestion"]
  node_store[("SQLite Work Store")]
end

subgraph group_analysis["Risk Analytics"]
  node_analytics["Risk Engine"]
  node_analysis_batch["Batch Analysis"]
end

subgraph group_api["Analytics API"]
  node_dashboard_api["Dashboard API<br/>[dashboard.py]"]
end

subgraph group_frontend["Audit Interface"]
  node_app["Application Shell<br/>[App.tsx]"]
  node_api_client["API Client<br/>[mpladsApi.ts]"]
  node_overview["Governance Overview"]
  node_cases["Risk Case Registry<br/>[RiskCasesView.tsx]"]
  node_work_detail["Work Investigation<br/>[WorkDetailView.tsx]"]
  node_vendor["Vendor Risk<br/>[VendorRiskView.tsx]"]
  node_benchmark["Cost Benchmarks"]
  node_domain_types["Audit Data Types<br/>[types.ts]"]
  node_utilities["Audit Utilities<br/>[utils.ts]"]
  node_launch["Launch Screen<br/>[LaunchScreen.tsx]"]
end

subgraph group_reporting["Reporting"]
  node_report["Report Generation<br/>[generate_report.py]"]
  node_export["Excel Export<br/>[exportExcel.ts]"]
end

node_official(("Governance Users"))

node_official -->|"uses"| node_app
node_app -->|"requests data"| node_api_client
node_api_client -.->|"HTTP requests"| node_dashboard_api
node_ingest -.->|"loads records"| node_store
node_store -.->|"supplies works"| node_analytics
node_analytics -.->|"serves analytics"| node_dashboard_api
node_analysis_batch -.->|"analyzes works"| node_analytics
node_app -->|"shows before launch"| node_launch
node_app -->|"renders view"| node_overview
node_app -->|"renders view"| node_cases
node_app -.->|"renders view"| node_work_detail
node_app -->|"renders view"| node_vendor
node_app -->|"renders view"| node_benchmark
node_cases -->|"loads alerts"| node_api_client
node_work_detail -->|"loads alerts"| node_api_client
node_app -->|"exports overview"| node_export
node_dashboard_api -->|"uses report generator"| node_report
node_api_client -->|"transforms into"| node_domain_types
node_cases -->|"formats flags"| node_utilities
node_overview -->|"formats metrics"| node_utilities
node_benchmark -->|"formats costs"| node_utilities
node_export -->|"formats currency"| node_utilities

click node_ingest "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/tree/main/backend/pipelines"
click node_store "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/tree/main/backend/pipelines"
click node_analytics "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/backend/analytics_engine.py"
click node_analysis_batch "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/tree/main/backend/analysis"
click node_dashboard_api "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/backend/dashboard.py"
click node_report "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/backend/generate_report.py"
click node_app "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/services/mpladsApi.ts"
click node_overview "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/OverviewDashboard.tsx"
click node_cases "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/RiskCasesView.tsx"
click node_work_detail "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/WorkDetailView.tsx"
click node_vendor "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/VendorRiskView.tsx"
click node_benchmark "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/BenchmarkExplorer.tsx"
click node_export "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/utils/exportExcel.ts"
click node_domain_types "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/types.ts"
click node_utilities "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/utils.ts"
click node_launch "https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/LaunchScreen.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingest,node_store,node_official toneBlue
class node_analytics,node_analysis_batch toneAmber
class node_dashboard_api toneMint
class node_app,node_api_client,node_overview,node_cases,node_work_detail,node_vendor,node_benchmark,node_domain_types,node_utilities,node_launch toneRose
class node_report,node_export toneIndigo
```

## Components

### Data Ingestion

- [MPLADS Ingestion](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/tree/main/backend/pipelines): `backend/pipelines`
- [SQLite Work Store](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/tree/main/backend/pipelines): `backend/pipelines`

### Risk Analytics

- [Risk Engine](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/backend/analytics_engine.py): `backend/analytics_engine.py`
- [Batch Analysis](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/tree/main/backend/analysis): `backend/analysis`

### Analytics API

- [Dashboard API](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/backend/dashboard.py): `backend/dashboard.py`

### Audit Interface

- [Application Shell](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API Client](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/services/mpladsApi.ts): `frontend/src/services/mpladsApi.ts`
- [Governance Overview](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/OverviewDashboard.tsx): `frontend/src/components/OverviewDashboard.tsx`
- [Risk Case Registry](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/RiskCasesView.tsx): `frontend/src/components/RiskCasesView.tsx`
- [Work Investigation](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/WorkDetailView.tsx): `frontend/src/components/WorkDetailView.tsx`
- [Vendor Risk](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/VendorRiskView.tsx): `frontend/src/components/VendorRiskView.tsx`
- [Cost Benchmarks](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/BenchmarkExplorer.tsx): `frontend/src/components/BenchmarkExplorer.tsx`
- [Audit Data Types](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/types.ts): `frontend/src/types.ts`
- [Audit Utilities](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/utils.ts): `frontend/src/utils.ts`
- [Launch Screen](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/components/LaunchScreen.tsx): `frontend/src/components/LaunchScreen.tsx`

### Reporting

- [Report Generation](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/backend/generate_report.py): `backend/generate_report.py`
- [Excel Export](https://github.com/aryanguptacs0-png/nigrani-mplads-fraud-detection-ai-system/blob/main/frontend/src/utils/exportExcel.ts): `frontend/src/utils/exportExcel.ts`

### Other components

- **Governance Users**

## Connections

- Governance Users → Application Shell: uses (evidence: `frontend/src/App.tsx`)
- Application Shell → API Client: requests data (evidence: `frontend/src/App.tsx`)
- API Client → Dashboard API: HTTP requests (evidence: `frontend/src/services/mpladsApi.ts`)
- MPLADS Ingestion → SQLite Work Store: loads records
- SQLite Work Store → Risk Engine: supplies works
- Risk Engine → Dashboard API: serves analytics
- Batch Analysis → Risk Engine: analyzes works
- Application Shell → Launch Screen: shows before launch (evidence: `frontend/src/App.tsx`)
- Application Shell → Governance Overview: renders view (evidence: `frontend/src/App.tsx`)
- Application Shell → Risk Case Registry: renders view (evidence: `frontend/src/App.tsx`)
- Application Shell → Work Investigation: renders view (evidence: `frontend/src/App.tsx`)
- Application Shell → Vendor Risk: renders view (evidence: `frontend/src/App.tsx`)
- Application Shell → Cost Benchmarks: renders view (evidence: `frontend/src/App.tsx`)
- Risk Case Registry → API Client: loads alerts (evidence: `frontend/src/components/RiskCasesView.tsx`)
- Work Investigation → API Client: loads alerts (evidence: `frontend/src/components/WorkDetailView.tsx`)
- Application Shell → Excel Export: exports overview (evidence: `frontend/src/App.tsx`)
- Dashboard API → Report Generation: uses report generator (evidence: `backend/dashboard.py`)
- API Client → Audit Data Types: transforms into (evidence: `frontend/src/services/mpladsApi.ts`)
- Risk Case Registry → Audit Utilities: formats flags (evidence: `frontend/src/components/RiskCasesView.tsx`)
- Governance Overview → Audit Utilities: formats metrics (evidence: `frontend/src/components/OverviewDashboard.tsx`)
- Cost Benchmarks → Audit Utilities: formats costs (evidence: `frontend/src/components/BenchmarkExplorer.tsx`)
- Excel Export → Audit Utilities: formats currency (evidence: `frontend/src/utils/exportExcel.ts`)
