# rnrinfodgl18/pawnsoftfrontend architecture

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

- Interactive diagram: https://gitdiagram.com/rnrinfodgl18/pawnsoftfrontend
- Repository: https://github.com/rnrinfodgl18/pawnsoftfrontend

## Overview

PawnPro is a React frontend for pawn-shop operations. Users authenticate, select a company, and enter the routed administration area; there they manage customers and jewelry pledges, record payments, and maintain supporting rates, schemes, accounts, and bank references. The frontend delegates server operations to its API client and provides shared navigation and notifications. The README documents capabilities beyond the sampled excerpts; those are represented as feature areas, but unsampled implementation details and their API calls are not asserted.

Main entry points: [`layouts/AdminLayout.tsx`](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/layouts/AdminLayout.tsx) (Admin routes), [`apiClient.ts`](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/apiClient.ts) (API client), [`App.tsx`](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/App.tsx) (App and session), [`views/Customers.tsx`](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Customers.tsx) (Customer records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["App and session<br/>[App.tsx]"]
  node_auth["Login<br/>[Login.tsx]"]
  node_company["Company selection"]
  node_routing["Admin routes<br/>[AdminLayout.tsx]"]
end

subgraph group_pledges["Pledge Operations"]
  node_customers["Customer records<br/>[Customers.tsx]"]
  node_pledge_create["Create pledge<br/>[CreatePledge.tsx]"]
  node_pledge_edit["Edit pledge<br/>[EditPledge.tsx]"]
  node_pledge_list["Pledge tracking<br/>[PledgeList.tsx]"]
  node_pledge_view["Pledge details<br/>[PledgeView.tsx]"]
  node_pledge_payment["Pledge payments<br/>[PledgePayment.tsx]"]
  node_receipt["Payment receipt"]
  node_legacy["Legacy pledge tools"]
end

subgraph group_masters["Business Setup"]
  node_jewelry["Jewelry catalog<br/>[JewellType.tsx]"]
  node_jewelry_rates["Jewelry rates<br/>[JewellRates.tsx]"]
  node_metal_rates["Metal rates"]
  node_schemes["Pledge schemes<br/>[Schemes.tsx]"]
end

subgraph group_finance["Finance &amp; Reporting"]
  node_accounts["Account masters"]
  node_banks["Bank management<br/>[BankManagement.tsx]"]
  node_daybook["Daybook<br/>[Daybook.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_api["API client<br/>[apiClient.ts]"]
  node_toast_context["Toast context<br/>[ToastContext.tsx]"]
  node_toast_ui["Toast display<br/>[Toast.tsx]"]
  node_global_toast["Global toast setup"]
end

node_operator(("Pawn-shop user"))
node_backend[("PawnPro backend")]

node_operator -.->|"uses"| node_app
node_app -->|"shows when unauthenticated"| node_auth
node_app -->|"requires selection"| node_company
node_app -->|"renders"| node_routing
node_routing -->|"routes to"| node_customers
node_routing -->|"routes to"| node_pledge_create
node_routing -->|"routes to"| node_pledge_edit
node_routing -->|"routes to"| node_pledge_list
node_routing -->|"routes to"| node_pledge_view
node_routing -->|"routes to"| node_pledge_payment
node_routing -.->|"routes to"| node_receipt
node_routing -->|"routes to"| node_legacy
node_routing -->|"routes to"| node_jewelry
node_routing -->|"routes to"| node_jewelry_rates
node_routing -->|"routes to"| node_metal_rates
node_routing -->|"routes to"| node_schemes
node_routing -->|"routes to"| node_accounts
node_routing -->|"routes to"| node_banks
node_routing -->|"routes to"| node_daybook
node_routing -->|"routes to"| node_dashboard
node_customers -->|"requests data"| node_api
node_pledge_create -->|"requests data"| node_api
node_pledge_edit -->|"requests data"| node_api
node_pledge_list -.->|"requests data"| node_api
node_pledge_payment -->|"requests data"| node_api
node_receipt -.->|"requests data"| node_api
node_legacy -->|"requests data"| node_api
node_jewelry_rates -->|"requests data"| node_api
node_schemes -->|"requests data"| node_api
node_accounts -->|"requests data"| node_api
node_banks -->|"requests data"| node_api
node_daybook -->|"requests data"| node_api
node_api -.->|"sends requests"| node_backend
node_routing -->|"provides notifications"| node_toast_context
node_toast_context -->|"renders"| node_toast_ui
node_global_toast -->|"registers handler"| node_api

click node_app "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/App.tsx"
click node_auth "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Login.tsx"
click node_company "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/CompanySelection.tsx"
click node_routing "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/layouts/AdminLayout.tsx"
click node_customers "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Customers.tsx"
click node_pledge_create "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/CreatePledge.tsx"
click node_pledge_edit "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/EditPledge.tsx"
click node_pledge_list "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgeList.tsx"
click node_pledge_view "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgeView.tsx"
click node_pledge_payment "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgePayment.tsx"
click node_receipt "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgePrintReceipt.tsx"
click node_legacy "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/OldPledgeImport.tsx"
click node_jewelry "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/JewellType.tsx"
click node_jewelry_rates "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/JewellRates.tsx"
click node_metal_rates "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/GoldSilverRateAdmin.tsx"
click node_schemes "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Schemes.tsx"
click node_accounts "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/AccountsMasters.tsx"
click node_banks "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/BankManagement.tsx"
click node_daybook "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Daybook.tsx"
click node_dashboard "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Dashboard.tsx"
click node_api "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/apiClient.ts"
click node_toast_context "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/contexts/ToastContext.tsx"
click node_toast_ui "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/components/toasts/Toast.tsx"
click node_global_toast "https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/components/GlobalToastSetup.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,node_auth,node_company,node_routing,node_operator toneBlue
class node_customers,node_pledge_create,node_pledge_edit,node_pledge_list,node_pledge_view,node_pledge_payment,node_receipt,node_legacy,node_backend toneAmber
class node_jewelry,node_jewelry_rates,node_metal_rates,node_schemes toneMint
class node_accounts,node_banks,node_daybook,node_dashboard toneRose
class node_api,node_toast_context,node_toast_ui,node_global_toast toneIndigo
```

## Components

### Application Shell

- [App and session](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/App.tsx): `App.tsx`
- [Login](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Login.tsx): `views/Login.tsx`
- [Company selection](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/CompanySelection.tsx): `views/CompanySelection.tsx`
- [Admin routes](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/layouts/AdminLayout.tsx): `layouts/AdminLayout.tsx`

### Pledge Operations

- [Customer records](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Customers.tsx): `views/Customers.tsx`
- [Create pledge](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/CreatePledge.tsx): `views/CreatePledge.tsx`
- [Edit pledge](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/EditPledge.tsx): `views/EditPledge.tsx`
- [Pledge tracking](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgeList.tsx): `views/PledgeList.tsx`
- [Pledge details](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgeView.tsx): `views/PledgeView.tsx`
- [Pledge payments](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgePayment.tsx): `views/PledgePayment.tsx`
- [Payment receipt](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/PledgePrintReceipt.tsx): `views/PledgePrintReceipt.tsx`
- [Legacy pledge tools](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/OldPledgeImport.tsx): `views/OldPledgeImport.tsx`

### Business Setup

- [Jewelry catalog](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/JewellType.tsx): `views/JewellType.tsx`
- [Jewelry rates](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/JewellRates.tsx): `views/JewellRates.tsx`
- [Metal rates](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/GoldSilverRateAdmin.tsx): `views/GoldSilverRateAdmin.tsx`
- [Pledge schemes](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Schemes.tsx): `views/Schemes.tsx`

### Finance & Reporting

- [Account masters](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/AccountsMasters.tsx): `views/AccountsMasters.tsx`
- [Bank management](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/BankManagement.tsx): `views/BankManagement.tsx`
- [Daybook](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Daybook.tsx): `views/Daybook.tsx`
- [Dashboard](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/views/Dashboard.tsx): `views/Dashboard.tsx`

### Shared Services

- [API client](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/apiClient.ts): `apiClient.ts`
- [Toast context](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/contexts/ToastContext.tsx): `contexts/ToastContext.tsx`
- [Toast display](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/components/toasts/Toast.tsx): `components/toasts/Toast.tsx`
- [Global toast setup](https://github.com/rnrinfodgl18/pawnsoftfrontend/blob/main/components/GlobalToastSetup.tsx): `components/GlobalToastSetup.tsx`

### Other components

- **Pawn-shop user**
- **PawnPro backend**

## Connections

- Pawn-shop user → App and session: uses
- App and session → Login: shows when unauthenticated (evidence: `App.tsx`)
- App and session → Company selection: requires selection (evidence: `App.tsx`)
- App and session → Admin routes: renders (evidence: `App.tsx`)
- Admin routes → Customer records: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Create pledge: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Edit pledge: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Pledge tracking: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Pledge details: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Pledge payments: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Payment receipt: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Legacy pledge tools: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Jewelry catalog: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Jewelry rates: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Metal rates: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Pledge schemes: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Account masters: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Bank management: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Daybook: routes to (evidence: `layouts/AdminLayout.tsx`)
- Admin routes → Dashboard: routes to (evidence: `layouts/AdminLayout.tsx`)
- Customer records → API client: requests data (evidence: `views/Customers.tsx`)
- Create pledge → API client: requests data (evidence: `views/CreatePledge.tsx`)
- Edit pledge → API client: requests data (evidence: `views/EditPledge.tsx`)
- Pledge tracking → API client: requests data
- Pledge payments → API client: requests data (evidence: `views/PledgePayment.tsx`)
- Payment receipt → API client: requests data (evidence: `views/PledgePrintReceipt.tsx`)
- Legacy pledge tools → API client: requests data (evidence: `views/OldPledgeImport.tsx`)
- Jewelry rates → API client: requests data (evidence: `views/JewellRates.tsx`)
- Pledge schemes → API client: requests data (evidence: `views/Schemes.tsx`)
- Account masters → API client: requests data (evidence: `views/AccountsMasters.tsx`)
- Bank management → API client: requests data (evidence: `views/BankManagement.tsx`)
- Daybook → API client: requests data (evidence: `views/Daybook.tsx`)
- API client → PawnPro backend: sends requests
- Admin routes → Toast context: provides notifications (evidence: `layouts/AdminLayout.tsx`)
- Toast context → Toast display: renders (evidence: `contexts/ToastContext.tsx`)
- Global toast setup → API client: registers handler (evidence: `components/GlobalToastSetup.tsx`)
