# ahuryx/arc architecture

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

- Interactive diagram: https://gitdiagram.com/ahuryx/arc
- Repository: https://github.com/ahuryx/arc

## Overview

Arc is a cross-platform desktop widget app. Users launch it, control visibility and workspace preferences from the system tray or settings window, and view six independent widgets; settings and widget state are persisted and shared across windows. The map covers the host, workspace, settings, widget, and live-data layers. Some feed providers and native-host internals are unsampled, so their detailed runtime connections are omitted.

Main entry points: [`src/core/useAppState.ts`](https://github.com/ahuryx/arc/blob/main/src/core/useAppState.ts) (App state hook), [`src/core/widgetRegistry.ts`](https://github.com/ahuryx/arc/blob/main/src/core/widgetRegistry.ts) (Widget registry), [`src/settings/settings-app.tsx`](https://github.com/ahuryx/arc/blob/main/src/settings/settings-app.tsx) (Settings window), [`src/core/workspaceHost.ts`](https://github.com/ahuryx/arc/blob/main/src/core/workspaceHost.ts) (Workspace actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Desktop host"]
  node_desktop["Tauri host<br/>[lib.rs]"]
  node_bootstrap["Bootstrap<br/>[bootstrap.ts]"]
  node_tray["Tray controls<br/>[trayController.ts]"]
  node_app["Widget entry<br/>[App.tsx]"]
  node_shell["Widget shell<br/>[widget-shell.tsx]"]
end

subgraph group_workspace["Workspace core"]
  node_hostapi["Workspace actions<br/>[workspaceHost.ts]"]
  node_manager["Window manager<br/>[widgetManager.ts]"]
  node_catalog["Widget catalog<br/>[widgetCatalog.ts]"]
  node_registry["Widget registry<br/>[widgetRegistry.ts]"]
  node_lifecycle["Widget lifecycle"]
  node_store[("Settings store<br/>[settingsStore.ts]")]
  node_state["App state hook<br/>[useAppState.ts]"]
  node_theme["Theme<br/>[theme.ts]"]
end

subgraph group_settings["Settings"]
  node_settingsapp["Settings window<br/>[settings-app.tsx]"]
  node_cryptosettings["Crypto preferences"]
  node_settingsnav["Settings navigation<br/>[settingsNav.ts]"]
end

subgraph group_widgets["Widgets"]
  node_clock["Clock<br/>[clock-widget.tsx]"]
  node_calendar["Calendar"]
  node_crypto["Crypto widget<br/>[crypto-widget.tsx]"]
  node_weather["Weather widget<br/>[weather-widget.tsx]"]
  node_notes["Notes<br/>[notes-widget.tsx]"]
  node_pomodoro["Pomodoro"]
  node_dates["Calendar dates<br/>[dates.ts]"]
end

subgraph group_feeds["Live data"]
  node_cryptofeed["Crypto feeds<br/>[cryptoFeed.ts]"]
  node_weatherfeed["Weather feed<br/>[weatherFeed.ts]"]
  node_livehook["Live-feed hook<br/>[use-live-feed.ts]"]
  node_livecore["Live-feed core<br/>[liveFeed.ts]"]
end

node_user(("User"))

node_user -->|"controls"| node_tray
node_user -->|"configures"| node_settingsapp
node_bootstrap -->|"initializes"| node_tray
node_tray -->|"dispatches actions"| node_hostapi
node_hostapi -->|"delegates windows"| node_manager
node_hostapi -->|"updates settings"| node_store
node_manager -->|"reads and persists"| node_store
node_manager -->|"reads metadata"| node_catalog
node_app -->|"starts lifecycle"| node_lifecycle
node_app -->|"selects widget"| node_registry
node_app -->|"renders"| node_shell
node_registry -->|"registers"| node_clock
node_registry -->|"registers"| node_calendar
node_registry -->|"registers"| node_crypto
node_registry -->|"registers"| node_weather
node_registry -->|"registers"| node_notes
node_registry -->|"registers"| node_pomodoro
node_lifecycle -->|"coordinates windows"| node_manager
node_settingsapp -->|"reads state"| node_state
node_settingsapp -->|"changes preferences"| node_hostapi
node_settingsapp -->|"parses tabs"| node_settingsnav
node_settingsapp -->|"renders crypto settings"| node_cryptosettings
node_cryptosettings -->|"saves watchlist"| node_hostapi
node_state -->|"loads settings"| node_store
node_state -->|"applies theme"| node_theme
node_clock -->|"reads preferences"| node_state
node_calendar -->|"reads preferences"| node_state
node_calendar -->|"formats dates"| node_dates
node_crypto -->|"reads preferences"| node_state
node_crypto -->|"subscribes"| node_livehook
node_crypto -->|"requests prices"| node_cryptofeed
node_weather -->|"reads preferences"| node_state
node_weather -->|"subscribes"| node_livehook
node_weather -->|"requests conditions"| node_weatherfeed
node_livehook -->|"uses feed core"| node_livecore
node_weatherfeed -->|"uses feed core"| node_livecore
node_notes -->|"reads preferences"| node_state
node_pomodoro -->|"reads preferences"| node_state
node_desktop -.->|"hosts frontend"| node_bootstrap

click node_desktop "https://github.com/ahuryx/arc/blob/main/src-tauri/src/lib.rs"
click node_bootstrap "https://github.com/ahuryx/arc/blob/main/src/bootstrap.ts"
click node_tray "https://github.com/ahuryx/arc/blob/main/src/core/trayController.ts"
click node_app "https://github.com/ahuryx/arc/blob/main/src/App.tsx"
click node_shell "https://github.com/ahuryx/arc/blob/main/src/shell/widget-shell.tsx"
click node_hostapi "https://github.com/ahuryx/arc/blob/main/src/core/workspaceHost.ts"
click node_manager "https://github.com/ahuryx/arc/blob/main/src/core/widgetManager.ts"
click node_catalog "https://github.com/ahuryx/arc/blob/main/src/core/widgetCatalog.ts"
click node_registry "https://github.com/ahuryx/arc/blob/main/src/core/widgetRegistry.ts"
click node_lifecycle "https://github.com/ahuryx/arc/blob/main/src/core/useWidgetLifecycle.ts"
click node_store "https://github.com/ahuryx/arc/blob/main/src/core/settingsStore.ts"
click node_state "https://github.com/ahuryx/arc/blob/main/src/core/useAppState.ts"
click node_theme "https://github.com/ahuryx/arc/blob/main/src/core/theme.ts"
click node_settingsapp "https://github.com/ahuryx/arc/blob/main/src/settings/settings-app.tsx"
click node_cryptosettings "https://github.com/ahuryx/arc/blob/main/src/components/settings/crypto-settings-panel.tsx"
click node_settingsnav "https://github.com/ahuryx/arc/blob/main/src/core/settingsNav.ts"
click node_clock "https://github.com/ahuryx/arc/blob/main/src/widgets/clock/clock-widget.tsx"
click node_calendar "https://github.com/ahuryx/arc/blob/main/src/widgets/calendar/calendar-widget.tsx"
click node_crypto "https://github.com/ahuryx/arc/blob/main/src/widgets/crypto/crypto-widget.tsx"
click node_weather "https://github.com/ahuryx/arc/blob/main/src/widgets/weather/weather-widget.tsx"
click node_notes "https://github.com/ahuryx/arc/blob/main/src/widgets/notes/notes-widget.tsx"
click node_pomodoro "https://github.com/ahuryx/arc/blob/main/src/widgets/pomodoro/pomodoro-widget.tsx"
click node_cryptofeed "https://github.com/ahuryx/arc/blob/main/src/feeds/crypto/cryptoFeed.ts"
click node_weatherfeed "https://github.com/ahuryx/arc/blob/main/src/feeds/weatherFeed.ts"
click node_livehook "https://github.com/ahuryx/arc/blob/main/src/hooks/use-live-feed.ts"
click node_livecore "https://github.com/ahuryx/arc/blob/main/src/core/liveFeed.ts"
click node_dates "https://github.com/ahuryx/arc/blob/main/src/lib/dates.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_desktop,node_bootstrap,node_tray,node_app,node_shell,node_user toneBlue
class node_hostapi,node_manager,node_catalog,node_registry,node_lifecycle,node_store,node_state,node_theme toneAmber
class node_settingsapp,node_cryptosettings,node_settingsnav toneMint
class node_clock,node_calendar,node_crypto,node_weather,node_notes,node_pomodoro,node_dates toneRose
class node_cryptofeed,node_weatherfeed,node_livehook,node_livecore toneIndigo
```

## Components

### Desktop host

- [Tauri host](https://github.com/ahuryx/arc/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Bootstrap](https://github.com/ahuryx/arc/blob/main/src/bootstrap.ts): `src/bootstrap.ts`
- [Tray controls](https://github.com/ahuryx/arc/blob/main/src/core/trayController.ts): `src/core/trayController.ts`
- [Widget entry](https://github.com/ahuryx/arc/blob/main/src/App.tsx): `src/App.tsx`
- [Widget shell](https://github.com/ahuryx/arc/blob/main/src/shell/widget-shell.tsx): `src/shell/widget-shell.tsx`

### Workspace core

- [Workspace actions](https://github.com/ahuryx/arc/blob/main/src/core/workspaceHost.ts): `src/core/workspaceHost.ts`
- [Window manager](https://github.com/ahuryx/arc/blob/main/src/core/widgetManager.ts): `src/core/widgetManager.ts`
- [Widget catalog](https://github.com/ahuryx/arc/blob/main/src/core/widgetCatalog.ts): `src/core/widgetCatalog.ts`
- [Widget registry](https://github.com/ahuryx/arc/blob/main/src/core/widgetRegistry.ts): `src/core/widgetRegistry.ts`
- [Widget lifecycle](https://github.com/ahuryx/arc/blob/main/src/core/useWidgetLifecycle.ts): `src/core/useWidgetLifecycle.ts`
- [Settings store](https://github.com/ahuryx/arc/blob/main/src/core/settingsStore.ts): `src/core/settingsStore.ts`
- [App state hook](https://github.com/ahuryx/arc/blob/main/src/core/useAppState.ts): `src/core/useAppState.ts`
- [Theme](https://github.com/ahuryx/arc/blob/main/src/core/theme.ts): `src/core/theme.ts`

### Settings

- [Settings window](https://github.com/ahuryx/arc/blob/main/src/settings/settings-app.tsx): `src/settings/settings-app.tsx`
- [Crypto preferences](https://github.com/ahuryx/arc/blob/main/src/components/settings/crypto-settings-panel.tsx): `src/components/settings/crypto-settings-panel.tsx`
- [Settings navigation](https://github.com/ahuryx/arc/blob/main/src/core/settingsNav.ts): `src/core/settingsNav.ts`

### Widgets

- [Clock](https://github.com/ahuryx/arc/blob/main/src/widgets/clock/clock-widget.tsx): `src/widgets/clock/clock-widget.tsx`
- [Calendar](https://github.com/ahuryx/arc/blob/main/src/widgets/calendar/calendar-widget.tsx): `src/widgets/calendar/calendar-widget.tsx`
- [Crypto widget](https://github.com/ahuryx/arc/blob/main/src/widgets/crypto/crypto-widget.tsx): `src/widgets/crypto/crypto-widget.tsx`
- [Weather widget](https://github.com/ahuryx/arc/blob/main/src/widgets/weather/weather-widget.tsx): `src/widgets/weather/weather-widget.tsx`
- [Notes](https://github.com/ahuryx/arc/blob/main/src/widgets/notes/notes-widget.tsx): `src/widgets/notes/notes-widget.tsx`
- [Pomodoro](https://github.com/ahuryx/arc/blob/main/src/widgets/pomodoro/pomodoro-widget.tsx): `src/widgets/pomodoro/pomodoro-widget.tsx`
- [Calendar dates](https://github.com/ahuryx/arc/blob/main/src/lib/dates.ts): `src/lib/dates.ts`

### Live data

- [Crypto feeds](https://github.com/ahuryx/arc/blob/main/src/feeds/crypto/cryptoFeed.ts): `src/feeds/crypto/cryptoFeed.ts`
- [Weather feed](https://github.com/ahuryx/arc/blob/main/src/feeds/weatherFeed.ts): `src/feeds/weatherFeed.ts`
- [Live-feed hook](https://github.com/ahuryx/arc/blob/main/src/hooks/use-live-feed.ts): `src/hooks/use-live-feed.ts`
- [Live-feed core](https://github.com/ahuryx/arc/blob/main/src/core/liveFeed.ts): `src/core/liveFeed.ts`

### Other components

- **User**

## Connections

- User → Tray controls: controls (evidence: `README.md`)
- User → Settings window: configures (evidence: `README.md`)
- Bootstrap → Tray controls: initializes (evidence: `src/bootstrap.ts`)
- Tray controls → Workspace actions: dispatches actions (evidence: `src/core/trayController.ts`)
- Workspace actions → Window manager: delegates windows (evidence: `src/core/workspaceHost.ts`)
- Workspace actions → Settings store: updates settings (evidence: `src/core/workspaceHost.ts`)
- Window manager → Settings store: reads and persists (evidence: `src/core/widgetManager.ts`)
- Window manager → Widget catalog: reads metadata (evidence: `src/core/widgetManager.ts`)
- Widget entry → Widget lifecycle: starts lifecycle (evidence: `src/App.tsx`)
- Widget entry → Widget registry: selects widget (evidence: `src/App.tsx`)
- Widget entry → Widget shell: renders (evidence: `src/App.tsx`)
- Widget registry → Clock: registers (evidence: `src/core/widgetRegistry.ts`)
- Widget registry → Calendar: registers (evidence: `src/core/widgetRegistry.ts`)
- Widget registry → Crypto widget: registers (evidence: `src/core/widgetRegistry.ts`)
- Widget registry → Weather widget: registers (evidence: `src/core/widgetRegistry.ts`)
- Widget registry → Notes: registers (evidence: `src/core/widgetRegistry.ts`)
- Widget registry → Pomodoro: registers (evidence: `src/core/widgetRegistry.ts`)
- Widget lifecycle → Window manager: coordinates windows (evidence: `src/core/useWidgetLifecycle.ts`)
- Settings window → App state hook: reads state (evidence: `src/settings/settings-app.tsx`)
- Settings window → Workspace actions: changes preferences (evidence: `src/settings/settings-app.tsx`)
- Settings window → Settings navigation: parses tabs (evidence: `src/settings/settings-app.tsx`)
- Settings window → Crypto preferences: renders crypto settings (evidence: `src/settings/settings-app.tsx`)
- Crypto preferences → Workspace actions: saves watchlist (evidence: `src/components/settings/crypto-settings-panel.tsx`)
- App state hook → Settings store: loads settings (evidence: `src/core/useAppState.ts`)
- App state hook → Theme: applies theme (evidence: `src/core/useAppState.ts`)
- Clock → App state hook: reads preferences
- Calendar → App state hook: reads preferences (evidence: `src/widgets/calendar/calendar-widget.tsx`)
- Calendar → Calendar dates: formats dates (evidence: `src/widgets/calendar/calendar-widget.tsx`)
- Crypto widget → App state hook: reads preferences (evidence: `src/widgets/crypto/crypto-widget.tsx`)
- Crypto widget → Live-feed hook: subscribes (evidence: `src/widgets/crypto/crypto-widget.tsx`)
- Crypto widget → Crypto feeds: requests prices (evidence: `src/widgets/crypto/crypto-widget.tsx`)
- Weather widget → App state hook: reads preferences (evidence: `src/widgets/weather/weather-widget.tsx`)
- Weather widget → Live-feed hook: subscribes (evidence: `src/widgets/weather/weather-widget.tsx`)
- Weather widget → Weather feed: requests conditions (evidence: `src/widgets/weather/weather-widget.tsx`)
- Live-feed hook → Live-feed core: uses feed core (evidence: `src/hooks/use-live-feed.ts`)
- Weather feed → Live-feed core: uses feed core (evidence: `src/feeds/weatherFeed.ts`)
- Notes → App state hook: reads preferences (evidence: `src/widgets/notes/notes-widget.tsx`)
- Pomodoro → App state hook: reads preferences (evidence: `src/widgets/pomodoro/pomodoro-widget.tsx`)
- Tauri host → Bootstrap: hosts frontend (evidence: `README.md`)
