# jaisriv788/scan2pay_merchant architecture

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

- Interactive diagram: https://gitdiagram.com/jaisriv788/scan2pay_merchant
- Repository: https://github.com/jaisriv788/scan2pay_merchant

## Overview

Scan2Pay Merchant Portal is a React merchant-facing application for selling USDT/USDC for INR and managing merchant operations. Merchants enter through login or verification, then use protected routes for dashboard rates, transactions, wallet/order workflows, profile, disputes, and support. The route map and sampled components show that pages are composed under a shared Redux-backed shell; state slices hold user, price, UI-model, constants, and PWA state. API details are only connected where sampled code shows requests; other documented capabilities are retained without guessing their internal wiring.

Main entry points: [`src/App.tsx`](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/App.tsx) (Route shell), [`src/store/store.ts`](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/store.ts) (Redux store), [`src/components/common/Navbar.tsx`](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/Navbar.tsx) (Navigation and rates), [`src/screens/Verify.tsx`](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Verify.tsx) (Identity verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App and routing"]
  node_app["Route shell<br/>[App.tsx]"]
end

subgraph group_merchant["Merchant workflows"]
  node_login["Login<br/>[Login.tsx]"]
  node_login_dialog["Login methods<br/>[LoginDialog.tsx]"]
  node_verification["Identity verification<br/>[Verify.tsx]"]
  node_verify_status["Verification status<br/>[Verification.tsx]"]
  node_dashboard["Dashboard and rates<br/>[Dashboard.tsx]"]
  node_profile["Profile management<br/>[Profile.tsx]"]
  node_transactions["Transaction history<br/>[Transaction.tsx]"]
  node_wallet["Wallet and deposits<br/>[Wallet.tsx]"]
  node_deposit_form["Deposit form<br/>[DepositeForm.tsx]"]
  node_order_flow["Order and confirmation<br/>[Confirmation.tsx]"]
  node_sell_confirmation["Sell confirmation"]
  node_scan_confirmation["Scan confirmation"]
  node_requests["Pending requests<br/>[PendingRequest.tsx]"]
  node_funds["Funds<br/>[Funds.tsx]"]
  node_processing["Processing requests"]
  node_disputes["Dispute management<br/>[DisputeForm.tsx]"]
  node_support["Support<br/>[Support.tsx]"]
end

subgraph group_state["Application state"]
  node_store["Redux store<br/>[store.ts]"]
  node_user_state["User state<br/>[userSlice.ts]"]
  node_price_state["Price and balance<br/>[priceSlice.ts]"]
  node_model_state["UI model state<br/>[modelSlice.ts]"]
  node_const_state["App constants<br/>[constSlice.ts]"]
  node_pwa_state["PWA state<br/>[pwaSlice.ts]"]
end

subgraph group_shared["Shared interface"]
  node_navbar["Navigation and rates<br/>[Navbar.tsx]"]
  node_protected_route["Protected access<br/>[ProtectedRoute.tsx]"]
  node_seen_storage[("Seen-order storage<br/>[seenStorage.ts]")]
  node_success_hook["Success feedback<br/>[useShowSuccess.ts]"]
end

subgraph group_pwa["PWA support"]
  node_install["Install button<br/>[InstallButton.tsx]"]
end

node_merchant_actor(("Merchant"))
node_rates_service["Rates API"]
node_merchant_api["Merchant API"]

node_merchant_actor -->|"opens portal"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_verification
node_app -->|"routes to"| node_verify_status
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_transactions
node_app -->|"routes to"| node_wallet
node_app -->|"routes to"| node_order_flow
node_app -->|"routes to"| node_sell_confirmation
node_app -->|"routes to"| node_scan_confirmation
node_app -->|"routes to"| node_requests
node_app -->|"routes to"| node_funds
node_app -->|"routes to"| node_processing
node_app -->|"routes to"| node_disputes
node_login -.->|"uses login methods"| node_login_dialog
node_wallet -.->|"uses form"| node_deposit_form
node_navbar -->|"fetches rates"| node_rates_service
node_navbar -->|"updates prices"| node_price_state
node_price_state -->|"requests balance"| node_merchant_api
node_verification -->|"submits approval"| node_merchant_api
node_verification -->|"checks approval"| node_merchant_api
node_protected_route -->|"renders shell"| node_navbar
node_protected_route -->|"reads and writes"| node_seen_storage
node_requests -->|"uses storage"| node_seen_storage
node_success_hook -->|"dispatches messages"| node_model_state
node_app -->|"selects state"| node_store
node_store -->|"combines reducer"| node_user_state
node_store -->|"combines reducer"| node_price_state
node_store -->|"combines reducer"| node_model_state
node_store -->|"combines reducer"| node_const_state
node_store -->|"combines reducer"| node_pwa_state
node_navbar -->|"renders button"| node_install
node_install -->|"reads install state"| node_pwa_state
node_merchant_actor -.->|"seeks help"| node_support

click node_app "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/App.tsx"
click node_login "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Login.tsx"
click node_login_dialog "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/login/LoginDialog.tsx"
click node_verification "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Verify.tsx"
click node_verify_status "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/Verification.tsx"
click node_dashboard "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Dashboard.tsx"
click node_profile "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Profile.tsx"
click node_transactions "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Transaction.tsx"
click node_wallet "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Wallet.tsx"
click node_deposit_form "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/wallet/DepositeForm.tsx"
click node_order_flow "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Confirmation.tsx"
click node_sell_confirmation "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/SellConfirmation.tsx"
click node_scan_confirmation "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/ScanConfirmation.tsx"
click node_requests "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/PendingRequest.tsx"
click node_funds "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Funds.tsx"
click node_processing "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/ProcessingRequest.tsx"
click node_disputes "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/DisputeForm.tsx"
click node_support "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Support.tsx"
click node_store "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/store.ts"
click node_user_state "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/userSlice.ts"
click node_price_state "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/priceSlice.ts"
click node_model_state "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/modelSlice.ts"
click node_const_state "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/constSlice.ts"
click node_pwa_state "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/pwaSlice.ts"
click node_navbar "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/Navbar.tsx"
click node_protected_route "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/ProtectedRoute.tsx"
click node_seen_storage "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/utils/seenStorage.ts"
click node_success_hook "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/hooks/useShowSuccess.ts"
click node_install "https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/PWAInstall/InstallButton.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_app toneBlue
class node_login,node_login_dialog,node_verification,node_verify_status,node_dashboard,node_profile,node_transactions,node_wallet,node_deposit_form,node_order_flow,node_sell_confirmation,node_scan_confirmation,node_requests,node_funds,node_processing,node_disputes,node_support toneAmber
class node_store,node_user_state,node_price_state,node_model_state,node_const_state,node_pwa_state,node_rates_service,node_merchant_api toneMint
class node_navbar,node_protected_route,node_seen_storage,node_success_hook toneRose
class node_install,node_merchant_actor toneIndigo
```

## Components

### App and routing

- [Route shell](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/App.tsx): `src/App.tsx`

### Merchant workflows

- [Login](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Login.tsx): `src/screens/Login.tsx`
- [Login methods](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/login/LoginDialog.tsx): `src/components/login/LoginDialog.tsx`
- [Identity verification](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Verify.tsx): `src/screens/Verify.tsx`
- [Verification status](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/Verification.tsx): `src/components/common/Verification.tsx`
- [Dashboard and rates](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Dashboard.tsx): `src/screens/Dashboard.tsx`
- [Profile management](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Profile.tsx): `src/screens/Profile.tsx`
- [Transaction history](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Transaction.tsx): `src/screens/Transaction.tsx`
- [Wallet and deposits](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Wallet.tsx): `src/screens/Wallet.tsx`
- [Deposit form](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/wallet/DepositeForm.tsx): `src/components/wallet/DepositeForm.tsx`
- [Order and confirmation](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Confirmation.tsx): `src/screens/Confirmation.tsx`
- [Sell confirmation](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/SellConfirmation.tsx): `src/screens/SellConfirmation.tsx`
- [Scan confirmation](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/ScanConfirmation.tsx): `src/screens/ScanConfirmation.tsx`
- [Pending requests](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/PendingRequest.tsx): `src/screens/PendingRequest.tsx`
- [Funds](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Funds.tsx): `src/screens/Funds.tsx`
- [Processing requests](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/ProcessingRequest.tsx): `src/screens/ProcessingRequest.tsx`
- [Dispute management](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/DisputeForm.tsx): `src/screens/DisputeForm.tsx`
- [Support](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/screens/Support.tsx): `src/screens/Support.tsx`

### Application state

- [Redux store](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/store.ts): `src/store/store.ts`
- [User state](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/userSlice.ts): `src/store/slices/userSlice.ts`
- [Price and balance](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/priceSlice.ts): `src/store/slices/priceSlice.ts`
- [UI model state](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/modelSlice.ts): `src/store/slices/modelSlice.ts`
- [App constants](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/constSlice.ts): `src/store/slices/constSlice.ts`
- [PWA state](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/store/slices/pwaSlice.ts): `src/store/slices/pwaSlice.ts`

### Shared interface

- [Navigation and rates](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/Navbar.tsx): `src/components/common/Navbar.tsx`
- [Protected access](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/common/ProtectedRoute.tsx): `src/components/common/ProtectedRoute.tsx`
- [Seen-order storage](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/utils/seenStorage.ts): `src/utils/seenStorage.ts`
- [Success feedback](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/hooks/useShowSuccess.ts): `src/hooks/useShowSuccess.ts`

### PWA support

- [Install button](https://github.com/jaisriv788/scan2pay_merchant/blob/main/src/components/PWAInstall/InstallButton.tsx): `src/components/PWAInstall/InstallButton.tsx`

### Other components

- **Merchant**
- **Rates API**
- **Merchant API**

## Connections

- Merchant → Route shell: opens portal (evidence: `src/App.tsx`)
- Route shell → Login: routes to (evidence: `src/App.tsx`)
- Route shell → Identity verification: routes to (evidence: `src/App.tsx`)
- Route shell → Verification status: routes to (evidence: `src/App.tsx`)
- Route shell → Dashboard and rates: routes to (evidence: `src/App.tsx`)
- Route shell → Profile management: routes to (evidence: `src/App.tsx`)
- Route shell → Transaction history: routes to (evidence: `src/App.tsx`)
- Route shell → Wallet and deposits: routes to (evidence: `src/App.tsx`)
- Route shell → Order and confirmation: routes to (evidence: `src/App.tsx`)
- Route shell → Sell confirmation: routes to (evidence: `src/App.tsx`)
- Route shell → Scan confirmation: routes to (evidence: `src/App.tsx`)
- Route shell → Pending requests: routes to (evidence: `src/App.tsx`)
- Route shell → Funds: routes to (evidence: `src/App.tsx`)
- Route shell → Processing requests: routes to (evidence: `src/App.tsx`)
- Route shell → Dispute management: routes to (evidence: `src/App.tsx`)
- Login → Login methods: uses login methods
- Wallet and deposits → Deposit form: uses form
- Navigation and rates → Rates API: fetches rates (evidence: `src/components/common/Navbar.tsx`)
- Navigation and rates → Price and balance: updates prices (evidence: `src/components/common/Navbar.tsx`)
- Price and balance → Merchant API: requests balance (evidence: `src/store/slices/priceSlice.ts`)
- Identity verification → Merchant API: submits approval (evidence: `src/screens/Verify.tsx`)
- Identity verification → Merchant API: checks approval (evidence: `src/screens/Verify.tsx`)
- Protected access → Navigation and rates: renders shell (evidence: `src/components/common/ProtectedRoute.tsx`)
- Protected access → Seen-order storage: reads and writes (evidence: `src/components/common/ProtectedRoute.tsx`)
- Pending requests → Seen-order storage: uses storage (evidence: `src/screens/PendingRequest.tsx`)
- Success feedback → UI model state: dispatches messages (evidence: `src/hooks/useShowSuccess.ts`)
- Route shell → Redux store: selects state (evidence: `src/App.tsx`)
- Redux store → User state: combines reducer
- Redux store → Price and balance: combines reducer (evidence: `src/store/slices/priceSlice.ts`)
- Redux store → UI model state: combines reducer
- Redux store → App constants: combines reducer
- Redux store → PWA state: combines reducer
- Navigation and rates → Install button: renders button (evidence: `src/components/common/Navbar.tsx`)
- Install button → PWA state: reads install state (evidence: `src/components/PWAInstall/InstallButton.tsx`)
- Merchant → Support: seeks help (evidence: `README.md`)
