# codeblocker52/paylink architecture

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

- Interactive diagram: https://gitdiagram.com/codeblocker52/paylink
- Repository: https://github.com/codeblocker52/paylink

## Overview

PayLink is a web app and Arc-based milestone escrow for freelance invoices. A freelancer creates an invoice and shares its link; the client funds it in USDC before work begins. The freelancer submits deliveries, then the client can approve or dispute, or the freelancer can claim after the review window. Releases produce receipts. The README documents a dashboard, public invoice view, and optional metadata/indexing, but the tree contains no implementation source, so repository paths are null and the graph reflects documented relationships only.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["PayLink app"]
  node_app_ui["Web app"]
  node_invoice["Invoice builder"]
  node_public_view["Public invoice"]
  node_dashboard["Dashboard"]
  node_receipt["Receipt page"]
end

subgraph group_escrow["Arc escrow"]
  node_contract["PayLinkEscrow"]
  node_usdc[("USDC token")]
end

subgraph group_offchain["Off-chain services"]
  node_indexer["Event indexer"]
  node_metadata[("Metadata store")]
end

node_freelancer(("Freelancer"))
node_client(("Client"))
node_arc_explorer["Arc explorer"]

node_freelancer -->|"creates terms"| node_invoice
node_invoice -->|"creates invoice"| node_app_ui
node_app_ui -->|"creates escrow"| node_contract
node_app_ui -->|"shares link"| node_public_view
node_client -->|"opens link"| node_public_view
node_client -->|"funds invoice"| node_contract
node_contract -->|"transfers funds"| node_usdc
node_freelancer -->|"submits milestone"| node_contract
node_client -->|"approves milestone"| node_contract
node_client -->|"raises dispute"| node_contract
node_freelancer -->|"claims timeout"| node_contract
node_contract -->|"releases payment"| node_freelancer
node_contract -->|"refunds cancellation"| node_client
node_contract -.->|"emits events"| node_indexer
node_indexer -.->|"updates metadata"| node_metadata
node_app_ui -.->|"reads metadata"| node_metadata
node_app_ui -->|"shows invoices"| node_dashboard
node_app_ui -->|"shows receipt"| node_receipt
node_receipt -->|"links transaction"| node_arc_explorer

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_ui,node_invoice,node_public_view,node_dashboard,node_receipt,node_client toneBlue
class node_contract,node_usdc toneAmber
class node_indexer,node_metadata toneMint
class node_freelancer,node_arc_explorer toneIndigo
```

## Components

### PayLink app

- **Web app**
- **Invoice builder**
- **Public invoice**
- **Dashboard**
- **Receipt page**

### Arc escrow

- **PayLinkEscrow**
- **USDC token**

### Off-chain services

- **Event indexer**
- **Metadata store**

### Other components

- **Freelancer**
- **Client**
- **Arc explorer**

## Connections

- Freelancer → Invoice builder: creates terms
- Invoice builder → Web app: creates invoice
- Web app → PayLinkEscrow: creates escrow
- Web app → Public invoice: shares link
- Client → Public invoice: opens link
- Client → PayLinkEscrow: funds invoice
- PayLinkEscrow → USDC token: transfers funds
- Freelancer → PayLinkEscrow: submits milestone
- Client → PayLinkEscrow: approves milestone
- Client → PayLinkEscrow: raises dispute
- Freelancer → PayLinkEscrow: claims timeout
- PayLinkEscrow → Freelancer: releases payment
- PayLinkEscrow → Client: refunds cancellation
- PayLinkEscrow → Event indexer: emits events
- Event indexer → Metadata store: updates metadata
- Web app → Metadata store: reads metadata
- Web app → Dashboard: shows invoices
- Web app → Receipt page: shows receipt
- Receipt page → Arc explorer: links transaction
