# bhauw/daily-planner architecture

> Architecture diagram of the GitHub repository bhauw/daily-planner, 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/bhauw/daily-planner
- Repository: https://github.com/bhauw/daily-planner

## Overview

Daily Planner is a privacy-conscious macOS day planner with a local web interface. The main workflow loads calendar, task, and mail data through a loopback API, presents planning and triage workspaces, and sends explicitly approved actions through capability-gated integrations. Its domain stages include calendar-role filtering and schedule previews, mail-body review and reply drafting, and task placement. The graph also shows Google authorization, encrypted settings, and the local assistant boundary. Some subsystem links reflect README-documented capabilities; unsampled wiring is left out.

Main entry points: [`DailyPlanner/Sources/DailyPlannerAPI/PlannerAPIService.swift`](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerAPI/PlannerAPIService.swift) (Planner API service), [`web/src/app.tsx`](https://github.com/bhauw/daily-planner/blob/main/web/src/app.tsx) (Web interface), [`DailyPlanner/Sources/DailyPlannerGoogle/GoogleReadOnlyConnectionController.swift`](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerGoogle/GoogleReadOnlyConnectionController.swift) (Read-only connection controller), [`DailyPlanner/Sources/DailyPlannerAPI/LocalAPIServer.swift`](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerAPI/LocalAPIServer.swift) (Loopback API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Planner interface"]
  node_web["Web interface<br/>[app.tsx]"]
  node_workspaces["Planner workspaces"]
  node_api_client["Typed API client<br/>[client.ts]"]
end

subgraph group_engine["Local planning engine"]
  node_app_entry["Native app host<br/>[main.swift]"]
  node_api_server["Loopback API server"]
  node_api_service["Planner API service"]
end

subgraph group_domain["Planning workflows"]
  node_planning_preview["Planning preview"]
  node_priority["Priority ordering"]
  node_calendar_roles["Calendar roles"]
  node_mail_triage["Mail triage"]
  node_mail_body["Mail body review"]
  node_google_connection["Google connection"]
end

subgraph group_integrations["Provider integrations"]
  node_google_controller["Read-only connection controller"]
  node_google_sources["Google data sources"]
  node_reply_writer["Local reply writer"]
end

subgraph group_state["Private state"]
  node_settings[("Private settings")]
  node_encrypted_store[("Encrypted settings store")]
end

node_user(("Planner user"))
node_google_services{{"Google services"}}
node_assistant{{"Configured assistant"}}
node_keychain[("macOS Keychain")]

node_user -->|"uses"| node_web
node_web -->|"renders"| node_workspaces
node_web -->|"requests data"| node_api_client
node_api_client -->|"calls loopback"| node_api_server
node_app_entry -->|"hosts"| node_api_server
node_api_server -->|"dispatches routes"| node_api_service
node_api_service -->|"requests preview"| node_planning_preview
node_planning_preview -->|"orders events"| node_priority
node_api_service -->|"reads roles"| node_calendar_roles
node_api_service -->|"triages mail"| node_mail_triage
node_api_service -->|"sanitizes body"| node_mail_body
node_api_service -->|"reads provider data"| node_google_sources
node_google_sources -->|"requests data"| node_google_services
node_user -->|"connects account"| node_google_connection
node_google_connection -->|"starts authorization"| node_google_controller
node_google_controller -->|"checks read access"| node_google_services
node_google_controller -->|"checks credentials"| node_keychain
node_api_service -->|"requests draft"| node_reply_writer
node_reply_writer -.->|"generates locally"| node_assistant
node_api_service -->|"reads settings"| node_settings
node_settings -->|"persists privately"| node_encrypted_store

click node_web "https://github.com/bhauw/daily-planner/blob/main/web/src/app.tsx"
click node_workspaces "https://github.com/bhauw/daily-planner/tree/main/web/src/workspaces"
click node_api_client "https://github.com/bhauw/daily-planner/blob/main/web/src/api/client.ts"
click node_app_entry "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApp/main.swift"
click node_api_server "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerAPI/LocalAPIServer.swift"
click node_api_service "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerAPI/PlannerAPIService.swift"
click node_planning_preview "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/PlanningPreviewWorkflow.swift"
click node_priority "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerDomain/PriorityEngine.swift"
click node_calendar_roles "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/CalendarRoleWorkflow.swift"
click node_mail_triage "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerDomain/MailTriagePolicy.swift"
click node_mail_body "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/EmailBodySanitizer.swift"
click node_google_connection "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/GoogleConnectionWorkflow.swift"
click node_google_controller "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerGoogle/GoogleReadOnlyConnectionController.swift"
click node_google_sources "https://github.com/bhauw/daily-planner/tree/main/DailyPlanner/Sources/DailyPlannerGoogle"
click node_reply_writer "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerPlatform/ClaudeCodeReplyWriter.swift"
click node_settings "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerDomain/PrivateSettingsStore.swift"
click node_encrypted_store "https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerPersistence/EncryptedPrivateSettingsStore.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_web,node_workspaces,node_api_client,node_user toneBlue
class node_app_entry,node_api_server,node_api_service,node_keychain toneAmber
class node_planning_preview,node_priority,node_calendar_roles,node_mail_triage,node_mail_body,node_google_connection toneMint
class node_google_controller,node_google_sources,node_reply_writer toneRose
class node_settings,node_encrypted_store,node_google_services,node_assistant toneIndigo
```

## Components

### Planner interface

- [Web interface](https://github.com/bhauw/daily-planner/blob/main/web/src/app.tsx): `web/src/app.tsx`
- [Planner workspaces](https://github.com/bhauw/daily-planner/tree/main/web/src/workspaces): `web/src/workspaces`
- [Typed API client](https://github.com/bhauw/daily-planner/blob/main/web/src/api/client.ts): `web/src/api/client.ts`

### Local planning engine

- [Native app host](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApp/main.swift): `DailyPlanner/Sources/DailyPlannerApp/main.swift`
- [Loopback API server](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerAPI/LocalAPIServer.swift): `DailyPlanner/Sources/DailyPlannerAPI/LocalAPIServer.swift`
- [Planner API service](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerAPI/PlannerAPIService.swift): `DailyPlanner/Sources/DailyPlannerAPI/PlannerAPIService.swift`

### Planning workflows

- [Planning preview](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/PlanningPreviewWorkflow.swift): `DailyPlanner/Sources/DailyPlannerApplication/PlanningPreviewWorkflow.swift`
- [Priority ordering](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerDomain/PriorityEngine.swift): `DailyPlanner/Sources/DailyPlannerDomain/PriorityEngine.swift`
- [Calendar roles](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/CalendarRoleWorkflow.swift): `DailyPlanner/Sources/DailyPlannerApplication/CalendarRoleWorkflow.swift`
- [Mail triage](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerDomain/MailTriagePolicy.swift): `DailyPlanner/Sources/DailyPlannerDomain/MailTriagePolicy.swift`
- [Mail body review](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/EmailBodySanitizer.swift): `DailyPlanner/Sources/DailyPlannerApplication/EmailBodySanitizer.swift`
- [Google connection](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerApplication/GoogleConnectionWorkflow.swift): `DailyPlanner/Sources/DailyPlannerApplication/GoogleConnectionWorkflow.swift`

### Provider integrations

- [Read-only connection controller](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerGoogle/GoogleReadOnlyConnectionController.swift): `DailyPlanner/Sources/DailyPlannerGoogle/GoogleReadOnlyConnectionController.swift`
- [Google data sources](https://github.com/bhauw/daily-planner/tree/main/DailyPlanner/Sources/DailyPlannerGoogle): `DailyPlanner/Sources/DailyPlannerGoogle`
- [Local reply writer](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerPlatform/ClaudeCodeReplyWriter.swift): `DailyPlanner/Sources/DailyPlannerPlatform/ClaudeCodeReplyWriter.swift`

### Private state

- [Private settings](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerDomain/PrivateSettingsStore.swift): `DailyPlanner/Sources/DailyPlannerDomain/PrivateSettingsStore.swift`
- [Encrypted settings store](https://github.com/bhauw/daily-planner/blob/main/DailyPlanner/Sources/DailyPlannerPersistence/EncryptedPrivateSettingsStore.swift): `DailyPlanner/Sources/DailyPlannerPersistence/EncryptedPrivateSettingsStore.swift`

### Other components

- **Planner user**
- **Google services**
- **Configured assistant**
- **macOS Keychain**

## Connections

- Planner user → Web interface: uses
- Web interface → Planner workspaces: renders
- Web interface → Typed API client: requests data
- Typed API client → Loopback API server: calls loopback
- Native app host → Loopback API server: hosts
- Loopback API server → Planner API service: dispatches routes
- Planner API service → Planning preview: requests preview
- Planning preview → Priority ordering: orders events
- Planner API service → Calendar roles: reads roles
- Planner API service → Mail triage: triages mail
- Planner API service → Mail body review: sanitizes body
- Planner API service → Google data sources: reads provider data
- Google data sources → Google services: requests data
- Planner user → Google connection: connects account
- Google connection → Read-only connection controller: starts authorization
- Read-only connection controller → Google services: checks read access
- Read-only connection controller → macOS Keychain: checks credentials
- Planner API service → Local reply writer: requests draft
- Local reply writer → Configured assistant: generates locally
- Planner API service → Private settings: reads settings
- Private settings → Encrypted settings store: persists privately
