# prathameshdeshpande99/pathway-interiit-14 architecture

> Architecture diagram of the GitHub repository prathameshdeshpande99/pathway-interiit-14, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prathameshdeshpande99/pathway-interiit-14
- Repository: https://github.com/prathameshdeshpande99/pathway-interiit-14

## Overview

Vigil360 is a KYC and continuous-risk screening product: KYC and transaction data are screened against sanctions, adverse media, and transaction patterns; resulting risk scores and alerts are surfaced to compliance teams. The repository separates a Pathway-oriented screening pipeline, a FastAPI operational and monitoring API, and a Next.js dashboard. The README documents streaming with Kafka and Pathway, while sampled code confirms selected API, authentication, and rule-evaluation responsibilities. Several pipeline integrations and frontend-to-backend calls are documented but not directly shown in the sampled source, so those links cite the README.

Main entry points: [`pipeline/main.py`](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/main.py) (Pipeline orchestration), [`backend/app/main.py`](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/main.py) (API application), [`backend/app/db.py`](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/db.py) (Database access), [`backend/app/routes/user_routes.py`](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/user_routes.py) (User and KYC API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pipeline["Screening pipeline"]
  node_pipeline_entry["Pipeline orchestration<br/>[main.py]"]
  node_kyc_processing["KYC processing<br/>[process_kyc.py]"]
  node_risk_enrichment["Sanctions and media"]
  node_rps_rules["Transaction rules<br/>[rule_engine.py]"]
  node_rps_engine["Risk scoring<br/>[rps_engine.py]"]
  node_stream_watchers["Continuous screening"]
  node_pipeline_persistence["Pipeline database updates<br/>[database_update.py]"]
  node_mcp_access["MCP access"]
end

subgraph group_backend["Backend API"]
  node_api_app["API application<br/>[main.py]"]
  node_user_kyc_api["User and KYC API<br/>[user_routes.py]"]
  node_transaction_api["Transaction API"]
  node_compliance_api["Compliance alerts"]
  node_auth["Authentication and roles"]
  node_dashboard_api["Dashboard analytics"]
  node_superadmin_api["System monitoring"]
end

subgraph group_data["Operational data"]
  node_db_session["Database access<br/>[db.py]"]
  node_domain_models[("Operational records")]
end

subgraph group_frontend["Compliance dashboard"]
  node_frontend_api["Frontend API client<br/>[api.ts]"]
  node_dashboard_ui["Risk dashboard<br/>[page.tsx]"]
  node_compliance_ui["Compliance workspace<br/>[page.tsx]"]
  node_superadmin_ui["Superadmin views"]
end

node_compliance_team(("Compliance team"))
node_kyc_source["KYC data"]
node_transaction_source["Transaction data"]
node_external_risk_data{{"Risk data sources"}}

node_kyc_source -->|"ingests"| node_pipeline_entry
node_transaction_source -->|"screens"| node_pipeline_entry
node_pipeline_entry -.->|"processes KYC"| node_kyc_processing
node_pipeline_entry -->|"enriches matches"| node_risk_enrichment
node_external_risk_data -->|"provides signals"| node_risk_enrichment
node_pipeline_entry -.->|"calculates risk"| node_rps_engine
node_rps_engine -->|"evaluates rules"| node_rps_rules
node_pipeline_entry -->|"streams updates"| node_stream_watchers
node_stream_watchers -.->|"updates records"| node_pipeline_persistence
node_mcp_access -->|"aggregates results"| node_pipeline_entry
node_kyc_source -.->|"submits KYC"| node_user_kyc_api
node_transaction_source -.->|"submits activity"| node_transaction_api
node_api_app -->|"initializes tables"| node_db_session
node_api_app -->|"registers routes"| node_user_kyc_api
node_api_app -->|"registers routes"| node_transaction_api
node_api_app -->|"registers routes"| node_compliance_api
node_api_app -->|"registers routes"| node_superadmin_api
node_user_kyc_api -->|"checks roles"| node_auth
node_compliance_api -->|"checks roles"| node_auth
node_superadmin_api -->|"checks superadmin"| node_auth
node_auth -->|"loads admins"| node_db_session
node_user_kyc_api -->|"uses sessions"| node_db_session
node_compliance_api -->|"queries alerts"| node_db_session
node_superadmin_api -->|"queries monitoring"| node_db_session
node_db_session -->|"persists records"| node_domain_models
node_pipeline_persistence -.->|"writes risk data"| node_domain_models
node_pipeline_entry -.->|"supplies screening results"| node_compliance_api
node_compliance_team -->|"reviews flags"| node_dashboard_ui
node_dashboard_ui -.->|"requests dashboard data"| node_frontend_api
node_compliance_ui -.->|"requests alerts"| node_frontend_api
node_superadmin_ui -.->|"requests monitoring"| node_frontend_api
node_frontend_api -.->|"calls API"| node_api_app
node_dashboard_api -->|"reads analytics data"| node_db_session
node_api_app -->|"serves dashboard"| node_dashboard_api

click node_pipeline_entry "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/main.py"
click node_kyc_processing "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/OCR/process_kyc.py"
click node_risk_enrichment "https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/pipeline/utils"
click node_rps_rules "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/rps/src/rules/rule_engine.py"
click node_rps_engine "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/rps/src/service/rps_engine.py"
click node_stream_watchers "https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/pipeline/watcher"
click node_pipeline_persistence "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/database_update.py"
click node_mcp_access "https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/pipeline/mcp"
click node_api_app "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/main.py"
click node_user_kyc_api "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/user_routes.py"
click node_transaction_api "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/transaction_routes.py"
click node_compliance_api "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/compliance_routes.py"
click node_auth "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/services/auth_dependencies.py"
click node_dashboard_api "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/services/dashboard_service.py"
click node_superadmin_api "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/superadmin_routes.py"
click node_db_session "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/db.py"
click node_domain_models "https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/backend/app/models"
click node_frontend_api "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/frontend/src/lib/api.ts"
click node_dashboard_ui "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/frontend/src/app/main/dashboard/page.tsx"
click node_compliance_ui "https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/frontend/src/app/main/compliance/page.tsx"
click node_superadmin_ui "https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/frontend/src/app/main/superadmin"

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_pipeline_entry,node_kyc_processing,node_risk_enrichment,node_rps_rules,node_rps_engine,node_stream_watchers,node_pipeline_persistence,node_mcp_access toneBlue
class node_api_app,node_user_kyc_api,node_transaction_api,node_compliance_api,node_auth,node_dashboard_api,node_superadmin_api toneAmber
class node_db_session,node_domain_models toneMint
class node_frontend_api,node_dashboard_ui,node_compliance_ui,node_superadmin_ui toneRose
class node_compliance_team,node_kyc_source,node_transaction_source,node_external_risk_data toneIndigo
```

## Components

### Screening pipeline

- [Pipeline orchestration](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/main.py): `pipeline/main.py`
- [KYC processing](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/OCR/process_kyc.py): `pipeline/OCR/process_kyc.py`
- [Sanctions and media](https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/pipeline/utils): `pipeline/utils`
- [Transaction rules](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/rps/src/rules/rule_engine.py): `pipeline/rps/src/rules/rule_engine.py`
- [Risk scoring](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/rps/src/service/rps_engine.py): `pipeline/rps/src/service/rps_engine.py`
- [Continuous screening](https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/pipeline/watcher): `pipeline/watcher`
- [Pipeline database updates](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/pipeline/database_update.py): `pipeline/database_update.py`
- [MCP access](https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/pipeline/mcp): `pipeline/mcp`

### Backend API

- [API application](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/main.py): `backend/app/main.py`
- [User and KYC API](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/user_routes.py): `backend/app/routes/user_routes.py`
- [Transaction API](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/transaction_routes.py): `backend/app/routes/transaction_routes.py`
- [Compliance alerts](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/compliance_routes.py): `backend/app/routes/compliance_routes.py`
- [Authentication and roles](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/services/auth_dependencies.py): `backend/app/services/auth_dependencies.py`
- [Dashboard analytics](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/services/dashboard_service.py): `backend/app/services/dashboard_service.py`
- [System monitoring](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/routes/superadmin_routes.py): `backend/app/routes/superadmin_routes.py`

### Operational data

- [Database access](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/backend/app/db.py): `backend/app/db.py`
- [Operational records](https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/backend/app/models): `backend/app/models`

### Compliance dashboard

- [Frontend API client](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Risk dashboard](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/frontend/src/app/main/dashboard/page.tsx): `frontend/src/app/main/dashboard/page.tsx`
- [Compliance workspace](https://github.com/prathameshdeshpande99/pathway-interiit-14/blob/main/frontend/src/app/main/compliance/page.tsx): `frontend/src/app/main/compliance/page.tsx`
- [Superadmin views](https://github.com/prathameshdeshpande99/pathway-interiit-14/tree/main/frontend/src/app/main/superadmin): `frontend/src/app/main/superadmin`

### Other components

- **Compliance team**
- **KYC data**
- **Transaction data**
- **Risk data sources**

## Connections

- KYC data → Pipeline orchestration: ingests
- Transaction data → Pipeline orchestration: screens
- Pipeline orchestration → KYC processing: processes KYC
- Pipeline orchestration → Sanctions and media: enriches matches (evidence: `pipeline/main.py`)
- Risk data sources → Sanctions and media: provides signals
- Pipeline orchestration → Risk scoring: calculates risk
- Risk scoring → Transaction rules: evaluates rules (evidence: `pipeline/rps/src/service/rps_engine.py`)
- Pipeline orchestration → Continuous screening: streams updates
- Continuous screening → Pipeline database updates: updates records
- MCP access → Pipeline orchestration: aggregates results (evidence: `pipeline/mcp/mcp_client.py`)
- KYC data → User and KYC API: submits KYC
- Transaction data → Transaction API: submits activity
- API application → Database access: initializes tables (evidence: `backend/app/main.py`)
- API application → User and KYC API: registers routes (evidence: `backend/app/main.py`)
- API application → Transaction API: registers routes (evidence: `backend/app/main.py`)
- API application → Compliance alerts: registers routes (evidence: `backend/app/main.py`)
- API application → System monitoring: registers routes (evidence: `backend/app/main.py`)
- User and KYC API → Authentication and roles: checks roles (evidence: `backend/app/routes/user_routes.py`)
- Compliance alerts → Authentication and roles: checks roles (evidence: `backend/app/routes/compliance_routes.py`)
- System monitoring → Authentication and roles: checks superadmin (evidence: `backend/app/routes/superadmin_routes.py`)
- Authentication and roles → Database access: loads admins (evidence: `backend/app/services/auth_dependencies.py`)
- User and KYC API → Database access: uses sessions (evidence: `backend/app/routes/user_routes.py`)
- Compliance alerts → Database access: queries alerts (evidence: `backend/app/routes/compliance_routes.py`)
- System monitoring → Database access: queries monitoring (evidence: `backend/app/routes/superadmin_routes.py`)
- Database access → Operational records: persists records (evidence: `backend/app/models/user.py`)
- Pipeline database updates → Operational records: writes risk data
- Pipeline orchestration → Compliance alerts: supplies screening results
- Compliance team → Risk dashboard: reviews flags
- Risk dashboard → Frontend API client: requests dashboard data
- Compliance workspace → Frontend API client: requests alerts
- Superadmin views → Frontend API client: requests monitoring
- Frontend API client → API application: calls API
- Dashboard analytics → Database access: reads analytics data (evidence: `backend/app/routes/dashboard_routes.py`)
- API application → Dashboard analytics: serves dashboard
