# home-assistant/ios architecture

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

- Interactive diagram: https://gitdiagram.com/home-assistant/ios
- Repository: https://github.com/home-assistant/ios

## Overview

This repository is Home Assistant’s native Apple-platform client, with an accompanying push server. A typical user connects to a Home Assistant instance, completes server setup and authentication, then uses the embedded frontend and native features such as Assist, camera viewing, and notifications. The map also includes watch support and the app’s server/session layer. Several domain branches are visible in the tree and README-level product context but were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`Sources/HAModels/Sources/AssistPipelines.swift`](https://github.com/home-assistant/ios/blob/main/Sources/HAModels/Sources/AssistPipelines.swift) (Assist pipeline model), [`Sources/HANetworking/Sources/Server.swift`](https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/Server.swift) (Server connection), [`Sources/App/HAApp.swift`](https://github.com/home-assistant/ios/blob/main/Sources/App/HAApp.swift) (Home Assistant app), [`Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift`](https://github.com/home-assistant/ios/blob/main/Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift) (Intent pipeline query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App experience"]
  node_app["Home Assistant app<br/>[HAApp.swift]"]
  node_frontend["Web frontend<br/>[FrontendView.swift]"]
  node_onboarding["Server onboarding"]
end

subgraph group_connect["Server connection"]
  node_network["Networking environment"]
  node_servers["Server registry"]
  node_server["Server connection<br/>[Server.swift]"]
  node_tokens["Token management<br/>[TokenManager.swift]"]
end

subgraph group_assist["Assist and voice"]
  node_pipelines["Assist pipeline model"]
  node_pipeline_store[("Pipeline mirror")]
  node_assist_service["Assist service"]
  node_pipeline_picker["Pipeline picker"]
  node_assist_query["Intent pipeline query"]
end

subgraph group_device["Device features"]
  node_watch["Watch communication"]
  node_watch_picker["Watch pipeline choices"]
  node_camera["Camera notifications"]
end

subgraph group_push["Push service"]
  node_push_routes["Push routes<br/>[routes.swift]"]
  node_push_controller["Push controller"]
end

node_user(("Apple user"))
node_ha_server["Home Assistant server"]

node_user -.->|"uses"| node_app
node_app -.->|"offers setup"| node_onboarding
node_onboarding -.->|"configures"| node_servers
node_app -.->|"presents"| node_frontend
node_servers -->|"manages"| node_server
node_server -->|"uses services"| node_network
node_tokens -->|"refreshes credentials"| node_server
node_server -.->|"connects"| node_ha_server
node_pipeline_store -->|"stores records"| node_pipelines
node_assist_query -->|"reads pipeline model"| node_pipelines
node_assist_query -->|"fetches mirror"| node_pipeline_store
node_pipeline_picker -->|"selects pipeline"| node_pipelines
node_assist_service -->|"uses pipeline model"| node_pipelines
node_watch_picker -->|"reads choices"| node_pipelines
node_watch -->|"invokes Assist"| node_assist_service
node_push_routes -->|"routes requests"| node_push_controller
node_push_controller -.->|"sends push"| node_ha_server

click node_app "https://github.com/home-assistant/ios/blob/main/Sources/App/HAApp.swift"
click node_frontend "https://github.com/home-assistant/ios/blob/main/Sources/App/Frontend/WebView/FrontendView.swift"
click node_onboarding "https://github.com/home-assistant/ios/blob/main/Sources/App/Onboarding/Container/OnboardingNavigationView.swift"
click node_network "https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/HANetworkingEnvironment.swift"
click node_servers "https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/ServerManager.swift"
click node_server "https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/Server.swift"
click node_tokens "https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/TokenManager.swift"
click node_pipelines "https://github.com/home-assistant/ios/blob/main/Sources/HAModels/Sources/AssistPipelines.swift"
click node_pipeline_store "https://github.com/home-assistant/ios/blob/main/Sources/Shared/Database/Tables/AssistPipelinesTable.swift"
click node_assist_service "https://github.com/home-assistant/ios/blob/main/Sources/Shared/Intents/AppIntent/AssistInApp/AssistService.swift"
click node_pipeline_picker "https://github.com/home-assistant/ios/blob/main/Sources/App/Settings/MagicItem/AssistPipelinePicker.swift"
click node_assist_query "https://github.com/home-assistant/ios/blob/main/Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift"
click node_watch "https://github.com/home-assistant/ios/blob/main/Sources/Watch/WatchCommunicatorService.swift"
click node_watch_picker "https://github.com/home-assistant/ios/blob/main/Sources/WatchApp/Home/Edit/WatchAssistPipelineOption.swift"
click node_camera "https://github.com/home-assistant/ios/blob/main/Sources/Extensions/NotificationContent/CameraViewController.swift"
click node_push_routes "https://github.com/home-assistant/ios/blob/main/Sources/PushServer/Sources/App/routes.swift"
click node_push_controller "https://github.com/home-assistant/ios/blob/main/Sources/PushServer/Sources/App/Controllers/PushController.swift"

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_frontend,node_onboarding,node_user toneBlue
class node_network,node_servers,node_server,node_tokens toneAmber
class node_pipelines,node_pipeline_store,node_assist_service,node_pipeline_picker,node_assist_query,node_ha_server toneMint
class node_watch,node_watch_picker,node_camera toneRose
class node_push_routes,node_push_controller toneIndigo
```

## Components

### App experience

- [Home Assistant app](https://github.com/home-assistant/ios/blob/main/Sources/App/HAApp.swift): `Sources/App/HAApp.swift`
- [Web frontend](https://github.com/home-assistant/ios/blob/main/Sources/App/Frontend/WebView/FrontendView.swift): `Sources/App/Frontend/WebView/FrontendView.swift`
- [Server onboarding](https://github.com/home-assistant/ios/blob/main/Sources/App/Onboarding/Container/OnboardingNavigationView.swift): `Sources/App/Onboarding/Container/OnboardingNavigationView.swift`

### Server connection

- [Networking environment](https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/HANetworkingEnvironment.swift): `Sources/HANetworking/Sources/HANetworkingEnvironment.swift`
- [Server registry](https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/ServerManager.swift): `Sources/HANetworking/Sources/ServerManager.swift`
- [Server connection](https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/Server.swift): `Sources/HANetworking/Sources/Server.swift`
- [Token management](https://github.com/home-assistant/ios/blob/main/Sources/HANetworking/Sources/TokenManager.swift): `Sources/HANetworking/Sources/TokenManager.swift`

### Assist and voice

- [Assist pipeline model](https://github.com/home-assistant/ios/blob/main/Sources/HAModels/Sources/AssistPipelines.swift): `Sources/HAModels/Sources/AssistPipelines.swift`
- [Pipeline mirror](https://github.com/home-assistant/ios/blob/main/Sources/Shared/Database/Tables/AssistPipelinesTable.swift): `Sources/Shared/Database/Tables/AssistPipelinesTable.swift`
- [Assist service](https://github.com/home-assistant/ios/blob/main/Sources/Shared/Intents/AppIntent/AssistInApp/AssistService.swift): `Sources/Shared/Intents/AppIntent/AssistInApp/AssistService.swift`
- [Pipeline picker](https://github.com/home-assistant/ios/blob/main/Sources/App/Settings/MagicItem/AssistPipelinePicker.swift): `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift`
- [Intent pipeline query](https://github.com/home-assistant/ios/blob/main/Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift): `Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift`

### Device features

- [Watch communication](https://github.com/home-assistant/ios/blob/main/Sources/Watch/WatchCommunicatorService.swift): `Sources/Watch/WatchCommunicatorService.swift`
- [Watch pipeline choices](https://github.com/home-assistant/ios/blob/main/Sources/WatchApp/Home/Edit/WatchAssistPipelineOption.swift): `Sources/WatchApp/Home/Edit/WatchAssistPipelineOption.swift`
- [Camera notifications](https://github.com/home-assistant/ios/blob/main/Sources/Extensions/NotificationContent/CameraViewController.swift): `Sources/Extensions/NotificationContent/CameraViewController.swift`

### Push service

- [Push routes](https://github.com/home-assistant/ios/blob/main/Sources/PushServer/Sources/App/routes.swift): `Sources/PushServer/Sources/App/routes.swift`
- [Push controller](https://github.com/home-assistant/ios/blob/main/Sources/PushServer/Sources/App/Controllers/PushController.swift): `Sources/PushServer/Sources/App/Controllers/PushController.swift`

### Other components

- **Apple user**
- **Home Assistant server**

## Connections

- Apple user → Home Assistant app: uses
- Home Assistant app → Server onboarding: offers setup
- Server onboarding → Server registry: configures
- Home Assistant app → Web frontend: presents
- Server registry → Server connection: manages (evidence: `Sources/HANetworking/Sources/ServerManager.swift`)
- Server connection → Networking environment: uses services (evidence: `Sources/HANetworking/Sources/Server.swift`)
- Token management → Server connection: refreshes credentials (evidence: `Sources/HANetworking/Sources/TokenManager.swift`)
- Server connection → Home Assistant server: connects
- Pipeline mirror → Assist pipeline model: stores records (evidence: `Sources/Shared/Database/Tables/AssistPipelinesTable.swift`)
- Intent pipeline query → Assist pipeline model: reads pipeline model (evidence: `Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift`)
- Intent pipeline query → Pipeline mirror: fetches mirror (evidence: `Sources/Extensions/AppIntents/Assist/AssistPipelineEntityQuery.swift`)
- Pipeline picker → Assist pipeline model: selects pipeline (evidence: `Sources/App/Settings/MagicItem/AssistPipelinePicker.swift`)
- Assist service → Assist pipeline model: uses pipeline model (evidence: `Sources/Shared/Intents/AppIntent/AssistInApp/AssistService.swift`)
- Watch pipeline choices → Assist pipeline model: reads choices (evidence: `Sources/WatchApp/Home/Edit/WatchAssistPipelineOption.swift`)
- Watch communication → Assist service: invokes Assist (evidence: `Sources/Watch/WatchCommunicatorService.swift`)
- Push routes → Push controller: routes requests (evidence: `Sources/PushServer/Sources/App/routes.swift`)
- Push controller → Home Assistant server: sends push
