# ashish-007-700/upi-payment-support-agent architecture

> Architecture diagram of the GitHub repository ashish-007-700/upi-payment-support-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashish-007-700/upi-payment-support-agent
- Repository: https://github.com/ashish-007-700/upi-payment-support-agent

## Overview

This repository combines a UPI dispute-resolution app, a browser client, and separate mock bank and merchant APIs. A user can register, create or review a transaction, raise a dispute, and request verification; the agent backend handles dispute verification and can coordinate a refund, while the mock services provide bank-side and merchant-side checks. The client also exposes role-specific dashboards and transaction/dispute history. The README is empty and several workflow modules were not sampled, so uncertain internal calls are omitted; service capabilities and paths reflect the supplied tree and excerpts.

Main entry points: [`Agent/Kl_Hackathon/upi_dispute_agent/services/verification_service.py`](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/verification_service.py) (Verification service), [`Agent/Kl_Hackathon/upi_dispute_agent/app.py`](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/app.py) (Agent API), [`client/src/App.jsx`](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/App.jsx) (Client routing), [`client/src/services/dashboardService.js`](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/services/dashboardService.js) (Client API services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Client routing<br/>[App.jsx]"]
  node_authui["Auth screens<br/>[LoginPage.jsx]"]
  node_dashboard["Role dashboards"]
  node_txnui["Transaction flows"]
  node_disputeui["Dispute screens"]
  node_clientservices["Client API services"]
  node_authservice["Auth API service<br/>[authService.js]"]
end

subgraph group_agent["Dispute agent"]
  node_agentapp["Agent API<br/>[app.py]"]
  node_authroutes["Auth routes<br/>[auth_routes.py]"]
  node_verifyroutes["Verification routes"]
  node_verification["Verification service"]
  node_autoverify["Automatic verifier<br/>[auto_verifier.py]"]
  node_decision["Decision rules<br/>[decision_matrix.py]"]
  node_refund["Refund processing<br/>[refund_service.py]"]
end

subgraph group_mock["Mock services"]
  node_bankapi["Mock bank API<br/>[bank_routes.py]"]
  node_bankservice["Bank operations<br/>[bank_service.py]"]
  node_merchantapi["Mock merchant API<br/>[merchant_routes.py]"]
  node_merchantservice["Merchant operations"]
end

subgraph group_state["Persistence"]
  node_serverdb[("Bank and order records<br/>[db.py]")]
  node_agentdb[("Agent records<br/>[db.py]")]
  node_bankmodel["Bank transactions"]
  node_merchantmodel["Merchant orders"]
  node_agentmodels["Users, disputes, transactions"]
end

node_user(("UPI user"))
node_bank(("Bank service consumer"))
node_merchant(("Merchant service consumer"))

node_user -->|"uses"| node_app
node_app -->|"routes"| node_authui
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_txnui
node_app -->|"routes"| node_disputeui
node_authui -->|"authenticates"| node_authservice
node_authservice -->|"HTTP requests"| node_agentapp
node_dashboard -->|"loads records"| node_clientservices
node_txnui -->|"API requests"| node_clientservices
node_disputeui -->|"API requests"| node_clientservices
node_clientservices -->|"HTTP requests"| node_agentapp
node_agentapp -->|"dispatches"| node_authroutes
node_agentapp -->|"dispatches"| node_verifyroutes
node_agentapp -->|"reads and writes"| node_agentmodels
node_agentapp -->|"verifies dispute"| node_verification
node_verifyroutes -->|"verifies dispute"| node_verification
node_verification -->|"invokes"| node_autoverify
node_verification -->|"evaluates outcome"| node_decision
node_verification -->|"requests refund"| node_refund
node_refund -->|"refund requests"| node_bankapi
node_verification -.->|"transaction checks"| node_bankapi
node_verification -.->|"payment checks"| node_merchantapi
node_bankapi -->|"dispatches"| node_bankservice
node_merchantapi -->|"dispatches"| node_merchantservice
node_bankservice -->|"reads and updates"| node_bankmodel
node_merchantservice -->|"reads and updates"| node_merchantmodel
node_bankmodel -->|"persists"| node_serverdb
node_merchantmodel -->|"persists"| node_serverdb
node_agentmodels -->|"persists"| node_agentdb
node_bank -->|"calls"| node_bankapi
node_merchant -->|"calls"| node_merchantapi

click node_app "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/App.jsx"
click node_authui "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/LoginPage.jsx"
click node_dashboard "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/ClientDashboard.jsx"
click node_txnui "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/CreateTransactionPage.jsx"
click node_disputeui "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/RaiseDisputePage.jsx"
click node_clientservices "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/services/dashboardService.js"
click node_authservice "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/services/authService.js"
click node_agentapp "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/app.py"
click node_authroutes "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/routes/auth_routes.py"
click node_verifyroutes "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/routes/verification_routes.py"
click node_verification "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/verification_service.py"
click node_autoverify "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/auto_verifier.py"
click node_decision "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/utils/decision_matrix.py"
click node_refund "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/refund_service.py"
click node_bankapi "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/routes/bank_routes.py"
click node_bankservice "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/services/bank_service.py"
click node_merchantapi "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/routes/merchant_routes.py"
click node_merchantservice "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/services/merchant_service.py"
click node_serverdb "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/database/db.py"
click node_agentdb "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/database/db.py"
click node_bankmodel "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/models/bank_transaction_model.py"
click node_merchantmodel "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/models/merchant_order_model.py"
click node_agentmodels "https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/models/transaction_model.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_app,node_authui,node_dashboard,node_txnui,node_disputeui,node_clientservices,node_authservice,node_user toneBlue
class node_agentapp,node_authroutes,node_verifyroutes,node_verification,node_autoverify,node_decision,node_refund toneAmber
class node_bankapi,node_bankservice,node_merchantapi,node_merchantservice toneMint
class node_serverdb,node_agentdb,node_bankmodel,node_merchantmodel,node_agentmodels toneRose
class node_bank,node_merchant toneIndigo
```

## Components

### Web client

- [Client routing](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth screens](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/LoginPage.jsx): `client/src/pages/LoginPage.jsx`
- [Role dashboards](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/ClientDashboard.jsx): `client/src/pages/ClientDashboard.jsx`
- [Transaction flows](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/CreateTransactionPage.jsx): `client/src/pages/CreateTransactionPage.jsx`
- [Dispute screens](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/pages/RaiseDisputePage.jsx): `client/src/pages/RaiseDisputePage.jsx`
- [Client API services](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/services/dashboardService.js): `client/src/services/dashboardService.js`
- [Auth API service](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/client/src/services/authService.js): `client/src/services/authService.js`

### Dispute agent

- [Agent API](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/app.py): `Agent/Kl_Hackathon/upi_dispute_agent/app.py`
- [Auth routes](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/routes/auth_routes.py): `Agent/Kl_Hackathon/upi_dispute_agent/routes/auth_routes.py`
- [Verification routes](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/routes/verification_routes.py): `Agent/Kl_Hackathon/upi_dispute_agent/routes/verification_routes.py`
- [Verification service](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/verification_service.py): `Agent/Kl_Hackathon/upi_dispute_agent/services/verification_service.py`
- [Automatic verifier](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/auto_verifier.py): `Agent/Kl_Hackathon/upi_dispute_agent/services/auto_verifier.py`
- [Decision rules](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/utils/decision_matrix.py): `Agent/Kl_Hackathon/upi_dispute_agent/utils/decision_matrix.py`
- [Refund processing](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/services/refund_service.py): `Agent/Kl_Hackathon/upi_dispute_agent/services/refund_service.py`

### Mock services

- [Mock bank API](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/routes/bank_routes.py): `server/routes/bank_routes.py`
- [Bank operations](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/services/bank_service.py): `server/services/bank_service.py`
- [Mock merchant API](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/routes/merchant_routes.py): `server/routes/merchant_routes.py`
- [Merchant operations](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/services/merchant_service.py): `server/services/merchant_service.py`

### Persistence

- [Bank and order records](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/database/db.py): `server/database/db.py`
- [Agent records](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/database/db.py): `Agent/Kl_Hackathon/upi_dispute_agent/database/db.py`
- [Bank transactions](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/models/bank_transaction_model.py): `server/models/bank_transaction_model.py`
- [Merchant orders](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/server/models/merchant_order_model.py): `server/models/merchant_order_model.py`
- [Users, disputes, transactions](https://github.com/ashish-007-700/upi-payment-support-agent/blob/main/Agent/Kl_Hackathon/upi_dispute_agent/models/transaction_model.py): `Agent/Kl_Hackathon/upi_dispute_agent/models/transaction_model.py`

### Other components

- **UPI user**
- **Bank service consumer**
- **Merchant service consumer**

## Connections

- UPI user → Client routing: uses
- Client routing → Auth screens: routes
- Client routing → Role dashboards: routes
- Client routing → Transaction flows: routes
- Client routing → Dispute screens: routes
- Auth screens → Auth API service: authenticates
- Auth API service → Agent API: HTTP requests
- Role dashboards → Client API services: loads records
- Transaction flows → Client API services: API requests
- Dispute screens → Client API services: API requests
- Client API services → Agent API: HTTP requests
- Agent API → Auth routes: dispatches
- Agent API → Verification routes: dispatches
- Agent API → Users, disputes, transactions: reads and writes
- Agent API → Verification service: verifies dispute
- Verification routes → Verification service: verifies dispute
- Verification service → Automatic verifier: invokes
- Verification service → Decision rules: evaluates outcome
- Verification service → Refund processing: requests refund
- Refund processing → Mock bank API: refund requests
- Verification service → Mock bank API: transaction checks
- Verification service → Mock merchant API: payment checks
- Mock bank API → Bank operations: dispatches
- Mock merchant API → Merchant operations: dispatches
- Bank operations → Bank transactions: reads and updates
- Merchant operations → Merchant orders: reads and updates
- Bank transactions → Bank and order records: persists
- Merchant orders → Bank and order records: persists
- Users, disputes, transactions → Agent records: persists
- Bank service consumer → Mock bank API: calls
- Merchant service consumer → Mock merchant API: calls
