# satellite-earth/desktop architecture

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

- Interactive diagram: https://gitdiagram.com/satellite-earth/desktop
- Repository: https://github.com/satellite-earth/desktop

## Overview

Satellite Desktop is an Electron application for installing and managing a local personal-node. The main flow initializes the desktop shell, loads configuration and identities, starts the node when an identity is active, and opens its dashboard; users also manage identities and NIP-07 permissions through IPC. Tray, menus, and auto-updates are supporting desktop capabilities. The README describes the product goal but not its detailed UI or node-management behavior, so those links are limited to relationships shown in the sampled entrypoint and source index.

Main entry points: [`src/app/index.ts`](https://github.com/satellite-earth/desktop/blob/master/src/app/index.ts) (Desktop coordinator), [`src/app/identities.ts`](https://github.com/satellite-earth/desktop/blob/master/src/app/identities.ts) (Identity manager), [`src/app/nip07.ts`](https://github.com/satellite-earth/desktop/blob/master/src/app/nip07.ts) (NIP-07 permissions), [`src/interfaces/node.ts`](https://github.com/satellite-earth/desktop/blob/master/src/interfaces/node.ts) (Node process manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop runtime"]
  node_entry["Electron entry<br/>[index.ts]"]
  node_desktop["Desktop coordinator<br/>[index.ts]"]
  node_config["App configuration<br/>[config.ts]"]
  node_jsonfile["JSON persistence<br/>[jsonfile.ts]"]
  node_file["File helpers<br/>[file.ts]"]
  node_dashboard["Node dashboard"]
  node_preloadmain["Renderer bridge<br/>[main.cts]"]
  node_preloadidentity["Identity bridge<br/>[identity.cts]"]
  node_preloadlauncher["Launcher bridge<br/>[launcher.cts]"]
  node_preloadpermission["Permission bridge<br/>[permission.cts]"]
  node_localstore[("Local config files")]
end

subgraph group_identity["Identity and signing"]
  node_identitymanager["Identity manager<br/>[identities.ts]"]
  node_secrets["Secret manager<br/>[secrets.ts]"]
  node_nip07["NIP-07 permissions<br/>[nip07.ts]"]
  node_permissionui["Permission prompt<br/>[nip07.ts]"]
end

subgraph group_node["Local node"]
  node_nodeclient["Node process manager<br/>[node.ts]"]
  node_personalnode["Personal node"]
  node_deferred["Startup promise<br/>[deferred.ts]"]
end

subgraph group_shell["Desktop shell"]
  node_tray["System tray<br/>[tray.ts]"]
  node_menu["Application menu<br/>[menu.ts]"]
  node_launcher["PWA launcher<br/>[launcher.ts]"]
  node_updates["Auto-updates<br/>[updates.ts]"]
end

node_user(("Desktop user"))

node_user -->|"opens app"| node_entry
node_entry -->|"creates"| node_desktop
node_desktop -->|"creates"| node_config
node_config -->|"persists via"| node_jsonfile
node_jsonfile -->|"reads and writes"| node_file
node_file -->|"reads and writes"| node_localstore
node_desktop -->|"creates and starts"| node_nodeclient
node_nodeclient -->|"creates startup wait"| node_deferred
node_nodeclient -->|"forks process"| node_personalnode
node_desktop -->|"loads dashboard"| node_dashboard
node_user -.->|"manages identities"| node_identitymanager
node_desktop -->|"creates"| node_identitymanager
node_identitymanager -->|"stores keys"| node_secrets
node_identitymanager -->|"sets active identity"| node_config
node_desktop -->|"creates"| node_nip07
node_nip07 -->|"uses active identity"| node_identitymanager
node_nip07 -->|"prompts user"| node_permissionui
node_desktop -->|"creates and sets up"| node_tray
node_desktop -->|"creates and sets up"| node_menu
node_desktop -->|"creates"| node_launcher
node_desktop -->|"creates"| node_updates
node_desktop -->|"configures window"| node_preloadmain
node_user -.->|"uses"| node_dashboard

click node_entry "https://github.com/satellite-earth/desktop/blob/master/src/index.ts"
click node_desktop "https://github.com/satellite-earth/desktop/blob/master/src/app/index.ts"
click node_config "https://github.com/satellite-earth/desktop/blob/master/src/app/config.ts"
click node_jsonfile "https://github.com/satellite-earth/desktop/blob/master/src/helpers/jsonfile.ts"
click node_file "https://github.com/satellite-earth/desktop/blob/master/src/helpers/file.ts"
click node_nodeclient "https://github.com/satellite-earth/desktop/blob/master/src/interfaces/node.ts"
click node_deferred "https://github.com/satellite-earth/desktop/blob/master/src/helpers/deferred.ts"
click node_identitymanager "https://github.com/satellite-earth/desktop/blob/master/src/app/identities.ts"
click node_secrets "https://github.com/satellite-earth/desktop/blob/master/src/app/secrets.ts"
click node_nip07 "https://github.com/satellite-earth/desktop/blob/master/src/app/nip07.ts"
click node_permissionui "https://github.com/satellite-earth/desktop/blob/master/src/app/nip07.ts"
click node_tray "https://github.com/satellite-earth/desktop/blob/master/src/app/tray.ts"
click node_menu "https://github.com/satellite-earth/desktop/blob/master/src/app/menu.ts"
click node_launcher "https://github.com/satellite-earth/desktop/blob/master/src/app/launcher.ts"
click node_updates "https://github.com/satellite-earth/desktop/blob/master/src/app/updates.ts"
click node_preloadmain "https://github.com/satellite-earth/desktop/blob/master/src/preload/main.cts"
click node_preloadidentity "https://github.com/satellite-earth/desktop/blob/master/src/preload/identity.cts"
click node_preloadlauncher "https://github.com/satellite-earth/desktop/blob/master/src/preload/launcher.cts"
click node_preloadpermission "https://github.com/satellite-earth/desktop/blob/master/src/preload/permission.cts"

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_entry,node_desktop,node_config,node_jsonfile,node_file,node_dashboard,node_preloadmain,node_preloadidentity,node_preloadlauncher,node_preloadpermission,node_localstore,node_user toneBlue
class node_identitymanager,node_secrets,node_nip07,node_permissionui toneAmber
class node_nodeclient,node_personalnode,node_deferred toneMint
class node_tray,node_menu,node_launcher,node_updates toneRose
```

## Components

### Desktop runtime

- [Electron entry](https://github.com/satellite-earth/desktop/blob/master/src/index.ts): `src/index.ts`
- [Desktop coordinator](https://github.com/satellite-earth/desktop/blob/master/src/app/index.ts): `src/app/index.ts`
- [App configuration](https://github.com/satellite-earth/desktop/blob/master/src/app/config.ts): `src/app/config.ts`
- [JSON persistence](https://github.com/satellite-earth/desktop/blob/master/src/helpers/jsonfile.ts): `src/helpers/jsonfile.ts`
- [File helpers](https://github.com/satellite-earth/desktop/blob/master/src/helpers/file.ts): `src/helpers/file.ts`
- **Node dashboard**
- [Renderer bridge](https://github.com/satellite-earth/desktop/blob/master/src/preload/main.cts): `src/preload/main.cts`
- [Identity bridge](https://github.com/satellite-earth/desktop/blob/master/src/preload/identity.cts): `src/preload/identity.cts`
- [Launcher bridge](https://github.com/satellite-earth/desktop/blob/master/src/preload/launcher.cts): `src/preload/launcher.cts`
- [Permission bridge](https://github.com/satellite-earth/desktop/blob/master/src/preload/permission.cts): `src/preload/permission.cts`
- **Local config files**

### Identity and signing

- [Identity manager](https://github.com/satellite-earth/desktop/blob/master/src/app/identities.ts): `src/app/identities.ts`
- [Secret manager](https://github.com/satellite-earth/desktop/blob/master/src/app/secrets.ts): `src/app/secrets.ts`
- [NIP-07 permissions](https://github.com/satellite-earth/desktop/blob/master/src/app/nip07.ts): `src/app/nip07.ts`
- [Permission prompt](https://github.com/satellite-earth/desktop/blob/master/src/app/nip07.ts): `src/app/nip07.ts`

### Local node

- [Node process manager](https://github.com/satellite-earth/desktop/blob/master/src/interfaces/node.ts): `src/interfaces/node.ts`
- **Personal node**
- [Startup promise](https://github.com/satellite-earth/desktop/blob/master/src/helpers/deferred.ts): `src/helpers/deferred.ts`

### Desktop shell

- [System tray](https://github.com/satellite-earth/desktop/blob/master/src/app/tray.ts): `src/app/tray.ts`
- [Application menu](https://github.com/satellite-earth/desktop/blob/master/src/app/menu.ts): `src/app/menu.ts`
- [PWA launcher](https://github.com/satellite-earth/desktop/blob/master/src/app/launcher.ts): `src/app/launcher.ts`
- [Auto-updates](https://github.com/satellite-earth/desktop/blob/master/src/app/updates.ts): `src/app/updates.ts`

### Other components

- **Desktop user**

## Connections

- Desktop user → Electron entry: opens app (evidence: `src/index.ts`)
- Electron entry → Desktop coordinator: creates (evidence: `src/index.ts`)
- Desktop coordinator → App configuration: creates (evidence: `src/app/index.ts`)
- App configuration → JSON persistence: persists via (evidence: `src/app/config.ts`)
- JSON persistence → File helpers: reads and writes (evidence: `src/helpers/jsonfile.ts`)
- File helpers → Local config files: reads and writes (evidence: `src/helpers/file.ts`)
- Desktop coordinator → Node process manager: creates and starts (evidence: `src/app/index.ts`)
- Node process manager → Startup promise: creates startup wait (evidence: `src/interfaces/node.ts`)
- Node process manager → Personal node: forks process (evidence: `src/interfaces/node.ts`)
- Desktop coordinator → Node dashboard: loads dashboard (evidence: `src/app/index.ts`)
- Desktop user → Identity manager: manages identities (evidence: `src/app/identities.ts`)
- Desktop coordinator → Identity manager: creates (evidence: `src/app/index.ts`)
- Identity manager → Secret manager: stores keys (evidence: `src/app/identities.ts`)
- Identity manager → App configuration: sets active identity (evidence: `src/app/identities.ts`)
- Desktop coordinator → NIP-07 permissions: creates (evidence: `src/app/index.ts`)
- NIP-07 permissions → Identity manager: uses active identity (evidence: `src/app/nip07.ts`)
- NIP-07 permissions → Permission prompt: prompts user (evidence: `src/app/nip07.ts`)
- Desktop coordinator → System tray: creates and sets up (evidence: `src/app/index.ts`)
- Desktop coordinator → Application menu: creates and sets up (evidence: `src/app/index.ts`)
- Desktop coordinator → PWA launcher: creates (evidence: `src/app/index.ts`)
- Desktop coordinator → Auto-updates: creates (evidence: `src/app/index.ts`)
- Desktop coordinator → Renderer bridge: configures window (evidence: `src/app/index.ts`)
- Desktop user → Node dashboard: uses
