# aeyundian/aydesktop architecture

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

- Interactive diagram: https://gitdiagram.com/aeyundian/aydesktop
- Repository: https://github.com/aeyundian/aydesktop

## Overview

AyDesktop is a WPF Windows desktop overlay for organizing and launching desktop items. The main workflow is startup and optional account restoration/login, opening the overlay with the floating control, loading and monitoring configured folders, then interacting with icons and folders; configuration and layout persist locally. The graph also preserves account security, Shell integration, and settings capabilities documented in the README. Some view and service implementations were not excerpted, so their documented capabilities are included without speculative call links.

Main entry points: [`AyDesktop/Views/FolderWindow.xaml.cs`](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/FolderWindow.xaml.cs) (Folder windows and groups), [`AyDesktop/App.xaml.cs`](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/App.xaml.cs) (Startup coordinator), [`AyDesktop/Views/DesktopWindow.xaml.cs`](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/DesktopWindow.xaml.cs) (Desktop overlay), [`AyDesktop/Views/SettingsWindow.xaml.cs`](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/SettingsWindow.xaml.cs) (Settings window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_app["Startup coordinator<br/>[App.xaml.cs]"]
  node_float["Floating control"]
end

subgraph group_desktop["Desktop and folders"]
  node_desktop_view["Desktop overlay"]
  node_viewmodel["Desktop state and layout"]
  node_item["Desktop item model<br/>[DesktopItem.cs]"]
  node_monitor["Folder monitor"]
  node_folder_view["Folder windows and groups"]
  node_item_host["Item host contract<br/>[IItemHost.cs]"]
  node_templates["Item templates"]
end

subgraph group_account["Account and security"]
  node_login["Login window"]
  node_auth["OAuth session manager<br/>[AuthService.cs]"]
  node_oauth_sdk["OAuth client"]
  node_network["Connectivity probe<br/>[NetworkProbe.cs]"]
  node_machine_key["Encrypted session store<br/>[MachineKeyStore.cs]"]
  node_hardware["Hardware fingerprint<br/>[HardwareId.cs]"]
end

subgraph group_settings["Configuration and system"]
  node_config[("Config and layout persistence<br/>[ConfigService.cs]")]
  node_app_config["Application preferences<br/>[AppConfig.cs]"]
  node_settings_view["Settings window"]
  node_shell_menu["Native Shell menus"]
  node_icons["Shell icon extraction<br/>[IconExtractor.cs]"]
  node_startup_helper["Startup registration<br/>[StartupHelper.cs]"]
  node_startup_command["Startup commands<br/>[StartupCommand.cs]"]
end

node_user(("User"))
node_shell{{"Windows Shell"}}

node_user -->|"starts"| node_app
node_app -->|"restores session"| node_auth
node_app -->|"opens login"| node_login
node_app -->|"shows control"| node_float
node_user -->|"toggles overlay"| node_float
node_float -.->|"opens overlay"| node_desktop_view
node_desktop_view -->|"loads and monitors"| node_viewmodel
node_viewmodel -->|"loads and saves"| node_config
node_viewmodel -->|"starts monitoring"| node_monitor
node_viewmodel -->|"manages items"| node_item
node_desktop_view -->|"moves and groups"| node_item
node_folder_view -->|"uses desktop state"| node_viewmodel
node_folder_view -->|"displays children"| node_item
node_folder_view -->|"implements host"| node_item_host
node_templates -->|"uses host contract"| node_item_host
node_login -->|"authenticates"| node_auth
node_login -->|"checks connectivity"| node_network
node_auth -->|"exchanges tokens"| node_oauth_sdk
node_auth -->|"stores session"| node_machine_key
node_machine_key -->|"derives key from"| node_hardware
node_config -->|"serializes"| node_app_config
node_settings_view -->|"updates settings"| node_config
node_settings_view -->|"edits preferences"| node_app_config
node_desktop_view -->|"opens context menu"| node_shell_menu
node_folder_view -->|"opens context menu"| node_shell_menu
node_desktop_view -->|"requests icons"| node_icons
node_folder_view -->|"requests icons"| node_icons
node_shell_menu -->|"invokes native menus"| node_shell
node_icons -->|"extracts icons"| node_shell
node_settings_view -->|"configures startup"| node_startup_helper
node_settings_view -->|"encodes actions"| node_startup_command
node_app -->|"handles commands"| node_startup_command
node_user -->|"changes preferences"| node_settings_view

click node_app "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/App.xaml.cs"
click node_float "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/FloatWindow.xaml.cs"
click node_desktop_view "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/DesktopWindow.xaml.cs"
click node_viewmodel "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/ViewModels/DesktopViewModel.cs"
click node_item "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Models/DesktopItem.cs"
click node_monitor "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/DesktopMonitorService.cs"
click node_folder_view "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/FolderWindow.xaml.cs"
click node_item_host "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/IItemHost.cs"
click node_templates "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/DesktopItemTemplates.xaml.cs"
click node_login "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/LoginWindow.xaml.cs"
click node_auth "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/AuthService.cs"
click node_oauth_sdk "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/AyOAuthClientSDK.cs"
click node_network "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/NetworkProbe.cs"
click node_machine_key "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/MachineKeyStore.cs"
click node_hardware "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/HardwareId.cs"
click node_config "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/ConfigService.cs"
click node_app_config "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Models/AppConfig.cs"
click node_settings_view "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/SettingsWindow.xaml.cs"
click node_shell_menu "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/ShellContextMenu.cs"
click node_icons "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/IconExtractor.cs"
click node_startup_helper "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/StartupHelper.cs"
click node_startup_command "https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/StartupCommand.cs"

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_float,node_user toneBlue
class node_desktop_view,node_viewmodel,node_item,node_monitor,node_folder_view,node_item_host,node_templates toneAmber
class node_login,node_auth,node_oauth_sdk,node_network,node_machine_key,node_hardware toneMint
class node_config,node_app_config,node_settings_view,node_shell_menu,node_icons,node_startup_helper,node_startup_command toneRose
class node_shell toneIndigo
```

## Components

### Application runtime

- [Startup coordinator](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/App.xaml.cs): `AyDesktop/App.xaml.cs`
- [Floating control](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/FloatWindow.xaml.cs): `AyDesktop/Views/FloatWindow.xaml.cs`

### Desktop and folders

- [Desktop overlay](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/DesktopWindow.xaml.cs): `AyDesktop/Views/DesktopWindow.xaml.cs`
- [Desktop state and layout](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/ViewModels/DesktopViewModel.cs): `AyDesktop/ViewModels/DesktopViewModel.cs`
- [Desktop item model](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Models/DesktopItem.cs): `AyDesktop/Models/DesktopItem.cs`
- [Folder monitor](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/DesktopMonitorService.cs): `AyDesktop/Services/DesktopMonitorService.cs`
- [Folder windows and groups](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/FolderWindow.xaml.cs): `AyDesktop/Views/FolderWindow.xaml.cs`
- [Item host contract](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/IItemHost.cs): `AyDesktop/Views/IItemHost.cs`
- [Item templates](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/DesktopItemTemplates.xaml.cs): `AyDesktop/Views/DesktopItemTemplates.xaml.cs`

### Account and security

- [Login window](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/LoginWindow.xaml.cs): `AyDesktop/Views/LoginWindow.xaml.cs`
- [OAuth session manager](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/AuthService.cs): `AyDesktop/Services/AuthService.cs`
- [OAuth client](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/AyOAuthClientSDK.cs): `AyDesktop/Services/AyOAuthClientSDK.cs`
- [Connectivity probe](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/NetworkProbe.cs): `AyDesktop/Services/NetworkProbe.cs`
- [Encrypted session store](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/MachineKeyStore.cs): `AyDesktop/Services/MachineKeyStore.cs`
- [Hardware fingerprint](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/HardwareId.cs): `AyDesktop/Services/HardwareId.cs`

### Configuration and system

- [Config and layout persistence](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/ConfigService.cs): `AyDesktop/Services/ConfigService.cs`
- [Application preferences](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Models/AppConfig.cs): `AyDesktop/Models/AppConfig.cs`
- [Settings window](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Views/SettingsWindow.xaml.cs): `AyDesktop/Views/SettingsWindow.xaml.cs`
- [Native Shell menus](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/ShellContextMenu.cs): `AyDesktop/Services/ShellContextMenu.cs`
- [Shell icon extraction](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/IconExtractor.cs): `AyDesktop/Services/IconExtractor.cs`
- [Startup registration](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/StartupHelper.cs): `AyDesktop/Services/StartupHelper.cs`
- [Startup commands](https://github.com/aeyundian/aydesktop/blob/main/AyDesktop/Services/StartupCommand.cs): `AyDesktop/Services/StartupCommand.cs`

### Other components

- **User**
- **Windows Shell**

## Connections

- User → Startup coordinator: starts (evidence: `README.md`)
- Startup coordinator → OAuth session manager: restores session (evidence: `AyDesktop/App.xaml.cs`)
- Startup coordinator → Login window: opens login (evidence: `AyDesktop/App.xaml.cs`)
- Startup coordinator → Floating control: shows control (evidence: `AyDesktop/App.xaml.cs`)
- User → Floating control: toggles overlay (evidence: `README.md`)
- Floating control → Desktop overlay: opens overlay (evidence: `README.md`)
- Desktop overlay → Desktop state and layout: loads and monitors (evidence: `AyDesktop/Views/DesktopWindow.xaml.cs`)
- Desktop state and layout → Config and layout persistence: loads and saves (evidence: `AyDesktop/ViewModels/DesktopViewModel.cs`)
- Desktop state and layout → Folder monitor: starts monitoring (evidence: `AyDesktop/ViewModels/DesktopViewModel.cs`)
- Desktop state and layout → Desktop item model: manages items (evidence: `AyDesktop/ViewModels/DesktopViewModel.cs`)
- Desktop overlay → Desktop item model: moves and groups (evidence: `AyDesktop/Views/DesktopWindow.xaml.cs`)
- Folder windows and groups → Desktop state and layout: uses desktop state (evidence: `AyDesktop/Views/FolderWindow.xaml.cs`)
- Folder windows and groups → Desktop item model: displays children (evidence: `AyDesktop/Views/FolderWindow.xaml.cs`)
- Folder windows and groups → Item host contract: implements host (evidence: `AyDesktop/Views/FolderWindow.xaml.cs`)
- Item templates → Item host contract: uses host contract (evidence: `AyDesktop/Views/DesktopItemTemplates.xaml.cs`)
- Login window → OAuth session manager: authenticates (evidence: `AyDesktop/Views/LoginWindow.xaml.cs`)
- Login window → Connectivity probe: checks connectivity (evidence: `AyDesktop/Views/LoginWindow.xaml.cs`)
- OAuth session manager → OAuth client: exchanges tokens (evidence: `AyDesktop/Services/AuthService.cs`)
- OAuth session manager → Encrypted session store: stores session (evidence: `AyDesktop/Services/AuthService.cs`)
- Encrypted session store → Hardware fingerprint: derives key from (evidence: `AyDesktop/Services/MachineKeyStore.cs`)
- Config and layout persistence → Application preferences: serializes (evidence: `AyDesktop/Services/ConfigService.cs`)
- Settings window → Config and layout persistence: updates settings (evidence: `AyDesktop/Views/SettingsWindow.xaml.cs`)
- Settings window → Application preferences: edits preferences (evidence: `AyDesktop/Views/SettingsWindow.xaml.cs`)
- Desktop overlay → Native Shell menus: opens context menu (evidence: `AyDesktop/Views/DesktopWindow.xaml.cs`)
- Folder windows and groups → Native Shell menus: opens context menu (evidence: `AyDesktop/Views/FolderWindow.xaml.cs`)
- Desktop overlay → Shell icon extraction: requests icons (evidence: `AyDesktop/Views/DesktopWindow.xaml.cs`)
- Folder windows and groups → Shell icon extraction: requests icons (evidence: `AyDesktop/Views/FolderWindow.xaml.cs`)
- Native Shell menus → Windows Shell: invokes native menus (evidence: `README.md`)
- Shell icon extraction → Windows Shell: extracts icons (evidence: `AyDesktop/Services/IconExtractor.cs`)
- Settings window → Startup registration: configures startup (evidence: `AyDesktop/Views/SettingsWindow.xaml.cs`)
- Settings window → Startup commands: encodes actions (evidence: `AyDesktop/Views/SettingsWindow.xaml.cs`)
- Startup coordinator → Startup commands: handles commands (evidence: `AyDesktop/App.xaml.cs`)
- User → Settings window: changes preferences (evidence: `README.md`)
