# affanshz/noktah architecture

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

- Interactive diagram: https://gitdiagram.com/affanshz/noktah
- Repository: https://github.com/affanshz/noktah

## Overview

Noktah is a native Windows desktop notch: approaching the screen edge reveals a panel for music, tasks, focus, system status, agent approvals, and AI chat; moving away returns it to a compact pill. The graph follows the documented UI and integration capabilities, with application state, background synchronization, and platform adapters as internal layers. README statements support the user-facing flows and integrations; source-index references support selected internal links. Some feature implementations were not sampled, so their connections are shown only where documented.

Main entry points: [`native/app/src/presentation/shell/frame.rs`](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/shell/frame.rs) (Notch and viewport shell), [`native/app/src/app.rs`](https://github.com/affanshz/noktah/blob/main/native/app/src/app.rs) (Application state), [`native/app/src/presentation/shell/sync.rs`](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/shell/sync.rs) (Background synchronization), [`native/app/src/infrastructure/ipc.rs`](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/ipc.rs) (Agent and tile IPC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Notch interface"]
  node_notch_shell["Notch and viewport shell<br/>[frame.rs]"]
  node_page_views["Feature pages"]
  node_mini_pill["Minimized pill<br/>[mini.rs]"]
  node_mascot["Noki mascot<br/>[mascot.rs]"]
  node_settings_view["Settings viewport<br/>[settings.rs]"]
end

subgraph group_domain["Application and domain"]
  node_app_state["Application state<br/>[app.rs]"]
  node_sync["Background synchronization<br/>[sync.rs]"]
  node_core_settings["Settings model<br/>[settings.rs]"]
  node_core_calendar["Calendar parsing<br/>[calendar.rs]"]
  node_core_tiles["Status tile model<br/>[tile.rs]"]
end

subgraph group_adapters["System integrations"]
  node_music_adapter["SMTC music adapter<br/>[music.rs]"]
  node_lyrics_client["Lyrics lookup<br/>[lyrics_client.rs]"]
  node_ai_adapter["AI chat adapter<br/>[ai.rs]"]
  node_ipc["Agent and tile IPC<br/>[ipc.rs]"]
  node_os_controls["Tray and hotkey controls<br/>[os.rs]"]
  node_calendar_worker["Calendar file worker<br/>[calendar_worker.rs]"]
  node_bg_io["Background disk and OS I/O<br/>[bg_io.rs]"]
  node_hook_cli["noktah-hook CLI<br/>[main.rs]"]
end

subgraph group_persistence["Local data"]
  node_settings_store[("Local settings and cache<br/>[store.rs]")]
end

node_user(("Desktop user"))
node_windows["Windows platform"]
node_media_apps["Media apps"]
node_claude["Claude Code"]
node_ai_providers["AI providers"]
node_lyrics_service["Lyrics providers"]

node_user -->|"approaches edge"| node_notch_shell
node_user -->|"uses hotkey"| node_notch_shell
node_notch_shell -->|"minimizes to"| node_mini_pill
node_notch_shell -->|"shows pages"| node_page_views
node_mini_pill -->|"renders mascot"| node_mascot
node_user -->|"opens settings"| node_settings_view
node_settings_view -->|"configures"| node_core_settings
node_app_state -->|"drives lifecycle"| node_notch_shell
node_notch_shell -->|"polls workers"| node_sync
node_sync -->|"polls media"| node_music_adapter
node_music_adapter -->|"reads SMTC"| node_media_apps
node_sync -->|"requests lyrics"| node_lyrics_client
node_lyrics_client -->|"queries providers"| node_lyrics_service
node_sync -->|"dispatches chat"| node_ai_adapter
node_ai_adapter -->|"sends requests"| node_ai_providers
node_user -->|"submits commands"| node_hook_cli
node_hook_cli -->|"forwards events"| node_ipc
node_ipc -->|"delivers approvals"| node_app_state
node_ipc -->|"delivers tile data"| node_core_tiles
node_user -->|"uses tray controls"| node_os_controls
node_os_controls -->|"registers hotkey"| node_windows
node_calendar_worker -->|"parses calendar"| node_core_calendar
node_calendar_worker -->|"resolves data path"| node_settings_store
node_bg_io -->|"reads and writes"| node_settings_store
node_app_state -->|"queues persistence"| node_bg_io
node_app_state -.->|"holds configuration"| node_core_settings

click node_notch_shell "https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/shell/frame.rs"
click node_page_views "https://github.com/affanshz/noktah/tree/main/native/app/src/presentation/pages"
click node_mini_pill "https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/mini.rs"
click node_mascot "https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/mascot.rs"
click node_settings_view "https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/pages/settings.rs"
click node_app_state "https://github.com/affanshz/noktah/blob/main/native/app/src/app.rs"
click node_sync "https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/shell/sync.rs"
click node_core_settings "https://github.com/affanshz/noktah/blob/main/native/core/src/settings.rs"
click node_core_calendar "https://github.com/affanshz/noktah/blob/main/native/core/src/calendar.rs"
click node_core_tiles "https://github.com/affanshz/noktah/blob/main/native/core/src/tile.rs"
click node_music_adapter "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/music.rs"
click node_lyrics_client "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/lyrics_client.rs"
click node_ai_adapter "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/ai.rs"
click node_ipc "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/ipc.rs"
click node_os_controls "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/os.rs"
click node_calendar_worker "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/calendar_worker.rs"
click node_bg_io "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/bg_io.rs"
click node_settings_store "https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/store.rs"
click node_hook_cli "https://github.com/affanshz/noktah/blob/main/native/hook/src/main.rs"

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_notch_shell,node_page_views,node_mini_pill,node_mascot,node_settings_view,node_user toneBlue
class node_app_state,node_sync,node_core_settings,node_core_calendar,node_core_tiles toneAmber
class node_music_adapter,node_lyrics_client,node_ai_adapter,node_ipc,node_os_controls,node_calendar_worker,node_bg_io,node_hook_cli toneMint
class node_settings_store toneRose
class node_windows,node_media_apps,node_claude,node_ai_providers,node_lyrics_service toneIndigo
```

## Components

### Notch interface

- [Notch and viewport shell](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/shell/frame.rs): `native/app/src/presentation/shell/frame.rs`
- [Feature pages](https://github.com/affanshz/noktah/tree/main/native/app/src/presentation/pages): `native/app/src/presentation/pages`
- [Minimized pill](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/mini.rs): `native/app/src/presentation/mini.rs`
- [Noki mascot](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/mascot.rs): `native/app/src/presentation/mascot.rs`
- [Settings viewport](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/pages/settings.rs): `native/app/src/presentation/pages/settings.rs`

### Application and domain

- [Application state](https://github.com/affanshz/noktah/blob/main/native/app/src/app.rs): `native/app/src/app.rs`
- [Background synchronization](https://github.com/affanshz/noktah/blob/main/native/app/src/presentation/shell/sync.rs): `native/app/src/presentation/shell/sync.rs`
- [Settings model](https://github.com/affanshz/noktah/blob/main/native/core/src/settings.rs): `native/core/src/settings.rs`
- [Calendar parsing](https://github.com/affanshz/noktah/blob/main/native/core/src/calendar.rs): `native/core/src/calendar.rs`
- [Status tile model](https://github.com/affanshz/noktah/blob/main/native/core/src/tile.rs): `native/core/src/tile.rs`

### System integrations

- [SMTC music adapter](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/music.rs): `native/app/src/infrastructure/music.rs`
- [Lyrics lookup](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/lyrics_client.rs): `native/app/src/infrastructure/lyrics_client.rs`
- [AI chat adapter](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/ai.rs): `native/app/src/infrastructure/ai.rs`
- [Agent and tile IPC](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/ipc.rs): `native/app/src/infrastructure/ipc.rs`
- [Tray and hotkey controls](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/os.rs): `native/app/src/infrastructure/os.rs`
- [Calendar file worker](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/calendar_worker.rs): `native/app/src/infrastructure/calendar_worker.rs`
- [Background disk and OS I/O](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/bg_io.rs): `native/app/src/infrastructure/bg_io.rs`
- [noktah-hook CLI](https://github.com/affanshz/noktah/blob/main/native/hook/src/main.rs): `native/hook/src/main.rs`

### Local data

- [Local settings and cache](https://github.com/affanshz/noktah/blob/main/native/app/src/infrastructure/store.rs): `native/app/src/infrastructure/store.rs`

### Other components

- **Desktop user**
- **Windows platform**
- **Media apps**
- **Claude Code**
- **AI providers**
- **Lyrics providers**

## Connections

- Desktop user → Notch and viewport shell: approaches edge
- Desktop user → Notch and viewport shell: uses hotkey
- Notch and viewport shell → Minimized pill: minimizes to
- Notch and viewport shell → Feature pages: shows pages
- Minimized pill → Noki mascot: renders mascot (evidence: `native/app/src/presentation/mini.rs`)
- Desktop user → Settings viewport: opens settings
- Settings viewport → Settings model: configures (evidence: `native/app/src/presentation/pages/settings.rs`)
- Application state → Notch and viewport shell: drives lifecycle (evidence: `native/app/src/app.rs`)
- Notch and viewport shell → Background synchronization: polls workers (evidence: `native/app/src/presentation/shell/sync.rs`)
- Background synchronization → SMTC music adapter: polls media (evidence: `native/app/src/presentation/shell/sync.rs`)
- SMTC music adapter → Media apps: reads SMTC
- Background synchronization → Lyrics lookup: requests lyrics (evidence: `native/app/src/presentation/shell/sync.rs`)
- Lyrics lookup → Lyrics providers: queries providers (evidence: `native/app/src/infrastructure/lyrics_client.rs`)
- Background synchronization → AI chat adapter: dispatches chat (evidence: `native/app/src/presentation/shell/sync.rs`)
- AI chat adapter → AI providers: sends requests
- Desktop user → noktah-hook CLI: submits commands
- noktah-hook CLI → Agent and tile IPC: forwards events
- Agent and tile IPC → Application state: delivers approvals (evidence: `native/app/src/app.rs`)
- Agent and tile IPC → Status tile model: delivers tile data
- Desktop user → Tray and hotkey controls: uses tray controls
- Tray and hotkey controls → Windows platform: registers hotkey (evidence: `native/app/src/infrastructure/os.rs`)
- Calendar file worker → Calendar parsing: parses calendar (evidence: `native/app/src/infrastructure/calendar_worker.rs`)
- Calendar file worker → Local settings and cache: resolves data path (evidence: `native/app/src/infrastructure/calendar_worker.rs`)
- Background disk and OS I/O → Local settings and cache: reads and writes (evidence: `native/app/src/infrastructure/bg_io.rs`)
- Application state → Background disk and OS I/O: queues persistence (evidence: `native/app/src/app.rs`)
- Application state → Settings model: holds configuration
