# district47/tak-installer architecture

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

- Interactive diagram: https://gitdiagram.com/district47/tak-installer
- Repository: https://github.com/district47/tak-installer

## Overview

TAK Server Installer is an Electron desktop wizard for guiding users from hardware or VPS planning through Ubuntu setup, SSH installation of OpenTakServer, post-install configuration, and a printable report. The renderer routes wizard screens and shares state; the Install screen connects an xterm terminal to the SSH shell through the preload IPC bridge. The README documents HTTPS, DuckDNS, health/firewall/network checks, and enrollment; their internal calls are not fully shown in the excerpts, so those links are documented rather than inferred from imports.

Main entry points: [`src/renderer/src/App.tsx`](https://github.com/District47/tak-installer/blob/main/src/renderer/src/App.tsx) (Screen router), [`src/renderer/src/screens/Configure.tsx`](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Configure.tsx) (Post-install checklist), [`src/renderer/src/screens/Install.tsx`](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Install.tsx) (Interactive installer), [`src/renderer/src/store.ts`](https://github.com/District47/tak-installer/blob/main/src/renderer/src/store.ts) (Wizard state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Planning wizard"]
  node_app["Screen router<br/>[App.tsx]"]
  node_wizard["Wizard state<br/>[store.ts]"]
  node_hosting["Hosting choice<br/>[Hosting.tsx]"]
  node_device["Device planning<br/>[PhysicalDevice.tsx]"]
  node_device_recommend["Hardware recommendation"]
  node_vps_users["VPS sizing<br/>[VpsUsers.tsx]"]
  node_vps_recommend["VPS recommendation<br/>[VpsRecommend.tsx]"]
  node_physical_os["Bare-metal Ubuntu guide<br/>[PhysicalOS.tsx]"]
  node_vps_os["VPS Ubuntu guide<br/>[VpsOS.tsx]"]
  node_overview["Server overview<br/>[Overview.tsx]"]
  node_config_data["Recommendations and commands<br/>[config.ts]"]
end

subgraph group_installation["SSH installation"]
  node_connect["SSH credentials<br/>[Connect.tsx]"]
  node_install["Interactive installer<br/>[Install.tsx]"]
end

subgraph group_configuration["Server configuration"]
  node_configure["Post-install checklist<br/>[Configure.tsx]"]
  node_https["HTTPS setup<br/>[https.ts]"]
  node_duckdns["DuckDNS updater<br/>[duckdns.ts]"]
  node_postinstall["Health and network checks<br/>[postinstall.ts]"]
  node_report["Install report screen<br/>[Report.tsx]"]
  node_report_data["Report generation<br/>[report.ts]"]
end

subgraph group_runtime["Desktop runtime"]
  node_ssh_api["Preload SSH bridge<br/>[index.ts]"]
  node_ssh_main["SSH shell and commands<br/>[ssh.ts]"]
  node_electron["Electron main process<br/>[index.ts]"]
end

node_user(("Installer user"))
node_tak["OpenTakServer installer"]
node_remote_server["Target server"]
node_open_external["System browser"]

node_user -->|"uses wizard"| node_app
node_app -->|"reads screen"| node_wizard
node_app -->|"routes to"| node_hosting
node_app -->|"routes to"| node_device
node_app -->|"routes to"| node_device_recommend
node_app -->|"routes to"| node_physical_os
node_app -->|"routes to"| node_vps_users
node_app -->|"routes to"| node_vps_recommend
node_app -->|"routes to"| node_vps_os
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_connect
node_app -->|"routes to"| node_install
node_app -->|"routes to"| node_configure
node_app -->|"routes to"| node_report
node_hosting -.->|"sets choice"| node_wizard
node_device_recommend -.->|"uses links"| node_config_data
node_vps_recommend -.->|"uses tiers"| node_config_data
node_physical_os -->|"continues setup"| node_connect
node_connect -->|"stores credentials"| node_wizard
node_connect -->|"opens install"| node_install
node_install -->|"reads session state"| node_wizard
node_install -->|"uses shell bridge"| node_ssh_api
node_ssh_api -->|"invokes IPC"| node_ssh_main
node_electron -->|"registers SSH"| node_ssh_main
node_ssh_main -->|"opens SSH session"| node_remote_server
node_install -->|"runs installer command"| node_tak
node_configure -->|"offers HTTPS setup"| node_https
node_configure -->|"offers DNS setup"| node_duckdns
node_configure -->|"offers checks"| node_postinstall
node_configure -->|"ends with report"| node_report
node_report -->|"builds report"| node_report_data
node_report -->|"reads install state"| node_wizard
node_physical_os -->|"opens download link"| node_open_external

click node_app "https://github.com/District47/tak-installer/blob/main/src/renderer/src/App.tsx"
click node_wizard "https://github.com/District47/tak-installer/blob/main/src/renderer/src/store.ts"
click node_hosting "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Hosting.tsx"
click node_device "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/PhysicalDevice.tsx"
click node_device_recommend "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/PhysicalRecommend.tsx"
click node_vps_users "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/VpsUsers.tsx"
click node_vps_recommend "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/VpsRecommend.tsx"
click node_physical_os "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/PhysicalOS.tsx"
click node_vps_os "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/VpsOS.tsx"
click node_overview "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Overview.tsx"
click node_config_data "https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/config.ts"
click node_connect "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Connect.tsx"
click node_install "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Install.tsx"
click node_ssh_api "https://github.com/District47/tak-installer/blob/main/src/preload/index.ts"
click node_ssh_main "https://github.com/District47/tak-installer/blob/main/src/main/ssh.ts"
click node_electron "https://github.com/District47/tak-installer/blob/main/src/main/index.ts"
click node_configure "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Configure.tsx"
click node_https "https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/https.ts"
click node_duckdns "https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/duckdns.ts"
click node_postinstall "https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/postinstall.ts"
click node_report "https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Report.tsx"
click node_report_data "https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/report.ts"

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_wizard,node_hosting,node_device,node_device_recommend,node_vps_users,node_vps_recommend,node_physical_os,node_vps_os,node_overview,node_config_data,node_user,node_open_external toneBlue
class node_connect,node_install toneAmber
class node_configure,node_https,node_duckdns,node_postinstall,node_report,node_report_data,node_tak,node_remote_server toneMint
class node_ssh_api,node_ssh_main,node_electron toneRose
```

## Components

### Planning wizard

- [Screen router](https://github.com/District47/tak-installer/blob/main/src/renderer/src/App.tsx): `src/renderer/src/App.tsx`
- [Wizard state](https://github.com/District47/tak-installer/blob/main/src/renderer/src/store.ts): `src/renderer/src/store.ts`
- [Hosting choice](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Hosting.tsx): `src/renderer/src/screens/Hosting.tsx`
- [Device planning](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/PhysicalDevice.tsx): `src/renderer/src/screens/PhysicalDevice.tsx`
- [Hardware recommendation](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/PhysicalRecommend.tsx): `src/renderer/src/screens/PhysicalRecommend.tsx`
- [VPS sizing](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/VpsUsers.tsx): `src/renderer/src/screens/VpsUsers.tsx`
- [VPS recommendation](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/VpsRecommend.tsx): `src/renderer/src/screens/VpsRecommend.tsx`
- [Bare-metal Ubuntu guide](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/PhysicalOS.tsx): `src/renderer/src/screens/PhysicalOS.tsx`
- [VPS Ubuntu guide](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/VpsOS.tsx): `src/renderer/src/screens/VpsOS.tsx`
- [Server overview](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Overview.tsx): `src/renderer/src/screens/Overview.tsx`
- [Recommendations and commands](https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/config.ts): `src/renderer/src/data/config.ts`

### SSH installation

- [SSH credentials](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Connect.tsx): `src/renderer/src/screens/Connect.tsx`
- [Interactive installer](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Install.tsx): `src/renderer/src/screens/Install.tsx`

### Server configuration

- [Post-install checklist](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Configure.tsx): `src/renderer/src/screens/Configure.tsx`
- [HTTPS setup](https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/https.ts): `src/renderer/src/data/https.ts`
- [DuckDNS updater](https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/duckdns.ts): `src/renderer/src/data/duckdns.ts`
- [Health and network checks](https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/postinstall.ts): `src/renderer/src/data/postinstall.ts`
- [Install report screen](https://github.com/District47/tak-installer/blob/main/src/renderer/src/screens/Report.tsx): `src/renderer/src/screens/Report.tsx`
- [Report generation](https://github.com/District47/tak-installer/blob/main/src/renderer/src/data/report.ts): `src/renderer/src/data/report.ts`

### Desktop runtime

- [Preload SSH bridge](https://github.com/District47/tak-installer/blob/main/src/preload/index.ts): `src/preload/index.ts`
- [SSH shell and commands](https://github.com/District47/tak-installer/blob/main/src/main/ssh.ts): `src/main/ssh.ts`
- [Electron main process](https://github.com/District47/tak-installer/blob/main/src/main/index.ts): `src/main/index.ts`

### Other components

- **Installer user**
- **OpenTakServer installer**
- **Target server**
- **System browser**

## Connections

- Installer user → Screen router: uses wizard (evidence: `README.md`)
- Screen router → Wizard state: reads screen (evidence: `src/renderer/src/App.tsx`)
- Screen router → Hosting choice: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Device planning: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Hardware recommendation: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Bare-metal Ubuntu guide: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → VPS sizing: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → VPS recommendation: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → VPS Ubuntu guide: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Server overview: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → SSH credentials: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Interactive installer: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Post-install checklist: routes to (evidence: `src/renderer/src/App.tsx`)
- Screen router → Install report screen: routes to (evidence: `src/renderer/src/App.tsx`)
- Hosting choice → Wizard state: sets choice (evidence: `src/renderer/src/screens/Hosting.tsx`)
- Hardware recommendation → Recommendations and commands: uses links
- VPS recommendation → Recommendations and commands: uses tiers (evidence: `src/renderer/src/screens/VpsRecommend.tsx`)
- Bare-metal Ubuntu guide → SSH credentials: continues setup (evidence: `src/renderer/src/screens/PhysicalOS.tsx`)
- SSH credentials → Wizard state: stores credentials (evidence: `src/renderer/src/screens/Connect.tsx`)
- SSH credentials → Interactive installer: opens install (evidence: `src/renderer/src/screens/Connect.tsx`)
- Interactive installer → Wizard state: reads session state (evidence: `src/renderer/src/screens/Install.tsx`)
- Interactive installer → Preload SSH bridge: uses shell bridge (evidence: `README.md`)
- Preload SSH bridge → SSH shell and commands: invokes IPC (evidence: `README.md`)
- Electron main process → SSH shell and commands: registers SSH (evidence: `src/main/index.ts`)
- SSH shell and commands → Target server: opens SSH session (evidence: `README.md`)
- Interactive installer → OpenTakServer installer: runs installer command
- Post-install checklist → HTTPS setup: offers HTTPS setup (evidence: `src/renderer/src/screens/Configure.tsx`)
- Post-install checklist → DuckDNS updater: offers DNS setup (evidence: `src/renderer/src/screens/Configure.tsx`)
- Post-install checklist → Health and network checks: offers checks (evidence: `src/renderer/src/screens/Configure.tsx`)
- Post-install checklist → Install report screen: ends with report (evidence: `README.md`)
- Install report screen → Report generation: builds report (evidence: `src/renderer/src/screens/Report.tsx`)
- Install report screen → Wizard state: reads install state (evidence: `src/renderer/src/screens/Report.tsx`)
- Bare-metal Ubuntu guide → System browser: opens download link
