# zengs7991-a11y/today-money-printer architecture

> Architecture diagram of the GitHub repository zengs7991-a11y/today-money-printer, 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/zengs7991-a11y/today-money-printer
- Repository: https://github.com/zengs7991-a11y/today-money-printer

## Overview

今日印钞 is a native macOS menu-bar app that estimates and displays earnings accumulated today. The user configures pay, work hours, breaks, calendar rules, overtime, and a manual work state; the store computes live metrics that the menu-bar label and settings window present. The source is concentrated in two files, so the graph focuses on those runtime responsibilities. Holiday synchronization is documented and partially shown in WageStore; detailed parsing and data flow beyond the excerpt are not expanded.

Main entry points: [`Sources/WageStore.swift`](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift) (Wage store), [`Sources/WageBarApp.swift`](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift) (Menu and settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Menu-bar UI"]
  node_app["App entry<br/>[WageBarApp.swift]"]
  node_menu["Menu and settings<br/>[WageBarApp.swift]"]
  node_status["Status-bar display<br/>[WageBarApp.swift]"]
end

subgraph group_wage["Wage calculation"]
  node_store["Wage store<br/>[WageStore.swift]"]
  node_settings["Pay and schedule rules<br/>[WageStore.swift]"]
  node_earnings["Earnings metrics<br/>[WageStore.swift]"]
end

subgraph group_calendar["Calendar and persistence"]
  node_holiday["Holiday synchronization<br/>[WageStore.swift]"]
  node_defaults[("Local settings<br/>[WageStore.swift]")]
end

node_user(("User"))
node_official["Official holiday source"]

node_user -->|"configures"| node_menu
node_app -->|"creates"| node_store
node_app -->|"presents"| node_menu
node_app -->|"shows"| node_status
node_menu -->|"updates state"| node_store
node_menu -->|"displays"| node_earnings
node_store -->|"uses rules"| node_settings
node_store -->|"calculates"| node_earnings
node_store -->|"loads and saves"| node_defaults
node_store -->|"starts sync"| node_holiday
node_holiday -->|"fetches calendar"| node_official
node_status -->|"renders metrics"| node_earnings

click node_app "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift"
click node_menu "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift"
click node_status "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift"
click node_store "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift"
click node_settings "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift"
click node_earnings "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift"
click node_holiday "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift"
click node_defaults "https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift"

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_menu,node_status,node_user toneBlue
class node_store,node_settings,node_earnings toneAmber
class node_holiday,node_defaults toneMint
class node_official toneIndigo
```

## Components

### Menu-bar UI

- [App entry](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift): `Sources/WageBarApp.swift`
- [Menu and settings](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift): `Sources/WageBarApp.swift`
- [Status-bar display](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageBarApp.swift): `Sources/WageBarApp.swift`

### Wage calculation

- [Wage store](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift): `Sources/WageStore.swift`
- [Pay and schedule rules](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift): `Sources/WageStore.swift`
- [Earnings metrics](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift): `Sources/WageStore.swift`

### Calendar and persistence

- [Holiday synchronization](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift): `Sources/WageStore.swift`
- [Local settings](https://github.com/zengs7991-a11y/today-money-printer/blob/main/Sources/WageStore.swift): `Sources/WageStore.swift`

### Other components

- **User**
- **Official holiday source**

## Connections

- User → Menu and settings: configures (evidence: `Sources/WageBarApp.swift`)
- App entry → Wage store: creates (evidence: `Sources/WageBarApp.swift`)
- App entry → Menu and settings: presents (evidence: `Sources/WageBarApp.swift`)
- App entry → Status-bar display: shows (evidence: `Sources/WageBarApp.swift`)
- Menu and settings → Wage store: updates state (evidence: `Sources/WageBarApp.swift`)
- Menu and settings → Earnings metrics: displays (evidence: `Sources/WageBarApp.swift`)
- Wage store → Pay and schedule rules: uses rules (evidence: `Sources/WageStore.swift`)
- Wage store → Earnings metrics: calculates (evidence: `Sources/WageStore.swift`)
- Wage store → Local settings: loads and saves (evidence: `Sources/WageStore.swift`)
- Wage store → Holiday synchronization: starts sync (evidence: `Sources/WageStore.swift`)
- Holiday synchronization → Official holiday source: fetches calendar (evidence: `Sources/WageStore.swift`)
- Status-bar display → Earnings metrics: renders metrics (evidence: `Sources/WageBarApp.swift`)
