# devanshgoel0622-rgb/payguard-ai architecture

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

- Interactive diagram: https://gitdiagram.com/devanshgoel0622-rgb/payguard-ai
- Repository: https://github.com/devanshgoel0622-rgb/payguard-ai

## Overview

PayGuard AI is an academic prototype for detecting payment fraud and gateway degradation, with a Streamlit dashboard as its user-facing result. Its documented workflow combines anomaly screening and temporal validation, then presents alerts with severity and explanations; the current dashboard also replays temperature-failure scenarios. The repository contains notebooks for EDA, baselines, the autoencoder, hybrid modeling, and explainability, plus scripts that prepare dashboard assets and scenarios. The excerpts show dashboard and preparation behavior, but not notebook implementations or every dashboard loading step.

Main entry points: [`dashboard/app.py`](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py) (Streamlit Dashboard), [`week2_eda_creditcard.ipynb`](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week2_eda_creditcard.ipynb) (Fraud Data Prep), [`week3_baselines.ipynb`](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week3_baselines.ipynb) (Baseline Evaluation), [`week4_lstm_autoencoder.ipynb`](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week4_lstm_autoencoder.ipynb) (LSTM Autoencoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Modeling &amp; Detection"]
  node_bank_eda["Bank EDA"]
  node_fraud_prep["Fraud Data Prep"]
  node_baselines["Baseline Evaluation"]
  node_lstm["LSTM Autoencoder"]
  node_hybrid["Hybrid Detection"]
  node_explainability_work["Explainability Analysis"]
end

subgraph group_dashboard["Dashboard &amp; Triage"]
  node_dashboard_app["Streamlit Dashboard<br/>[app.py]"]
  node_live_monitor["Live Monitor<br/>[app.py]"]
  node_alert_feed["Alert Feed<br/>[app.py]"]
  node_explain_view["Explainability View<br/>[app.py]"]
  node_performance_view["Performance View<br/>[app.py]"]
end

subgraph group_prep["Asset Preparation"]
  node_dashboard_assets[("Dashboard Assets")]
  node_scenario_assets[("Scenario Assets")]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_dashboard_app
node_dashboard_app -->|"selects"| node_live_monitor
node_dashboard_app -->|"selects"| node_alert_feed
node_dashboard_app -->|"selects"| node_explain_view
node_dashboard_app -->|"selects"| node_performance_view
node_dashboard_app -->|"loads"| node_dashboard_assets
node_dashboard_app -->|"reads"| node_scenario_assets
node_dashboard_assets -->|"loads model"| node_scenario_assets
node_bank_eda -.->|"informs"| node_fraud_prep
node_fraud_prep -.->|"prepares data"| node_baselines
node_baselines -.->|"benchmarks"| node_lstm
node_lstm -.->|"screens"| node_hybrid
node_hybrid -.->|"explains alerts"| node_explainability_work

click node_bank_eda "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week1_eda_bank.ipynb"
click node_fraud_prep "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week2_eda_creditcard.ipynb"
click node_baselines "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week3_baselines.ipynb"
click node_lstm "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week4_lstm_autoencoder.ipynb"
click node_hybrid "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week5_hybrid_model.ipynb"
click node_explainability_work "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week6_explainability.ipynb"
click node_dashboard_app "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py"
click node_live_monitor "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py"
click node_alert_feed "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py"
click node_explain_view "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py"
click node_performance_view "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py"
click node_dashboard_assets "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/prepare_dashboard.py"
click node_scenario_assets "https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/prepare_scenarios.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_bank_eda,node_fraud_prep,node_baselines,node_lstm,node_hybrid,node_explainability_work toneBlue
class node_dashboard_app,node_live_monitor,node_alert_feed,node_explain_view,node_performance_view toneAmber
class node_dashboard_assets,node_scenario_assets toneMint
class node_operator toneIndigo
```

## Components

### Modeling & Detection

- [Bank EDA](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week1_eda_bank.ipynb): `week1_eda_bank.ipynb`
- [Fraud Data Prep](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week2_eda_creditcard.ipynb): `week2_eda_creditcard.ipynb`
- [Baseline Evaluation](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week3_baselines.ipynb): `week3_baselines.ipynb`
- [LSTM Autoencoder](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week4_lstm_autoencoder.ipynb): `week4_lstm_autoencoder.ipynb`
- [Hybrid Detection](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week5_hybrid_model.ipynb): `week5_hybrid_model.ipynb`
- [Explainability Analysis](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/week6_explainability.ipynb): `week6_explainability.ipynb`

### Dashboard & Triage

- [Streamlit Dashboard](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py): `dashboard/app.py`
- [Live Monitor](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py): `dashboard/app.py`
- [Alert Feed](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py): `dashboard/app.py`
- [Explainability View](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py): `dashboard/app.py`
- [Performance View](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/app.py): `dashboard/app.py`

### Asset Preparation

- [Dashboard Assets](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/prepare_dashboard.py): `dashboard/prepare_dashboard.py`
- [Scenario Assets](https://github.com/devanshgoel0622-rgb/payguard-ai/blob/main/dashboard/prepare_scenarios.py): `dashboard/prepare_scenarios.py`

### Other components

- **Operator**

## Connections

- Operator → Streamlit Dashboard: uses (evidence: `README.md`)
- Streamlit Dashboard → Live Monitor: selects (evidence: `dashboard/app.py`)
- Streamlit Dashboard → Alert Feed: selects (evidence: `dashboard/app.py`)
- Streamlit Dashboard → Explainability View: selects (evidence: `dashboard/app.py`)
- Streamlit Dashboard → Performance View: selects (evidence: `dashboard/app.py`)
- Streamlit Dashboard → Dashboard Assets: loads (evidence: `dashboard/app.py`)
- Streamlit Dashboard → Scenario Assets: reads (evidence: `dashboard/app.py`)
- Dashboard Assets → Scenario Assets: loads model (evidence: `dashboard/prepare_scenarios.py`)
- Bank EDA → Fraud Data Prep: informs (evidence: `README.md`)
- Fraud Data Prep → Baseline Evaluation: prepares data (evidence: `README.md`)
- Baseline Evaluation → LSTM Autoencoder: benchmarks (evidence: `README.md`)
- LSTM Autoencoder → Hybrid Detection: screens (evidence: `README.md`)
- Hybrid Detection → Explainability Analysis: explains alerts (evidence: `README.md`)
