# hsc-logic/payslipgenerator architecture

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

- Interactive diagram: https://gitdiagram.com/hsc-logic/payslipgenerator
- Repository: https://github.com/hsc-logic/payslipgenerator

## Overview

Sliply is a browser-based payment-slip workspace: users enter company, recipient, and payment details, review a live slip, then save, print, download, or optionally create a Google Doc. The app also supports searchable history, reusable recipients, settings, privacy controls, and browser-local recovery. Its shared view and calculation layer feeds both the preview and document outputs. Edges reflect shown imports, calls, or README statements; unsampled wiring is not inferred.

Main entry points: [`src/App.tsx`](https://github.com/hsc-logic/payslipgenerator/blob/main/src/App.tsx) (App coordinator), [`src/utils/paymentSlipView.ts`](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/paymentSlipView.ts) (Slip view model), [`src/services/googleDrive.ts`](https://github.com/hsc-logic/payslipgenerator/blob/main/src/services/googleDrive.ts) (Google Docs integration), [`src/utils/currency.ts`](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/currency.ts) (Currency calculations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Slip Workflow"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_stepper["Workflow steps"]
  node_form["Slip form<br/>[SlipForm.tsx]"]
  node_field["Form fields<br/>[Field.tsx]"]
  node_review["Review panel<br/>[ReviewPanel.tsx]"]
  node_preview["Live preview"]
end

subgraph group_records["Records and Preferences"]
  node_history["Payment history<br/>[PaymentHistory.tsx]"]
  node_settings["Settings panel<br/>[SettingsPanel.tsx]"]
  node_privacy["Privacy controls"]
  node_storage[("Browser persistence<br/>[storage.ts]")]
  node_recovery["Recovery state<br/>[recovery.ts]"]
  node_reference["Reference sequence<br/>[reference.ts]"]
end

subgraph group_documents["Document Outputs"]
  node_pdf["PDF and printing<br/>[pdf.ts]"]
  node_drive["Google Docs integration<br/>[googleDrive.ts]"]
end

subgraph group_logic["Shared Logic"]
  node_view["Slip view model<br/>[paymentSlipView.ts]"]
  node_currency["Currency calculations<br/>[currency.ts]"]
  node_words["Amount in words<br/>[amountInWords.ts]"]
  node_validation["Field validation<br/>[validation.ts]"]
end

node_user(("Slip creator"))
node_google[("Google Drive and Docs")]

node_user -->|"creates slip"| node_app
node_app -->|"shows steps"| node_stepper
node_app -->|"renders form"| node_form
node_form -->|"uses fields"| node_field
node_app -->|"renders review"| node_review
node_app -->|"renders preview"| node_preview
node_review -->|"builds summary"| node_view
node_preview -->|"builds preview"| node_view
node_app -->|"renders history"| node_history
node_app -->|"renders settings"| node_settings
node_app -->|"renders controls"| node_privacy
node_app -->|"loads and saves"| node_storage
node_app -->|"persists recovery"| node_recovery
node_app -->|"reserves reference"| node_reference
node_app -->|"validates slip"| node_validation
node_view -->|"calculates totals"| node_currency
node_view -->|"converts total"| node_words
node_app -->|"exports and prints"| node_pdf
node_pdf -->|"builds document view"| node_view
node_app -.->|"creates Google Doc"| node_drive
node_drive -->|"sends document content"| node_google
node_drive -->|"calculates totals"| node_currency
node_drive -->|"converts total"| node_words
node_history -->|"calculates totals"| node_currency

click node_app "https://github.com/hsc-logic/payslipgenerator/blob/main/src/App.tsx"
click node_stepper "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/common/WorkflowStepper.tsx"
click node_form "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/forms/SlipForm.tsx"
click node_field "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/common/Field.tsx"
click node_review "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/forms/ReviewPanel.tsx"
click node_preview "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/preview/PaymentSlipPreview.tsx"
click node_history "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/history/PaymentHistory.tsx"
click node_settings "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/settings/SettingsPanel.tsx"
click node_privacy "https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/privacy/PrivacyControls.tsx"
click node_storage "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/storage.ts"
click node_recovery "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/recovery.ts"
click node_reference "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/reference.ts"
click node_view "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/paymentSlipView.ts"
click node_currency "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/currency.ts"
click node_words "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/amountInWords.ts"
click node_validation "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/validation.ts"
click node_pdf "https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/pdf.ts"
click node_drive "https://github.com/hsc-logic/payslipgenerator/blob/main/src/services/googleDrive.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_stepper,node_form,node_field,node_review,node_preview toneBlue
class node_history,node_settings,node_privacy,node_storage,node_recovery,node_reference,node_google toneAmber
class node_pdf,node_drive toneMint
class node_view,node_currency,node_words,node_validation toneRose
class node_user toneIndigo
```

## Components

### Slip Workflow

- [App coordinator](https://github.com/hsc-logic/payslipgenerator/blob/main/src/App.tsx): `src/App.tsx`
- [Workflow steps](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/common/WorkflowStepper.tsx): `src/components/common/WorkflowStepper.tsx`
- [Slip form](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/forms/SlipForm.tsx): `src/components/forms/SlipForm.tsx`
- [Form fields](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/common/Field.tsx): `src/components/common/Field.tsx`
- [Review panel](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/forms/ReviewPanel.tsx): `src/components/forms/ReviewPanel.tsx`
- [Live preview](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/preview/PaymentSlipPreview.tsx): `src/components/preview/PaymentSlipPreview.tsx`

### Records and Preferences

- [Payment history](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/history/PaymentHistory.tsx): `src/components/history/PaymentHistory.tsx`
- [Settings panel](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/settings/SettingsPanel.tsx): `src/components/settings/SettingsPanel.tsx`
- [Privacy controls](https://github.com/hsc-logic/payslipgenerator/blob/main/src/components/privacy/PrivacyControls.tsx): `src/components/privacy/PrivacyControls.tsx`
- [Browser persistence](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/storage.ts): `src/utils/storage.ts`
- [Recovery state](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/recovery.ts): `src/utils/recovery.ts`
- [Reference sequence](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/reference.ts): `src/utils/reference.ts`

### Document Outputs

- [PDF and printing](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/pdf.ts): `src/utils/pdf.ts`
- [Google Docs integration](https://github.com/hsc-logic/payslipgenerator/blob/main/src/services/googleDrive.ts): `src/services/googleDrive.ts`

### Shared Logic

- [Slip view model](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/paymentSlipView.ts): `src/utils/paymentSlipView.ts`
- [Currency calculations](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/currency.ts): `src/utils/currency.ts`
- [Amount in words](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/amountInWords.ts): `src/utils/amountInWords.ts`
- [Field validation](https://github.com/hsc-logic/payslipgenerator/blob/main/src/utils/validation.ts): `src/utils/validation.ts`

### Other components

- **Slip creator**
- **Google Drive and Docs**

## Connections

- Slip creator → App coordinator: creates slip (evidence: `README.md`)
- App coordinator → Workflow steps: shows steps (evidence: `src/App.tsx`)
- App coordinator → Slip form: renders form (evidence: `src/App.tsx`)
- Slip form → Form fields: uses fields (evidence: `src/components/forms/SlipForm.tsx`)
- App coordinator → Review panel: renders review (evidence: `src/App.tsx`)
- App coordinator → Live preview: renders preview (evidence: `src/App.tsx`)
- Review panel → Slip view model: builds summary (evidence: `src/components/forms/ReviewPanel.tsx`)
- Live preview → Slip view model: builds preview (evidence: `src/components/preview/PaymentSlipPreview.tsx`)
- App coordinator → Payment history: renders history (evidence: `src/App.tsx`)
- App coordinator → Settings panel: renders settings (evidence: `src/App.tsx`)
- App coordinator → Privacy controls: renders controls (evidence: `src/App.tsx`)
- App coordinator → Browser persistence: loads and saves (evidence: `src/App.tsx`)
- App coordinator → Recovery state: persists recovery (evidence: `src/App.tsx`)
- App coordinator → Reference sequence: reserves reference (evidence: `src/App.tsx`)
- App coordinator → Field validation: validates slip (evidence: `src/App.tsx`)
- Slip view model → Currency calculations: calculates totals (evidence: `src/utils/paymentSlipView.ts`)
- Slip view model → Amount in words: converts total (evidence: `src/utils/paymentSlipView.ts`)
- App coordinator → PDF and printing: exports and prints (evidence: `README.md`)
- PDF and printing → Slip view model: builds document view (evidence: `src/utils/pdf.ts`)
- App coordinator → Google Docs integration: creates Google Doc (evidence: `README.md`)
- Google Docs integration → Google Drive and Docs: sends document content (evidence: `README.md`)
- Google Docs integration → Currency calculations: calculates totals (evidence: `src/services/googleDrive.ts`)
- Google Docs integration → Amount in words: converts total (evidence: `src/services/googleDrive.ts`)
- Payment history → Currency calculations: calculates totals (evidence: `src/components/history/PaymentHistory.tsx`)
