# eamre/spider-desk architecture

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

- Interactive diagram: https://gitdiagram.com/eamre/spider-desk
- Repository: https://github.com/eamre/spider-desk

## Overview

SpiderDesk is a Windows desktop companion centered on a continuously updated spider-and-web simulation, with a tray flyout for controls, Pomodoro sessions, reminders, and preferences. The main runtime path is application startup → overlay frame loop → simulation state → WPF rendering; feature controllers connect user actions to simulation messages, notifications, and persisted data. README descriptions establish several product behaviors, while some implementation details are unsampled, so those relationships are documented at subsystem level rather than inferred from names.

Main entry points: [`Domain/SimulationEngine.cs`](https://github.com/eamre/spider-desk/blob/main/Domain/SimulationEngine.cs) (Simulation engine), [`Rendering/SimulationCanvas.cs`](https://github.com/eamre/spider-desk/blob/main/Rendering/SimulationCanvas.cs) (Simulation canvas), [`App.xaml.cs`](https://github.com/eamre/spider-desk/blob/main/App.xaml.cs) (App startup), [`Infrastructure/Sessions/OverlaySessionController.cs`](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/OverlaySessionController.cs) (Overlay frame loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop runtime"]
  node_app["App startup<br/>[App.xaml.cs]"]
  node_overlay["Overlay frame loop"]
  node_canvas["Simulation canvas"]
  node_renderer["Spider and bug drawing"]
  node_webdraw["Web rendering"]
end

subgraph group_simulation["Simulation core"]
  node_engine["Simulation engine"]
  node_world["World state<br/>[WorldContext.cs]"]
end

subgraph group_ecology["Spider and web"]
  node_spider["Spider behavior<br/>[SpiderEntity.cs]"]
  node_gait["Leg gait"]
  node_web["Web simulation<br/>[SpiderWebEntity.cs]"]
  node_bugs["Bug simulation<br/>[BugEntity.cs]"]
  node_webphysics["Web water physics"]
  node_silk["Silk messages<br/>[SilkWriting.cs]"]
end

subgraph group_features["User features"]
  node_flyout["Settings flyout"]
  node_settings["Settings controller"]
  node_pomodoro["Pomodoro session"]
  node_pomodorotimer["Pomodoro timer<br/>[PomodoroTimer.cs]"]
  node_reminders["Reminder session"]
end

subgraph group_platform["Windows services"]
  node_tray["System tray<br/>[TrayMenuService.cs]"]
  node_settingsstore["Settings persistence<br/>[SettingsStore.cs]"]
  node_settingsfile[("Settings JSON")]
  node_reminderrepo[("Reminder repository")]
  node_startup["Startup registration"]
end

node_user(("Desktop user"))
node_windows["Windows desktop"]

node_user -->|"opens controls"| node_tray
node_tray -->|"opens flyout"| node_flyout
node_app -->|"creates"| node_engine
node_app -->|"creates"| node_canvas
node_app -->|"starts session"| node_overlay
node_overlay -->|"steps simulation"| node_engine
node_overlay -->|"refreshes layers"| node_canvas
node_engine -->|"updates state"| node_world
node_engine -->|"updates behavior"| node_spider
node_spider -->|"uses gait"| node_gait
node_engine -->|"updates bugs"| node_bugs
node_engine -->|"updates webs"| node_web
node_web -->|"updates droplets"| node_webphysics
node_canvas -->|"draws webs"| node_webdraw
node_canvas -.->|"renders actors"| node_renderer
node_flyout -.->|"raises settings"| node_settings
node_settings -->|"applies preferences"| node_engine
node_settings -->|"saves changes"| node_settingsstore
node_settingsstore -->|"loads and saves"| node_settingsfile
node_pomodoro -->|"ticks timer"| node_pomodorotimer
node_pomodoro -->|"requests silk text"| node_engine
node_engine -.->|"stores writing"| node_silk
node_reminders -->|"loads and saves"| node_reminderrepo
node_reminders -->|"requests note"| node_engine
node_canvas -.->|"shows overlay"| node_windows
node_app -->|"configures startup"| node_startup
node_startup -.->|"registers sign-in"| node_windows

click node_app "https://github.com/eamre/spider-desk/blob/main/App.xaml.cs"
click node_overlay "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/OverlaySessionController.cs"
click node_canvas "https://github.com/eamre/spider-desk/blob/main/Rendering/SimulationCanvas.cs"
click node_engine "https://github.com/eamre/spider-desk/blob/main/Domain/SimulationEngine.cs"
click node_world "https://github.com/eamre/spider-desk/blob/main/Domain/WorldContext.cs"
click node_spider "https://github.com/eamre/spider-desk/blob/main/Domain/Spider/SpiderEntity.cs"
click node_gait "https://github.com/eamre/spider-desk/blob/main/Domain/Spider/SpiderGaitController.cs"
click node_web "https://github.com/eamre/spider-desk/blob/main/Domain/Web/SpiderWebEntity.cs"
click node_bugs "https://github.com/eamre/spider-desk/blob/main/Domain/Insects/BugEntity.cs"
click node_webphysics "https://github.com/eamre/spider-desk/blob/main/Domain/Web/WebDropletController.cs"
click node_renderer "https://github.com/eamre/spider-desk/blob/main/Rendering/SimulationCanvas.cs"
click node_webdraw "https://github.com/eamre/spider-desk/blob/main/Rendering/Web/WebGeometryBuilder.cs"
click node_silk "https://github.com/eamre/spider-desk/blob/main/Domain/SilkText/SilkWriting.cs"
click node_tray "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Tray/TrayMenuService.cs"
click node_flyout "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Flyout/SettingsWindow.xaml.cs"
click node_settings "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/SettingsSessionController.cs"
click node_settingsstore "https://github.com/eamre/spider-desk/blob/main/Core/Settings/SettingsStore.cs"
click node_settingsfile "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Storage/JsonSettingsRepository.cs"
click node_pomodoro "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/PomodoroSessionController.cs"
click node_pomodorotimer "https://github.com/eamre/spider-desk/blob/main/Domain/Pomodoro/PomodoroTimer.cs"
click node_reminders "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/ReminderSessionController.cs"
click node_reminderrepo "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Storage/JsonReminderRepository.cs"
click node_startup "https://github.com/eamre/spider-desk/blob/main/Infrastructure/Platform/StartupRegistrationService.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_overlay,node_canvas,node_renderer,node_webdraw,node_user toneBlue
class node_engine,node_world toneAmber
class node_spider,node_gait,node_web,node_bugs,node_webphysics,node_silk toneMint
class node_flyout,node_settings,node_pomodoro,node_pomodorotimer,node_reminders toneRose
class node_tray,node_settingsstore,node_settingsfile,node_reminderrepo,node_startup,node_windows toneIndigo
```

## Components

### Desktop runtime

- [App startup](https://github.com/eamre/spider-desk/blob/main/App.xaml.cs): `App.xaml.cs`
- [Overlay frame loop](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/OverlaySessionController.cs): `Infrastructure/Sessions/OverlaySessionController.cs`
- [Simulation canvas](https://github.com/eamre/spider-desk/blob/main/Rendering/SimulationCanvas.cs): `Rendering/SimulationCanvas.cs`
- [Spider and bug drawing](https://github.com/eamre/spider-desk/blob/main/Rendering/SimulationCanvas.cs): `Rendering/SimulationCanvas.cs`
- [Web rendering](https://github.com/eamre/spider-desk/blob/main/Rendering/Web/WebGeometryBuilder.cs): `Rendering/Web/WebGeometryBuilder.cs`

### Simulation core

- [Simulation engine](https://github.com/eamre/spider-desk/blob/main/Domain/SimulationEngine.cs): `Domain/SimulationEngine.cs`
- [World state](https://github.com/eamre/spider-desk/blob/main/Domain/WorldContext.cs): `Domain/WorldContext.cs`

### Spider and web

- [Spider behavior](https://github.com/eamre/spider-desk/blob/main/Domain/Spider/SpiderEntity.cs): `Domain/Spider/SpiderEntity.cs`
- [Leg gait](https://github.com/eamre/spider-desk/blob/main/Domain/Spider/SpiderGaitController.cs): `Domain/Spider/SpiderGaitController.cs`
- [Web simulation](https://github.com/eamre/spider-desk/blob/main/Domain/Web/SpiderWebEntity.cs): `Domain/Web/SpiderWebEntity.cs`
- [Bug simulation](https://github.com/eamre/spider-desk/blob/main/Domain/Insects/BugEntity.cs): `Domain/Insects/BugEntity.cs`
- [Web water physics](https://github.com/eamre/spider-desk/blob/main/Domain/Web/WebDropletController.cs): `Domain/Web/WebDropletController.cs`
- [Silk messages](https://github.com/eamre/spider-desk/blob/main/Domain/SilkText/SilkWriting.cs): `Domain/SilkText/SilkWriting.cs`

### User features

- [Settings flyout](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Flyout/SettingsWindow.xaml.cs): `Infrastructure/Flyout/SettingsWindow.xaml.cs`
- [Settings controller](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/SettingsSessionController.cs): `Infrastructure/Sessions/SettingsSessionController.cs`
- [Pomodoro session](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/PomodoroSessionController.cs): `Infrastructure/Sessions/PomodoroSessionController.cs`
- [Pomodoro timer](https://github.com/eamre/spider-desk/blob/main/Domain/Pomodoro/PomodoroTimer.cs): `Domain/Pomodoro/PomodoroTimer.cs`
- [Reminder session](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Sessions/ReminderSessionController.cs): `Infrastructure/Sessions/ReminderSessionController.cs`

### Windows services

- [System tray](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Tray/TrayMenuService.cs): `Infrastructure/Tray/TrayMenuService.cs`
- [Settings persistence](https://github.com/eamre/spider-desk/blob/main/Core/Settings/SettingsStore.cs): `Core/Settings/SettingsStore.cs`
- [Settings JSON](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Storage/JsonSettingsRepository.cs): `Infrastructure/Storage/JsonSettingsRepository.cs`
- [Reminder repository](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Storage/JsonReminderRepository.cs): `Infrastructure/Storage/JsonReminderRepository.cs`
- [Startup registration](https://github.com/eamre/spider-desk/blob/main/Infrastructure/Platform/StartupRegistrationService.cs): `Infrastructure/Platform/StartupRegistrationService.cs`

### Other components

- **Desktop user**
- **Windows desktop**

## Connections

- Desktop user → System tray: opens controls
- System tray → Settings flyout: opens flyout (evidence: `Infrastructure/Tray/TrayMenuService.cs`)
- App startup → Simulation engine: creates (evidence: `App.xaml.cs`)
- App startup → Simulation canvas: creates (evidence: `App.xaml.cs`)
- App startup → Overlay frame loop: starts session (evidence: `App.xaml.cs`)
- Overlay frame loop → Simulation engine: steps simulation (evidence: `Infrastructure/Sessions/OverlaySessionController.cs`)
- Overlay frame loop → Simulation canvas: refreshes layers (evidence: `Infrastructure/Sessions/OverlaySessionController.cs`)
- Simulation engine → World state: updates state (evidence: `Domain/SimulationEngine.cs`)
- Simulation engine → Spider behavior: updates behavior (evidence: `Domain/SimulationEngine.cs`)
- Spider behavior → Leg gait: uses gait (evidence: `Domain/Spider/SpiderEntity.cs`)
- Simulation engine → Bug simulation: updates bugs (evidence: `Domain/SimulationEngine.cs`)
- Simulation engine → Web simulation: updates webs (evidence: `Domain/SimulationEngine.cs`)
- Web simulation → Web water physics: updates droplets (evidence: `Domain/Web/SpiderWebEntity.cs`)
- Simulation canvas → Web rendering: draws webs (evidence: `Rendering/Web/WebGeometryBuilder.cs`)
- Simulation canvas → Spider and bug drawing: renders actors (evidence: `Rendering/SimulationCanvas.cs`)
- Settings flyout → Settings controller: raises settings
- Settings controller → Simulation engine: applies preferences (evidence: `Infrastructure/Sessions/SettingsSessionController.cs`)
- Settings controller → Settings persistence: saves changes (evidence: `Infrastructure/Sessions/SettingsSessionController.cs`)
- Settings persistence → Settings JSON: loads and saves (evidence: `Core/Settings/SettingsStore.cs`)
- Pomodoro session → Pomodoro timer: ticks timer (evidence: `Infrastructure/Sessions/PomodoroSessionController.cs`)
- Pomodoro session → Simulation engine: requests silk text (evidence: `Infrastructure/Sessions/PomodoroSessionController.cs`)
- Simulation engine → Silk messages: stores writing
- Reminder session → Reminder repository: loads and saves (evidence: `Infrastructure/Sessions/ReminderSessionController.cs`)
- Reminder session → Simulation engine: requests note (evidence: `Infrastructure/Sessions/ReminderSessionController.cs`)
- Simulation canvas → Windows desktop: shows overlay
- App startup → Startup registration: configures startup (evidence: `App.xaml.cs`)
- Startup registration → Windows desktop: registers sign-in
