# stack-42/peeko architecture

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

- Interactive diagram: https://gitdiagram.com/stack-42/peeko
- Repository: https://github.com/stack-42/peeko

## Overview

Peeko is a local-first Mac and Windows task list that watches computer activity and automatically completes tasks when configured evidence matches. Users choose presets or add manual/custom tasks, Peeko samples activity and evaluates checks, then saves daily progress for Today and History. The graph covers the documented product branches and both platform implementations; source excerpts show key scheduler and persistence behavior, while some UI and verifier connections are supported only by README documentation.

Main entry points: [`Sources/PeekoApp/AppModel.swift`](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/AppModel.swift) (App coordinator), [`Sources/PeekoCore/Scheduler/Scheduler.swift`](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/Scheduler.swift) (Task scheduler), [`Sources/PeekoCore/Store/Store.swift`](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Store/Store.swift) (Mac JSON store), [`windows/src/Peeko.Core/Scheduler.cs`](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Scheduler.cs) (Windows scheduler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Task experience"]
  node_macui["Mac menu UI<br/>[RootView.swift]"]
  node_catalog["Task catalog"]
  node_today["Today &amp; settings<br/>[TodayView.swift]"]
  node_historyui["History view<br/>[HistoryView.swift]"]
  node_winui["Windows tray UI<br/>[PeekoView.cs]"]
end

subgraph group_maccore["Mac runtime"]
  node_appmodel["App coordinator<br/>[AppModel.swift]"]
  node_scheduler["Task scheduler<br/>[Scheduler.swift]"]
  node_activity["Activity tracking"]
  node_checks["Task verifiers"]
  node_breaks["Break reminders<br/>[BreakTracker.swift]"]
  node_history["History analysis<br/>[History.swift]"]
  node_notifier["Notifications<br/>[Notifier.swift]"]
end

subgraph group_windowscore["Windows runtime"]
  node_winruntime["Windows scheduler<br/>[Scheduler.cs]"]
  node_winactivity["Windows activity<br/>[ActivityTracker.cs]"]
  node_winchecks["Windows verifiers<br/>[Verifiers.cs]"]
  node_winonline["Online checks<br/>[OnlineChecks.cs]"]
  node_winhistory["Windows history<br/>[History.cs]"]
end

subgraph group_state["Local state"]
  node_macstore[("Mac JSON store<br/>[Store.swift]")]
  node_winstore[("Windows JSON store<br/>[Store.cs]")]
  node_taskmodel["Task definitions"]
  node_dayrecord["Daily records<br/>[DayRecord.swift]"]
  node_settings["App settings<br/>[AppSettings.swift]"]
end

node_person(("User"))
node_github["GitHub API"]
node_online["External check services"]

node_person -->|"opens"| node_macui
node_person -->|"opens"| node_winui
node_macui -.->|"interacts"| node_appmodel
node_catalog -->|"configures tasks"| node_appmodel
node_today -->|"reads progress"| node_appmodel
node_historyui -.->|"requests history"| node_appmodel
node_winui -->|"starts runtime"| node_winruntime
node_appmodel -->|"controls tasks"| node_scheduler
node_appmodel -->|"loads settings"| node_macstore
node_appmodel -->|"posts notices"| node_notifier
node_scheduler -->|"records samples"| node_activity
node_scheduler -->|"evaluates tasks"| node_checks
node_scheduler -->|"saves progress"| node_macstore
node_scheduler -->|"tracks breaks"| node_breaks
node_scheduler -->|"updates record"| node_dayrecord
node_history -->|"reads day files"| node_macstore
node_checks -.->|"checks public activity"| node_github
node_checks -.->|"queries services"| node_online
node_winruntime -->|"records samples"| node_winactivity
node_winruntime -->|"evaluates tasks"| node_winchecks
node_winruntime -->|"runs online checks"| node_winonline
node_winruntime -->|"saves progress"| node_winstore
node_winhistory -.->|"reads day files"| node_winstore
node_winonline -.->|"fetches public activity"| node_github
node_winonline -.->|"queries services"| node_online
node_macstore -->|"persists tasks"| node_taskmodel
node_macstore -->|"persists days"| node_dayrecord
node_macstore -->|"persists settings"| node_settings
node_winstore -.->|"persists settings"| node_settings

click node_macui "https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/RootView.swift"
click node_catalog "https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/CatalogGridView.swift"
click node_today "https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/TodayView.swift"
click node_historyui "https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/HistoryView.swift"
click node_winui "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Windows/PeekoView.cs"
click node_appmodel "https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/AppModel.swift"
click node_scheduler "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/Scheduler.swift"
click node_activity "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/ActivityTracker.swift"
click node_checks "https://github.com/stack-42/peeko/tree/main/Sources/PeekoCore/Verifiers"
click node_breaks "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/BreakTracker.swift"
click node_history "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/History/History.swift"
click node_notifier "https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Notifier.swift"
click node_winruntime "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Scheduler.cs"
click node_winactivity "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/ActivityTracker.cs"
click node_winchecks "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Verifiers.cs"
click node_winonline "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/OnlineChecks.cs"
click node_winhistory "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/History.cs"
click node_macstore "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Store/Store.swift"
click node_winstore "https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Store.cs"
click node_taskmodel "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Models/TaskDefinition.swift"
click node_dayrecord "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Models/DayRecord.swift"
click node_settings "https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Models/AppSettings.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_macui,node_catalog,node_today,node_historyui,node_winui,node_person toneBlue
class node_appmodel,node_scheduler,node_activity,node_checks,node_breaks,node_history,node_notifier toneAmber
class node_winruntime,node_winactivity,node_winchecks,node_winonline,node_winhistory,node_github toneMint
class node_macstore,node_winstore,node_taskmodel,node_dayrecord,node_settings toneRose
class node_online toneIndigo
```

## Components

### Task experience

- [Mac menu UI](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/RootView.swift): `Sources/PeekoApp/Views/RootView.swift`
- [Task catalog](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/CatalogGridView.swift): `Sources/PeekoApp/Views/CatalogGridView.swift`
- [Today & settings](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/TodayView.swift): `Sources/PeekoApp/Views/TodayView.swift`
- [History view](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Views/HistoryView.swift): `Sources/PeekoApp/Views/HistoryView.swift`
- [Windows tray UI](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Windows/PeekoView.cs): `windows/src/Peeko.Windows/PeekoView.cs`

### Mac runtime

- [App coordinator](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/AppModel.swift): `Sources/PeekoApp/AppModel.swift`
- [Task scheduler](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/Scheduler.swift): `Sources/PeekoCore/Scheduler/Scheduler.swift`
- [Activity tracking](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/ActivityTracker.swift): `Sources/PeekoCore/Scheduler/ActivityTracker.swift`
- [Task verifiers](https://github.com/stack-42/peeko/tree/main/Sources/PeekoCore/Verifiers): `Sources/PeekoCore/Verifiers`
- [Break reminders](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Scheduler/BreakTracker.swift): `Sources/PeekoCore/Scheduler/BreakTracker.swift`
- [History analysis](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/History/History.swift): `Sources/PeekoCore/History/History.swift`
- [Notifications](https://github.com/stack-42/peeko/blob/main/Sources/PeekoApp/Notifier.swift): `Sources/PeekoApp/Notifier.swift`

### Windows runtime

- [Windows scheduler](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Scheduler.cs): `windows/src/Peeko.Core/Scheduler.cs`
- [Windows activity](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/ActivityTracker.cs): `windows/src/Peeko.Core/ActivityTracker.cs`
- [Windows verifiers](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Verifiers.cs): `windows/src/Peeko.Core/Verifiers.cs`
- [Online checks](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/OnlineChecks.cs): `windows/src/Peeko.Core/OnlineChecks.cs`
- [Windows history](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/History.cs): `windows/src/Peeko.Core/History.cs`

### Local state

- [Mac JSON store](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Store/Store.swift): `Sources/PeekoCore/Store/Store.swift`
- [Windows JSON store](https://github.com/stack-42/peeko/blob/main/windows/src/Peeko.Core/Store.cs): `windows/src/Peeko.Core/Store.cs`
- [Task definitions](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Models/TaskDefinition.swift): `Sources/PeekoCore/Models/TaskDefinition.swift`
- [Daily records](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Models/DayRecord.swift): `Sources/PeekoCore/Models/DayRecord.swift`
- [App settings](https://github.com/stack-42/peeko/blob/main/Sources/PeekoCore/Models/AppSettings.swift): `Sources/PeekoCore/Models/AppSettings.swift`

### Other components

- **User**
- **GitHub API**
- **External check services**

## Connections

- User → Mac menu UI: opens
- User → Windows tray UI: opens
- Mac menu UI → App coordinator: interacts
- Task catalog → App coordinator: configures tasks (evidence: `Sources/PeekoApp/Views/CatalogGridView.swift`)
- Today & settings → App coordinator: reads progress (evidence: `Sources/PeekoApp/Views/TodayView.swift`)
- History view → App coordinator: requests history
- Windows tray UI → Windows scheduler: starts runtime (evidence: `windows/src/Peeko.Windows/Program.cs`)
- App coordinator → Task scheduler: controls tasks (evidence: `Sources/PeekoApp/AppModel.swift`)
- App coordinator → Mac JSON store: loads settings (evidence: `Sources/PeekoApp/AppModel.swift`)
- App coordinator → Notifications: posts notices (evidence: `Sources/PeekoApp/AppModel.swift`)
- Task scheduler → Activity tracking: records samples (evidence: `Sources/PeekoCore/Scheduler/Scheduler.swift`)
- Task scheduler → Task verifiers: evaluates tasks (evidence: `Sources/PeekoCore/Scheduler/Scheduler.swift`)
- Task scheduler → Mac JSON store: saves progress (evidence: `Sources/PeekoCore/Scheduler/Scheduler.swift`)
- Task scheduler → Break reminders: tracks breaks (evidence: `Sources/PeekoCore/Scheduler/Scheduler.swift`)
- Task scheduler → Daily records: updates record (evidence: `Sources/PeekoCore/Scheduler/Scheduler.swift`)
- History analysis → Mac JSON store: reads day files (evidence: `Sources/PeekoCore/History/History.swift`)
- Task verifiers → GitHub API: checks public activity
- Task verifiers → External check services: queries services
- Windows scheduler → Windows activity: records samples (evidence: `windows/src/Peeko.Core/Scheduler.cs`)
- Windows scheduler → Windows verifiers: evaluates tasks (evidence: `windows/src/Peeko.Core/Scheduler.cs`)
- Windows scheduler → Online checks: runs online checks (evidence: `windows/src/Peeko.Core/Scheduler.cs`)
- Windows scheduler → Windows JSON store: saves progress (evidence: `windows/src/Peeko.Core/Scheduler.cs`)
- Windows history → Windows JSON store: reads day files
- Online checks → GitHub API: fetches public activity
- Online checks → External check services: queries services
- Mac JSON store → Task definitions: persists tasks (evidence: `Sources/PeekoCore/Store/Store.swift`)
- Mac JSON store → Daily records: persists days (evidence: `Sources/PeekoCore/Store/Store.swift`)
- Mac JSON store → App settings: persists settings (evidence: `Sources/PeekoCore/Store/Store.swift`)
- Windows JSON store → App settings: persists settings
