# nitrokey/nitrokey-app2 architecture

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

- Interactive diagram: https://gitdiagram.com/nitrokey/nitrokey-app2
- Repository: https://github.com/nitrokey/nitrokey-app2

## Overview

Nitrokey App 2 is a desktop manager for Nitrokey 3 and Nitrokey Passkey devices. A user selects a detected device, then inspects its overview or uses device-specific tabs to manage FIDO2 credentials, secrets, and settings; the overview also supports firmware updates. The graph preserves these distinct workflows and the shared worker/UI layer. Some tab implementations are unsampled, so their internal device-operation links are omitted; edges reflect the README or shown source/index references.

Main entry points: [`nitrokeyapp/gui.py`](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/gui.py) (Main window), [`nitrokeyapp/common_ui.py`](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/common_ui.py) (Common UI signals), [`nitrokeyapp/fido2_tab/worker.py`](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/worker.py) (FIDO2 worker), [`nitrokeyapp/worker.py`](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/worker.py) (Worker runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["App entry<br/>[__main__.py]"]
  node_window["Main window<br/>[gui.py]"]
  node_device_view["Device view<br/>[device_view.py]"]
  node_welcome["Welcome screen<br/>[welcome_tab.py]"]
end

subgraph group_device["Device discovery"]
  node_device_buttons["Device selector<br/>[nk3_button.py]"]
  node_discovery["Device discovery<br/>[device_manager.py]"]
  node_device_state["Device data<br/>[device_data.py]"]
end

subgraph group_management["Device management"]
  node_overview["Overview tab<br/>[__init__.py]"]
  node_overview_worker["Overview worker<br/>[worker.py]"]
  node_firmware["Firmware updates<br/>[update.py]"]
  node_fido_tab["FIDO2 tab<br/>[__init__.py]"]
  node_fido_worker["FIDO2 worker<br/>[worker.py]"]
  node_fido_data["Credential data<br/>[data.py]"]
  node_secrets_tab["Secrets tab"]
  node_settings_tab["Settings tab<br/>[__init__.py]"]
  node_settings_worker["Settings worker<br/>[worker.py]"]
end

subgraph group_runtime["Shared runtime"]
  node_worker_runtime["Worker runtime<br/>[worker.py]"]
  node_common_ui["Common UI signals<br/>[common_ui.py]"]
  node_logger["Logging<br/>[logger.py]"]
end

subgraph group_ui["UI support"]
  node_touch["Touch prompts<br/>[touch.py]"]
  node_info_box["Information box<br/>[information_box.py]"]
  node_progress_box["Progress UI<br/>[progress_box.py]"]
  node_prompt_box["Prompt UI<br/>[prompt_box.py]"]
  node_qt_utils["Qt utilities<br/>[qt_utils_mix_in.py]"]
  node_ui_loader["UI loader<br/>[ui_loader.py]"]
end

node_user(("User"))
node_nitrokey{{"Nitrokey device"}}

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_window
node_user -.->|"operates"| node_window
node_window -->|"creates"| node_discovery
node_window -->|"creates"| node_device_buttons
node_discovery -->|"builds"| node_device_state
node_device_state -->|"opens"| node_nitrokey
node_window -->|"shows"| node_device_view
node_window -->|"creates"| node_overview
node_window -->|"creates"| node_fido_tab
node_window -->|"creates"| node_secrets_tab
node_window -->|"creates"| node_settings_tab
node_overview -->|"dispatches"| node_overview_worker
node_overview_worker -->|"updates firmware"| node_firmware
node_fido_tab -->|"dispatches"| node_fido_worker
node_fido_worker -->|"builds credential state"| node_fido_data
node_fido_worker -->|"manages credentials"| node_nitrokey
node_settings_tab -->|"dispatches"| node_settings_worker
node_settings_worker -.->|"manages settings"| node_nitrokey
node_secrets_tab -.->|"manages secrets"| node_nitrokey
node_overview_worker -.->|"uses jobs"| node_worker_runtime
node_fido_worker -->|"uses jobs"| node_worker_runtime
node_settings_worker -->|"uses jobs"| node_worker_runtime
node_worker_runtime -->|"reports status"| node_common_ui
node_common_ui -->|"creates"| node_touch
node_common_ui -->|"creates signals for"| node_info_box
node_common_ui -->|"creates"| node_progress_box
node_common_ui -->|"creates"| node_prompt_box
node_window -->|"connects prompts"| node_touch
node_qt_utils -->|"loads forms"| node_ui_loader
node_info_box -->|"gets icons"| node_qt_utils
node_entry -->|"configures"| node_logger
node_window -->|"creates"| node_welcome

click node_entry "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/__main__.py"
click node_window "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/gui.py"
click node_device_buttons "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/nk3_button.py"
click node_discovery "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/device_manager.py"
click node_device_state "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/device_data.py"
click node_device_view "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/device_view.py"
click node_overview "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/overview_tab/__init__.py"
click node_overview_worker "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/overview_tab/worker.py"
click node_firmware "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/update.py"
click node_fido_tab "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/__init__.py"
click node_fido_worker "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/worker.py"
click node_fido_data "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/data.py"
click node_secrets_tab "https://github.com/nitrokey/nitrokey-app2/tree/main/nitrokeyapp/secrets_tab"
click node_settings_tab "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/settings_tab/__init__.py"
click node_settings_worker "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/settings_tab/worker.py"
click node_worker_runtime "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/worker.py"
click node_common_ui "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/common_ui.py"
click node_touch "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/touch.py"
click node_info_box "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/information_box.py"
click node_progress_box "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/progress_box.py"
click node_prompt_box "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/prompt_box.py"
click node_qt_utils "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/qt_utils_mix_in.py"
click node_ui_loader "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/ui_loader.py"
click node_logger "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/logger.py"
click node_welcome "https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/welcome_tab.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_entry,node_window,node_device_view,node_welcome,node_user toneBlue
class node_device_buttons,node_discovery,node_device_state toneAmber
class node_overview,node_overview_worker,node_firmware,node_fido_tab,node_fido_worker,node_fido_data,node_secrets_tab,node_settings_tab,node_settings_worker toneMint
class node_worker_runtime,node_common_ui,node_logger toneRose
class node_touch,node_info_box,node_progress_box,node_prompt_box,node_qt_utils,node_ui_loader,node_nitrokey toneIndigo
```

## Components

### Application shell

- [App entry](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/__main__.py): `nitrokeyapp/__main__.py`
- [Main window](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/gui.py): `nitrokeyapp/gui.py`
- [Device view](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/device_view.py): `nitrokeyapp/device_view.py`
- [Welcome screen](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/welcome_tab.py): `nitrokeyapp/welcome_tab.py`

### Device discovery

- [Device selector](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/nk3_button.py): `nitrokeyapp/nk3_button.py`
- [Device discovery](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/device_manager.py): `nitrokeyapp/device_manager.py`
- [Device data](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/device_data.py): `nitrokeyapp/device_data.py`

### Device management

- [Overview tab](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/overview_tab/__init__.py): `nitrokeyapp/overview_tab/__init__.py`
- [Overview worker](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/overview_tab/worker.py): `nitrokeyapp/overview_tab/worker.py`
- [Firmware updates](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/update.py): `nitrokeyapp/update.py`
- [FIDO2 tab](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/__init__.py): `nitrokeyapp/fido2_tab/__init__.py`
- [FIDO2 worker](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/worker.py): `nitrokeyapp/fido2_tab/worker.py`
- [Credential data](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/fido2_tab/data.py): `nitrokeyapp/fido2_tab/data.py`
- [Secrets tab](https://github.com/nitrokey/nitrokey-app2/tree/main/nitrokeyapp/secrets_tab): `nitrokeyapp/secrets_tab`
- [Settings tab](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/settings_tab/__init__.py): `nitrokeyapp/settings_tab/__init__.py`
- [Settings worker](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/settings_tab/worker.py): `nitrokeyapp/settings_tab/worker.py`

### Shared runtime

- [Worker runtime](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/worker.py): `nitrokeyapp/worker.py`
- [Common UI signals](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/common_ui.py): `nitrokeyapp/common_ui.py`
- [Logging](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/logger.py): `nitrokeyapp/logger.py`

### UI support

- [Touch prompts](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/touch.py): `nitrokeyapp/touch.py`
- [Information box](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/information_box.py): `nitrokeyapp/information_box.py`
- [Progress UI](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/progress_box.py): `nitrokeyapp/progress_box.py`
- [Prompt UI](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/prompt_box.py): `nitrokeyapp/prompt_box.py`
- [Qt utilities](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/qt_utils_mix_in.py): `nitrokeyapp/qt_utils_mix_in.py`
- [UI loader](https://github.com/nitrokey/nitrokey-app2/blob/main/nitrokeyapp/ui_loader.py): `nitrokeyapp/ui_loader.py`

### Other components

- **User**
- **Nitrokey device**

## Connections

- User → App entry: launches (evidence: `nitrokeyapp/__main__.py`)
- App entry → Main window: starts (evidence: `nitrokeyapp/__main__.py`)
- User → Main window: operates (evidence: `README.md`)
- Main window → Device discovery: creates (evidence: `nitrokeyapp/gui.py`)
- Main window → Device selector: creates (evidence: `nitrokeyapp/gui.py`)
- Device discovery → Device data: builds (evidence: `nitrokeyapp/device_manager.py`)
- Device data → Nitrokey device: opens (evidence: `nitrokeyapp/device_data.py`)
- Main window → Device view: shows (evidence: `nitrokeyapp/gui.py`)
- Main window → Overview tab: creates (evidence: `nitrokeyapp/gui.py`)
- Main window → FIDO2 tab: creates (evidence: `nitrokeyapp/gui.py`)
- Main window → Secrets tab: creates (evidence: `nitrokeyapp/gui.py`)
- Main window → Settings tab: creates (evidence: `nitrokeyapp/gui.py`)
- Overview tab → Overview worker: dispatches (evidence: `nitrokeyapp/overview_tab/__init__.py`)
- Overview worker → Firmware updates: updates firmware (evidence: `nitrokeyapp/overview_tab/worker.py`)
- FIDO2 tab → FIDO2 worker: dispatches (evidence: `nitrokeyapp/fido2_tab/__init__.py`)
- FIDO2 worker → Credential data: builds credential state (evidence: `nitrokeyapp/fido2_tab/worker.py`)
- FIDO2 worker → Nitrokey device: manages credentials (evidence: `nitrokeyapp/fido2_tab/worker.py`)
- Settings tab → Settings worker: dispatches (evidence: `nitrokeyapp/settings_tab/__init__.py`)
- Settings worker → Nitrokey device: manages settings
- Secrets tab → Nitrokey device: manages secrets (evidence: `README.md`)
- Overview worker → Worker runtime: uses jobs (evidence: `nitrokeyapp/overview_tab/worker.py`)
- FIDO2 worker → Worker runtime: uses jobs (evidence: `nitrokeyapp/fido2_tab/worker.py`)
- Settings worker → Worker runtime: uses jobs (evidence: `nitrokeyapp/settings_tab/worker.py`)
- Worker runtime → Common UI signals: reports status (evidence: `nitrokeyapp/worker.py`)
- Common UI signals → Touch prompts: creates (evidence: `nitrokeyapp/common_ui.py`)
- Common UI signals → Information box: creates signals for (evidence: `nitrokeyapp/common_ui.py`)
- Common UI signals → Progress UI: creates (evidence: `nitrokeyapp/common_ui.py`)
- Common UI signals → Prompt UI: creates (evidence: `nitrokeyapp/common_ui.py`)
- Main window → Touch prompts: connects prompts (evidence: `nitrokeyapp/gui.py`)
- Qt utilities → UI loader: loads forms (evidence: `nitrokeyapp/qt_utils_mix_in.py`)
- Information box → Qt utilities: gets icons (evidence: `nitrokeyapp/information_box.py`)
- App entry → Logging: configures (evidence: `nitrokeyapp/__main__.py`)
- Main window → Welcome screen: creates (evidence: `nitrokeyapp/gui.py`)
