# ambartsumov/unified-workstation architecture

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

- Interactive diagram: https://gitdiagram.com/ambartsumov/unified-workstation
- Repository: https://github.com/ambartsumov/unified-workstation

## Overview

Unified Workstation is a local-first, cross-platform workstation coordinator. The main workflow is to launch its app or CLI, configure and pair machines, then manage a shared work folder and optional keyboard/mouse, Home, and Cloud services while reporting readiness and supporting recovery. The graph preserves the README’s major capabilities and the central modules named in the SOURCE INDEX. Some subsystem links are documented only at a high level; unsampled implementation details are not inferred.

Main entry points: [`suw/cli/main.py`](https://github.com/ambartsumov/unified-workstation/blob/main/suw/cli/main.py) (Command line), [`suw/core/syncer.py`](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/syncer.py) (Sync coordination), [`suw/app/backend.py`](https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/backend.py) (App backend), [`suw/app/server.py`](https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/server.py) (Application window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and interface"]
  node_app["Application window<br/>[server.py]"]
  node_webui["Window UI<br/>[app.js]"]
  node_backend["App backend<br/>[backend.py]"]
  node_cli["Command line<br/>[main.py]"]
end

subgraph group_workspace["Workspace and coordination"]
  node_onboarding["First-run setup<br/>[onboarding.py]"]
  node_pairing["Explicit pairing<br/>[pairing.py]"]
  node_workfolder["Shared work folder<br/>[worksync.py]"]
  node_syncer["Sync coordination<br/>[syncer.py]"]
  node_gitreconcile["Git reconciliation<br/>[gitsync.py]"]
  node_projects["Project management<br/>[projects.py]"]
  node_workmode["Workstation mode<br/>[modes.py]"]
  node_apps["Workspace applications<br/>[apps.py]"]
end

subgraph group_services["Servers and integrations"]
  node_peripherals["Keyboard and clipboard<br/>[peripherals.py]"]
  node_cloud["Cloud server<br/>[__init__.py]"]
  node_cloudprojects["Cloud projects<br/>[project.py]"]
  node_ssh["SSH integration<br/>[ssh.py]"]
  node_tailscale["Private networking<br/>[tailscale.py]"]
end

subgraph group_operations["Health and recovery"]
  node_health["Readiness and health<br/>[health.py]"]
  node_doctor["Diagnostics<br/>[doctor.py]"]
  node_backup["Recovery and backups<br/>[backup.py]"]
  node_journal["Change journal<br/>[journal.py]"]
  node_updates["Update checks<br/>[update.py]"]
end

subgraph group_foundation["Configuration and platform"]
  node_config["Configuration<br/>[config.py]"]
  node_inventory[("Device inventory<br/>[inventory.py]")]
  node_state[("Local state<br/>[state.py]")]
  node_events[("Event log<br/>[events.py]")]
  node_platform["Platform adapters<br/>[__init__.py]"]
  node_daemon["Background daemon<br/>[suwd.py]"]
  node_text["Localized text<br/>[text.py]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_user -->|"runs commands"| node_cli
node_app -->|"serves window"| node_webui
node_app -->|"uses backend"| node_backend
node_app -.->|"configures setup"| node_onboarding
node_cli -->|"manages work"| node_workfolder
node_cli -->|"manages cloud"| node_cloud
node_cli -->|"diagnoses"| node_doctor
node_cli -->|"reads configuration"| node_config
node_workfolder -->|"provides sync transport"| node_syncer
node_syncer -->|"invokes reconciliation"| node_gitreconcile
node_syncer -->|"uses project records"| node_projects
node_workmode -->|"launches applications"| node_apps
node_cli -->|"controls mode"| node_workmode
node_pairing -.->|"updates devices"| node_inventory
node_cloud -->|"connects over SSH"| node_ssh
node_cloud -->|"manages projects"| node_cloudprojects
node_peripherals -->|"checks network"| node_tailscale
node_doctor -->|"checks health"| node_health
node_doctor -->|"checks repositories"| node_gitreconcile
node_backend -.->|"supports recovery"| node_backup
node_cli -.->|"offers recovery"| node_backup
node_backend -->|"checks updates"| node_updates
node_cli -.->|"checks updates"| node_updates
node_backend -->|"loads settings"| node_config
node_config -->|"resolves platform paths"| node_platform
node_syncer -->|"persists sync state"| node_state
node_syncer -->|"records events"| node_events
node_daemon -->|"runs synchronization"| node_syncer
node_daemon -->|"checks health"| node_health
node_backend -->|"localizes messages"| node_text
node_cli -->|"formats output"| node_text

click node_app "https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/server.py"
click node_webui "https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/static/app.js"
click node_backend "https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/backend.py"
click node_cli "https://github.com/ambartsumov/unified-workstation/blob/main/suw/cli/main.py"
click node_onboarding "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/onboarding.py"
click node_pairing "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/pairing.py"
click node_workfolder "https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/worksync.py"
click node_syncer "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/syncer.py"
click node_gitreconcile "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/gitsync.py"
click node_projects "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/projects.py"
click node_workmode "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/modes.py"
click node_apps "https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/apps.py"
click node_peripherals "https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/peripherals.py"
click node_cloud "https://github.com/ambartsumov/unified-workstation/blob/main/suw/cloud/__init__.py"
click node_cloudprojects "https://github.com/ambartsumov/unified-workstation/blob/main/suw/cloud/project.py"
click node_ssh "https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/ssh.py"
click node_tailscale "https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/tailscale.py"
click node_health "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/health.py"
click node_doctor "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/doctor.py"
click node_backup "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/backup.py"
click node_journal "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/journal.py"
click node_updates "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/update.py"
click node_config "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/config.py"
click node_inventory "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/inventory.py"
click node_state "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/state.py"
click node_events "https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/events.py"
click node_platform "https://github.com/ambartsumov/unified-workstation/blob/main/suw/platform/__init__.py"
click node_daemon "https://github.com/ambartsumov/unified-workstation/blob/main/suw/daemon/suwd.py"
click node_text "https://github.com/ambartsumov/unified-workstation/blob/main/suw/ui/text.py"

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_webui,node_backend,node_cli,node_user toneBlue
class node_onboarding,node_pairing,node_workfolder,node_syncer,node_gitreconcile,node_projects,node_workmode,node_apps toneAmber
class node_peripherals,node_cloud,node_cloudprojects,node_ssh,node_tailscale toneMint
class node_health,node_doctor,node_backup,node_journal,node_updates toneRose
class node_config,node_inventory,node_state,node_events,node_platform,node_daemon,node_text toneIndigo
```

## Components

### Entry and interface

- [Application window](https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/server.py): `suw/app/server.py`
- [Window UI](https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/static/app.js): `suw/app/static/app.js`
- [App backend](https://github.com/ambartsumov/unified-workstation/blob/main/suw/app/backend.py): `suw/app/backend.py`
- [Command line](https://github.com/ambartsumov/unified-workstation/blob/main/suw/cli/main.py): `suw/cli/main.py`

### Workspace and coordination

- [First-run setup](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/onboarding.py): `suw/core/onboarding.py`
- [Explicit pairing](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/pairing.py): `suw/core/pairing.py`
- [Shared work folder](https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/worksync.py): `suw/integrations/worksync.py`
- [Sync coordination](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/syncer.py): `suw/core/syncer.py`
- [Git reconciliation](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/gitsync.py): `suw/core/gitsync.py`
- [Project management](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/projects.py): `suw/core/projects.py`
- [Workstation mode](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/modes.py): `suw/core/modes.py`
- [Workspace applications](https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/apps.py): `suw/integrations/apps.py`

### Servers and integrations

- [Keyboard and clipboard](https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/peripherals.py): `suw/integrations/peripherals.py`
- [Cloud server](https://github.com/ambartsumov/unified-workstation/blob/main/suw/cloud/__init__.py): `suw/cloud/__init__.py`
- [Cloud projects](https://github.com/ambartsumov/unified-workstation/blob/main/suw/cloud/project.py): `suw/cloud/project.py`
- [SSH integration](https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/ssh.py): `suw/integrations/ssh.py`
- [Private networking](https://github.com/ambartsumov/unified-workstation/blob/main/suw/integrations/tailscale.py): `suw/integrations/tailscale.py`

### Health and recovery

- [Readiness and health](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/health.py): `suw/core/health.py`
- [Diagnostics](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/doctor.py): `suw/core/doctor.py`
- [Recovery and backups](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/backup.py): `suw/core/backup.py`
- [Change journal](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/journal.py): `suw/core/journal.py`
- [Update checks](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/update.py): `suw/core/update.py`

### Configuration and platform

- [Configuration](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/config.py): `suw/core/config.py`
- [Device inventory](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/inventory.py): `suw/core/inventory.py`
- [Local state](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/state.py): `suw/core/state.py`
- [Event log](https://github.com/ambartsumov/unified-workstation/blob/main/suw/core/events.py): `suw/core/events.py`
- [Platform adapters](https://github.com/ambartsumov/unified-workstation/blob/main/suw/platform/__init__.py): `suw/platform/__init__.py`
- [Background daemon](https://github.com/ambartsumov/unified-workstation/blob/main/suw/daemon/suwd.py): `suw/daemon/suwd.py`
- [Localized text](https://github.com/ambartsumov/unified-workstation/blob/main/suw/ui/text.py): `suw/ui/text.py`

### Other components

- **User**

## Connections

- User → Application window: opens (evidence: `README.md`)
- User → Command line: runs commands (evidence: `README.md`)
- Application window → Window UI: serves window (evidence: `README.md`)
- Application window → App backend: uses backend (evidence: `suw/app/server.py`)
- Application window → First-run setup: configures setup
- Command line → Shared work folder: manages work (evidence: `suw/cli/main.py`)
- Command line → Cloud server: manages cloud (evidence: `suw/cli/cloud_cmd.py`)
- Command line → Diagnostics: diagnoses (evidence: `suw/core/doctor.py`)
- Command line → Configuration: reads configuration (evidence: `suw/cli/main.py`)
- Shared work folder → Sync coordination: provides sync transport (evidence: `suw/core/syncer.py`)
- Sync coordination → Git reconciliation: invokes reconciliation (evidence: `suw/core/syncer.py`)
- Sync coordination → Project management: uses project records (evidence: `suw/core/syncer.py`)
- Workstation mode → Workspace applications: launches applications (evidence: `suw/core/modes.py`)
- Command line → Workstation mode: controls mode (evidence: `suw/cli/main.py`)
- Explicit pairing → Device inventory: updates devices
- Cloud server → SSH integration: connects over SSH (evidence: `suw/cloud/__init__.py`)
- Cloud server → Cloud projects: manages projects (evidence: `suw/cloud/__init__.py`)
- Keyboard and clipboard → Private networking: checks network (evidence: `suw/integrations/peripherals.py`)
- Diagnostics → Readiness and health: checks health (evidence: `suw/core/doctor.py`)
- Diagnostics → Git reconciliation: checks repositories (evidence: `suw/core/doctor.py`)
- App backend → Recovery and backups: supports recovery (evidence: `suw/app/backend.py`)
- Command line → Recovery and backups: offers recovery
- App backend → Update checks: checks updates (evidence: `suw/app/backend.py`)
- Command line → Update checks: checks updates
- App backend → Configuration: loads settings (evidence: `suw/app/backend.py`)
- Configuration → Platform adapters: resolves platform paths
- Sync coordination → Local state: persists sync state (evidence: `suw/core/syncer.py`)
- Sync coordination → Event log: records events (evidence: `suw/core/syncer.py`)
- Background daemon → Sync coordination: runs synchronization (evidence: `suw/daemon/suwd.py`)
- Background daemon → Readiness and health: checks health (evidence: `suw/daemon/suwd.py`)
- App backend → Localized text: localizes messages (evidence: `suw/app/backend.py`)
- Command line → Localized text: formats output (evidence: `suw/cli/main.py`)
