# harishmelwani/salazy architecture

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

- Interactive diagram: https://gitdiagram.com/harishmelwani/salazy
- Repository: https://github.com/harishmelwani/salazy

## Overview

SalAZy is a browser-based private payroll application on Aztec. Employers configure businesses and employees, fund a payroll period, issue salary payments, and prove the period fully paid; employees can view their private salary notes and balance. The frontend coordinates wallet setup, payroll actions, and status views through its Aztec helpers and the Noir contract. Wallet backup/restore and sponsored fees are supporting capabilities. Contract internals are unsampled, so contract behavior is represented at its source path without inferred internal stages.

Main entry points: [`salazy_frontend/src/App.tsx`](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/App.tsx) (Payroll UI), [`salazy_frontend/src/salazy.ts`](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/salazy.ts) (Payroll client), [`salazy_frontend/src/wallet.ts`](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/wallet.ts) (Embedded wallet), [`salazy_frontend/src/fees.ts`](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/fees.ts) (Fee registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Payroll experience"]
  node_app["Payroll UI<br/>[App.tsx]"]
  node_entry["React entry<br/>[main.tsx]"]
end

subgraph group_client["Aztec client"]
  node_config["Network config<br/>[config.ts]"]
  node_wallet["Embedded wallet<br/>[wallet.ts]"]
  node_payroll_api["Payroll client<br/>[salazy.ts]"]
end

subgraph group_chain["On-chain payroll"]
  node_contract["Payroll contract<br/>[main.nr]"]
end

subgraph group_integrations["Wallet and fees"]
  node_fee_setup["Fee registration<br/>[fees.ts]"]
  node_wallet_store[("Browser persistence")]
end

node_employer(("Employer"))
node_employee(("Employee"))
node_aztec_node{{"Aztec node"}}
node_sponsored_fpc{{"Sponsored fee contract"}}

node_employer -->|"manages payroll"| node_app
node_employee -->|"views salary"| node_app
node_entry -->|"renders"| node_app
node_app -->|"opens wallet"| node_wallet
node_app -->|"registers fees"| node_fee_setup
node_app -->|"runs payroll"| node_payroll_api
node_app -->|"reads address"| node_config
node_wallet -->|"reads node URL"| node_config
node_payroll_api -->|"reads node settings"| node_config
node_wallet -->|"persists identity"| node_wallet_store
node_wallet -->|"connects"| node_aztec_node
node_payroll_api -->|"loads contract"| node_aztec_node
node_payroll_api -->|"simulates and sends"| node_contract
node_payroll_api -->|"creates fee payment"| node_fee_setup
node_fee_setup -->|"configures payment"| node_sponsored_fpc
node_fee_setup -->|"registers contracts"| node_wallet

click node_app "https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/App.tsx"
click node_entry "https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/main.tsx"
click node_config "https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/config.ts"
click node_wallet "https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/wallet.ts"
click node_payroll_api "https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/salazy.ts"
click node_contract "https://github.com/harishmelwani/salazy/blob/main/salazy_contract/src/main.nr"
click node_fee_setup "https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/fees.ts"

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_entry toneBlue
class node_config,node_wallet,node_payroll_api toneAmber
class node_contract toneMint
class node_fee_setup,node_wallet_store toneRose
class node_employer,node_employee,node_aztec_node,node_sponsored_fpc toneIndigo
```

## Components

### Payroll experience

- [Payroll UI](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/App.tsx): `salazy_frontend/src/App.tsx`
- [React entry](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/main.tsx): `salazy_frontend/src/main.tsx`

### Aztec client

- [Network config](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/config.ts): `salazy_frontend/src/config.ts`
- [Embedded wallet](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/wallet.ts): `salazy_frontend/src/wallet.ts`
- [Payroll client](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/salazy.ts): `salazy_frontend/src/salazy.ts`

### On-chain payroll

- [Payroll contract](https://github.com/harishmelwani/salazy/blob/main/salazy_contract/src/main.nr): `salazy_contract/src/main.nr`

### Wallet and fees

- [Fee registration](https://github.com/harishmelwani/salazy/blob/main/salazy_frontend/src/fees.ts): `salazy_frontend/src/fees.ts`
- **Browser persistence**

### Other components

- **Employer**
- **Employee**
- **Aztec node**
- **Sponsored fee contract**

## Connections

- Employer → Payroll UI: manages payroll (evidence: `salazy_frontend/src/App.tsx`)
- Employee → Payroll UI: views salary (evidence: `salazy_frontend/src/App.tsx`)
- React entry → Payroll UI: renders (evidence: `salazy_frontend/src/main.tsx`)
- Payroll UI → Embedded wallet: opens wallet (evidence: `salazy_frontend/src/App.tsx`)
- Payroll UI → Fee registration: registers fees (evidence: `salazy_frontend/src/App.tsx`)
- Payroll UI → Payroll client: runs payroll (evidence: `salazy_frontend/src/App.tsx`)
- Payroll UI → Network config: reads address (evidence: `salazy_frontend/src/App.tsx`)
- Embedded wallet → Network config: reads node URL (evidence: `salazy_frontend/src/wallet.ts`)
- Payroll client → Network config: reads node settings (evidence: `salazy_frontend/src/salazy.ts`)
- Embedded wallet → Browser persistence: persists identity (evidence: `salazy_frontend/src/wallet.ts`)
- Embedded wallet → Aztec node: connects (evidence: `salazy_frontend/src/wallet.ts`)
- Payroll client → Aztec node: loads contract (evidence: `salazy_frontend/src/salazy.ts`)
- Payroll client → Payroll contract: simulates and sends (evidence: `salazy_frontend/src/salazy.ts`)
- Payroll client → Fee registration: creates fee payment (evidence: `salazy_frontend/src/salazy.ts`)
- Fee registration → Sponsored fee contract: configures payment (evidence: `salazy_frontend/src/fees.ts`)
- Fee registration → Embedded wallet: registers contracts (evidence: `salazy_frontend/src/fees.ts`)
