# abhayj04/mplads-sentinel-ai architecture

> Architecture diagram of the GitHub repository abhayj04/mplads-sentinel-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhayj04/mplads-sentinel-ai
- Repository: https://github.com/abhayj04/mplads-sentinel-ai

## Overview

MPLADS Sentinel AI is an AI-assisted audit and decision-support platform: project records are screened for risk signals, consolidated into explainable scores, prioritized for human investigation, and acted on through evidence review and audit logging. The README also documents dashboards, agency profiling, GIS risk views, data-quality checks, and a copilot. Sampled source confirms startup seeding, scoring, authentication, dashboard queries, and investigation actions; several documented feature routers are present in the tree but their internal wiring was not sampled.

Main entry points: [`backend/app/main.py`](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/seed/generator.py`](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/seed/generator.py) (Dataset screening), [`backend/app/database.py`](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/database.py) (Application database), [`backend/app/api/investigations.py`](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/investigations.py) (Investigation queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and API"]
  node_web["Web interface"]
  node_app["FastAPI application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_projects["Project records<br/>[projects.py]"]
  node_admin["Administration<br/>[admin.py]"]
end

subgraph group_detection["Risk Intelligence"]
  node_agencies["Agency profiles<br/>[agencies.py]"]
  node_quality["Data quality<br/>[data_quality.py]"]
  node_seed["Dataset screening<br/>[generator.py]"]
  node_scenarios["Demo scenarios<br/>[scenarios.py]"]
  node_cost["Cost anomaly detection<br/>[cost_anomaly.py]"]
  node_payment["Payment mismatch detection<br/>[payment_anomaly.py]"]
  node_delay["Timeline delay detection<br/>[delay_detector.py]"]
  node_duplicates["Duplicate detection"]
  node_profiler["Agency risk profiling<br/>[agency_profiler.py]"]
  node_risk["Composite risk and explanations<br/>[risk_engine.py]"]
end

subgraph group_oversight["Review and Oversight"]
  node_dashboard["Dashboard analytics<br/>[dashboard.py]"]
  node_alerts["Risk alerts<br/>[alerts.py]"]
  node_investigations["Investigation queue<br/>[investigations.py]"]
  node_evidence["Evidence locker<br/>[evidence.py]"]
  node_gis["GIS risk views<br/>[gis.py]"]
  node_copilot["Decision copilot<br/>[copilot.py]"]
  node_audit["Audit trail<br/>[audit.py]"]
end

subgraph group_state["Platform State"]
  node_database[("Application database<br/>[database.py]")]
  node_models["Domain records<br/>[models.py]"]
end

node_officers(("Scheme officers"))

node_officers -->|"use"| node_web
node_web -->|"API requests"| node_app
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_projects
node_app -->|"registers"| node_dashboard
node_app -->|"registers"| node_alerts
node_app -->|"registers"| node_investigations
node_app -->|"registers"| node_evidence
node_app -->|"registers"| node_gis
node_app -->|"registers"| node_agencies
node_app -->|"registers"| node_quality
node_app -->|"registers"| node_copilot
node_app -->|"registers"| node_admin
node_app -->|"seeds on startup"| node_seed
node_seed -->|"builds examples"| node_scenarios
node_seed -->|"detects costs"| node_cost
node_seed -->|"detects mismatches"| node_payment
node_seed -->|"detects delays"| node_delay
node_seed -->|"finds duplicates"| node_duplicates
node_seed -->|"calculates scores"| node_risk
node_seed -->|"profiles agencies"| node_profiler
node_investigations -->|"logs actions"| node_audit
node_auth -->|"reads users"| node_database
node_investigations -->|"reads and writes"| node_database
node_dashboard -->|"queries metrics"| node_database
node_seed -->|"writes seeded records"| node_database
node_database -->|"maps records"| node_models

click node_web "https://github.com/abhayj04/mplads-sentinel-ai/tree/main/frontend"
click node_app "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/main.py"
click node_auth "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/auth.py"
click node_projects "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/projects.py"
click node_dashboard "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/dashboard.py"
click node_alerts "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/alerts.py"
click node_investigations "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/investigations.py"
click node_evidence "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/evidence.py"
click node_gis "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/gis.py"
click node_agencies "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/agencies.py"
click node_quality "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/data_quality.py"
click node_copilot "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/copilot.py"
click node_admin "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/admin.py"
click node_seed "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/seed/generator.py"
click node_scenarios "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/seed/scenarios.py"
click node_cost "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/cost_anomaly.py"
click node_payment "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/payment_anomaly.py"
click node_delay "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/delay_detector.py"
click node_duplicates "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/duplicate_detector.py"
click node_profiler "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/agency_profiler.py"
click node_risk "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/risk_engine.py"
click node_audit "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/core/audit.py"
click node_database "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/database.py"
click node_models "https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/models.py"

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_web,node_app,node_auth,node_projects,node_admin toneBlue
class node_agencies,node_quality,node_seed,node_scenarios,node_cost,node_payment,node_delay,node_duplicates,node_profiler,node_risk toneAmber
class node_dashboard,node_alerts,node_investigations,node_evidence,node_gis,node_copilot,node_audit toneMint
class node_database,node_models toneRose
class node_officers toneIndigo
```

## Components

### Access and API

- [Web interface](https://github.com/abhayj04/mplads-sentinel-ai/tree/main/frontend): `frontend`
- [FastAPI application](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Project records](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/projects.py): `backend/app/api/projects.py`
- [Administration](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/admin.py): `backend/app/api/admin.py`

### Risk Intelligence

- [Agency profiles](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/agencies.py): `backend/app/api/agencies.py`
- [Data quality](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/data_quality.py): `backend/app/api/data_quality.py`
- [Dataset screening](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/seed/generator.py): `backend/app/seed/generator.py`
- [Demo scenarios](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/seed/scenarios.py): `backend/app/seed/scenarios.py`
- [Cost anomaly detection](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/cost_anomaly.py): `backend/app/ml/cost_anomaly.py`
- [Payment mismatch detection](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/payment_anomaly.py): `backend/app/ml/payment_anomaly.py`
- [Timeline delay detection](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/delay_detector.py): `backend/app/ml/delay_detector.py`
- [Duplicate detection](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/duplicate_detector.py): `backend/app/ml/duplicate_detector.py`
- [Agency risk profiling](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/agency_profiler.py): `backend/app/ml/agency_profiler.py`
- [Composite risk and explanations](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/ml/risk_engine.py): `backend/app/ml/risk_engine.py`

### Review and Oversight

- [Dashboard analytics](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/dashboard.py): `backend/app/api/dashboard.py`
- [Risk alerts](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/alerts.py): `backend/app/api/alerts.py`
- [Investigation queue](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/investigations.py): `backend/app/api/investigations.py`
- [Evidence locker](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/evidence.py): `backend/app/api/evidence.py`
- [GIS risk views](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/gis.py): `backend/app/api/gis.py`
- [Decision copilot](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/api/copilot.py): `backend/app/api/copilot.py`
- [Audit trail](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/core/audit.py): `backend/app/core/audit.py`

### Platform State

- [Application database](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/database.py): `backend/app/database.py`
- [Domain records](https://github.com/abhayj04/mplads-sentinel-ai/blob/main/backend/app/models.py): `backend/app/models.py`

### Other components

- **Scheme officers**

## Connections

- Scheme officers → Web interface: use
- Web interface → FastAPI application: API requests
- FastAPI application → Authentication: registers
- FastAPI application → Project records: registers
- FastAPI application → Dashboard analytics: registers
- FastAPI application → Risk alerts: registers
- FastAPI application → Investigation queue: registers
- FastAPI application → Evidence locker: registers
- FastAPI application → GIS risk views: registers
- FastAPI application → Agency profiles: registers
- FastAPI application → Data quality: registers
- FastAPI application → Decision copilot: registers
- FastAPI application → Administration: registers
- FastAPI application → Dataset screening: seeds on startup
- Dataset screening → Demo scenarios: builds examples
- Dataset screening → Cost anomaly detection: detects costs
- Dataset screening → Payment mismatch detection: detects mismatches
- Dataset screening → Timeline delay detection: detects delays
- Dataset screening → Duplicate detection: finds duplicates
- Dataset screening → Composite risk and explanations: calculates scores
- Dataset screening → Agency risk profiling: profiles agencies
- Investigation queue → Audit trail: logs actions
- Authentication → Application database: reads users
- Investigation queue → Application database: reads and writes
- Dashboard analytics → Application database: queries metrics
- Dataset screening → Application database: writes seeded records
- Application database → Domain records: maps records
