# n4hkro/dobby architecture

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

## Overview

Dobby is a Windows desktop host for authenticated, plugin-based business workflows. The main user journey is startup and login, followed by session establishment and presentation of the shell, where users navigate plugin pages and manage ongoing work sessions; plugin installation, licensing, administration, and settings support that experience. The architecture separates host orchestration, plugin runtime, security/licensing, and persistence. The README is empty, so product capabilities are inferred from the supplied source tree; edges are limited to relationships shown by excerpts or SOURCE INDEX references.

Main entry points: [`src/Dobby.PluginFramework/Activation/PluginServiceRegistrationBridge.cs`](https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Activation/PluginServiceRegistrationBridge.cs) (Plugin activation), [`src/Dobby.Shell/ShellViewModel.cs`](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/ShellViewModel.cs) (Shell view model), [`src/Dobby.Host/App.xaml.cs`](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/App.xaml.cs) (Host startup), [`src/Dobby.Licensing/LicenseImportService.cs`](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Licensing/LicenseImportService.cs) (License import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host and shell"]
  node_startup["Host startup<br/>[App.xaml.cs]"]
  node_login["Login runtime"]
  node_loginui["Login and recovery UI<br/>[Login]"]
  node_shell["Shell view model<br/>[ShellViewModel.cs]"]
  node_navigation["Navigation registry<br/>[RouteRegistry.cs]"]
  node_work["Work sessions"]
  node_close["Session close flow"]
  node_settings["Host settings<br/>[Settings]"]
  node_printing["Print output"]
  node_admin["Admin command host"]
end

subgraph group_plugins["Plugin runtime"]
  node_pluginpackages["Plugin packages"]
  node_activation["Plugin activation"]
  node_lifecycle["Plugin lifetime"]
  node_pluginstorage["Plugin storage"]
  node_pluginpages["Plugin pages"]
end

subgraph group_security["Identity and licensing"]
  node_auth["Authentication<br/>[LoginService.cs]"]
  node_sessions["Session lifecycle"]
  node_users["Managed users"]
  node_authorization["Operation authorization"]
  node_licenseimport["License import"]
  node_context["Deployment context"]
end

subgraph group_platform["Persistence and services"]
  node_audit["Audit trail"]
  node_persistence["Host persistence"]
  node_commandexecutor["Persistence commands"]
  node_database[("SQLite database")]
  node_diagnostics["Diagnostics export"]
end

node_user(("Desktop user"))
node_printdevice(("Print device"))

node_user -->|"starts app"| node_startup
node_startup -->|"prepares login"| node_login
node_startup -->|"shows login"| node_loginui
node_user -.->|"authenticates"| node_loginui
node_loginui -.->|"submits credentials"| node_auth
node_login -.->|"prepares session"| node_sessions
node_startup -->|"presents shell"| node_shell
node_user -.->|"uses shell"| node_shell
node_shell -.->|"resolves routes"| node_navigation
node_shell -.->|"tracks work"| node_work
node_close -->|"closes sessions"| node_work
node_shell -.->|"requests closure"| node_close
node_user -.->|"installs plugins"| node_pluginpackages
node_pluginpackages -.->|"activates plugins"| node_activation
node_activation -.->|"tracks disposables"| node_lifecycle
node_activation -->|"provides policy"| node_authorization
node_activation -.->|"registers pages"| node_pluginpages
node_activation -.->|"provides storage"| node_pluginstorage
node_pluginstorage -->|"executes commands"| node_commandexecutor
node_commandexecutor -.->|"uses database"| node_database
node_user -.->|"imports license"| node_licenseimport
node_licenseimport -->|"validates binding"| node_context
node_licenseimport -.->|"updates runtime mode"| node_authorization
node_users -->|"checks permissions"| node_authorization
node_sessions -.->|"records changes"| node_audit
node_persistence -->|"maintains store"| node_database
node_user -.->|"changes preferences"| node_settings
node_user -.->|"runs commands"| node_admin
node_user -.->|"requests printing"| node_printing
node_printing -.->|"sends output"| node_printdevice
node_user -.->|"exports diagnostics"| node_diagnostics

click node_startup "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/App.xaml.cs"
click node_login "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/Login/HostLoginRuntime.cs"
click node_loginui "https://github.com/n4hkro/dobby/tree/main/src/Dobby.Host/Login"
click node_shell "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/ShellViewModel.cs"
click node_navigation "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Navigation/RouteRegistry.cs"
click node_work "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/WorkSessions/WorkSessionRegistry.cs"
click node_close "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/WorkSessions/WorkSessionCloseCoordinator.cs"
click node_settings "https://github.com/n4hkro/dobby/tree/main/src/Dobby.Host/Settings"
click node_printing "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/Printing/HostPrintOutputService.cs"
click node_pluginpackages "https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Packaging/PluginPackageInstaller.cs"
click node_activation "https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Activation/PluginServiceRegistrationBridge.cs"
click node_lifecycle "https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Activation/PluginLifetimeManager.cs"
click node_pluginstorage "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/Plugins/HostPluginStorage.cs"
click node_pluginpages "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/PluginPages/PluginPageRenderRegistry.cs"
click node_auth "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authentication/LoginService.cs"
click node_sessions "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authentication/SessionLifecycleService.cs"
click node_users "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authentication/ManagedUserService.cs"
click node_authorization "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authorization/OperationAuthorizationPolicy.cs"
click node_licenseimport "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Licensing/LicenseImportService.cs"
click node_context "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/CurrentContext/CurrentCustomerDeploymentContextService.cs"
click node_audit "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Audit/Persistence/DurableAuditTrail.cs"
click node_persistence "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Infrastructure/Persistence/HostPersistenceMaintenanceService.cs"
click node_commandexecutor "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Infrastructure/Persistence/IHostPersistenceCommandExecutor.cs"
click node_database "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Infrastructure/Persistence/EncryptedSqliteConnectionFactory.cs"
click node_diagnostics "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Diagnostics/DiagnosticsExportPackageBuilder.cs"
click node_admin "https://github.com/n4hkro/dobby/blob/main/src/Dobby.Admin/Commands/AdminCommandHost.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_startup,node_login,node_loginui,node_shell,node_navigation,node_work,node_close,node_settings,node_printing,node_admin,node_user toneBlue
class node_pluginpackages,node_activation,node_lifecycle,node_pluginstorage,node_pluginpages toneAmber
class node_auth,node_sessions,node_users,node_authorization,node_licenseimport,node_context toneMint
class node_audit,node_persistence,node_commandexecutor,node_database,node_diagnostics toneRose
class node_printdevice toneIndigo
```

## Components

### Host and shell

- [Host startup](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/App.xaml.cs): `src/Dobby.Host/App.xaml.cs`
- [Login runtime](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/Login/HostLoginRuntime.cs): `src/Dobby.Host/Login/HostLoginRuntime.cs`
- [Login and recovery UI](https://github.com/n4hkro/dobby/tree/main/src/Dobby.Host/Login): `src/Dobby.Host/Login`
- [Shell view model](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/ShellViewModel.cs): `src/Dobby.Shell/ShellViewModel.cs`
- [Navigation registry](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Navigation/RouteRegistry.cs): `src/Dobby.Navigation/RouteRegistry.cs`
- [Work sessions](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/WorkSessions/WorkSessionRegistry.cs): `src/Dobby.Shell/WorkSessions/WorkSessionRegistry.cs`
- [Session close flow](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/WorkSessions/WorkSessionCloseCoordinator.cs): `src/Dobby.Shell/WorkSessions/WorkSessionCloseCoordinator.cs`
- [Host settings](https://github.com/n4hkro/dobby/tree/main/src/Dobby.Host/Settings): `src/Dobby.Host/Settings`
- [Print output](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/Printing/HostPrintOutputService.cs): `src/Dobby.Host/Printing/HostPrintOutputService.cs`
- [Admin command host](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Admin/Commands/AdminCommandHost.cs): `src/Dobby.Admin/Commands/AdminCommandHost.cs`

### Plugin runtime

- [Plugin packages](https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Packaging/PluginPackageInstaller.cs): `src/Dobby.PluginFramework/Packaging/PluginPackageInstaller.cs`
- [Plugin activation](https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Activation/PluginServiceRegistrationBridge.cs): `src/Dobby.PluginFramework/Activation/PluginServiceRegistrationBridge.cs`
- [Plugin lifetime](https://github.com/n4hkro/dobby/blob/main/src/Dobby.PluginFramework/Activation/PluginLifetimeManager.cs): `src/Dobby.PluginFramework/Activation/PluginLifetimeManager.cs`
- [Plugin storage](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Host/Plugins/HostPluginStorage.cs): `src/Dobby.Host/Plugins/HostPluginStorage.cs`
- [Plugin pages](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Shell/PluginPages/PluginPageRenderRegistry.cs): `src/Dobby.Shell/PluginPages/PluginPageRenderRegistry.cs`

### Identity and licensing

- [Authentication](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authentication/LoginService.cs): `src/Dobby.Security/Authentication/LoginService.cs`
- [Session lifecycle](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authentication/SessionLifecycleService.cs): `src/Dobby.Security/Authentication/SessionLifecycleService.cs`
- [Managed users](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authentication/ManagedUserService.cs): `src/Dobby.Security/Authentication/ManagedUserService.cs`
- [Operation authorization](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/Authorization/OperationAuthorizationPolicy.cs): `src/Dobby.Security/Authorization/OperationAuthorizationPolicy.cs`
- [License import](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Licensing/LicenseImportService.cs): `src/Dobby.Licensing/LicenseImportService.cs`
- [Deployment context](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Security/CurrentContext/CurrentCustomerDeploymentContextService.cs): `src/Dobby.Security/CurrentContext/CurrentCustomerDeploymentContextService.cs`

### Persistence and services

- [Audit trail](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Audit/Persistence/DurableAuditTrail.cs): `src/Dobby.Audit/Persistence/DurableAuditTrail.cs`
- [Host persistence](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Infrastructure/Persistence/HostPersistenceMaintenanceService.cs): `src/Dobby.Infrastructure/Persistence/HostPersistenceMaintenanceService.cs`
- [Persistence commands](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Infrastructure/Persistence/IHostPersistenceCommandExecutor.cs): `src/Dobby.Infrastructure/Persistence/IHostPersistenceCommandExecutor.cs`
- [SQLite database](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Infrastructure/Persistence/EncryptedSqliteConnectionFactory.cs): `src/Dobby.Infrastructure/Persistence/EncryptedSqliteConnectionFactory.cs`
- [Diagnostics export](https://github.com/n4hkro/dobby/blob/main/src/Dobby.Diagnostics/DiagnosticsExportPackageBuilder.cs): `src/Dobby.Diagnostics/DiagnosticsExportPackageBuilder.cs`

### Other components

- **Desktop user**
- **Print device**

## Connections

- Desktop user → Host startup: starts app (evidence: `src/Dobby.Host/App.xaml.cs`)
- Host startup → Login runtime: prepares login (evidence: `src/Dobby.Host/App.xaml.cs`)
- Host startup → Login and recovery UI: shows login (evidence: `src/Dobby.Host/App.xaml.cs`)
- Desktop user → Login and recovery UI: authenticates
- Login and recovery UI → Authentication: submits credentials
- Login runtime → Session lifecycle: prepares session
- Host startup → Shell view model: presents shell (evidence: `src/Dobby.Host/App.xaml.cs`)
- Desktop user → Shell view model: uses shell
- Shell view model → Navigation registry: resolves routes
- Shell view model → Work sessions: tracks work
- Session close flow → Work sessions: closes sessions (evidence: `src/Dobby.Shell/WorkSessions/WorkSessionCloseCoordinator.cs`)
- Shell view model → Session close flow: requests closure
- Desktop user → Plugin packages: installs plugins
- Plugin packages → Plugin activation: activates plugins
- Plugin activation → Plugin lifetime: tracks disposables (evidence: `src/Dobby.PluginFramework/Activation/PluginServiceRegistrationBridge.cs`)
- Plugin activation → Operation authorization: provides policy
- Plugin activation → Plugin pages: registers pages
- Plugin activation → Plugin storage: provides storage
- Plugin storage → Persistence commands: executes commands (evidence: `src/Dobby.Host/Plugins/HostPluginStorage.cs`)
- Persistence commands → SQLite database: uses database
- Desktop user → License import: imports license
- License import → Deployment context: validates binding (evidence: `src/Dobby.Licensing/LicenseImportService.cs`)
- License import → Operation authorization: updates runtime mode
- Managed users → Operation authorization: checks permissions (evidence: `src/Dobby.Security/Authentication/ManagedUserService.cs`)
- Session lifecycle → Audit trail: records changes
- Host persistence → SQLite database: maintains store (evidence: `src/Dobby.Infrastructure/Persistence/HostPersistenceMaintenanceService.cs`)
- Desktop user → Host settings: changes preferences
- Desktop user → Admin command host: runs commands
- Desktop user → Print output: requests printing
- Print output → Print device: sends output
- Desktop user → Diagnostics export: exports diagnostics
