# mozilla-mobile/firefox-ios architecture

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

- Interactive diagram: https://gitdiagram.com/mozilla-mobile/firefox-ios
- Repository: https://github.com/mozilla-mobile/firefox-ios

## Overview

This monorepo contains Firefox for iOS and Focus for iOS, plus shared BrowserKit and Rust-component wrappers. A principal browser workflow is entering a URL or search, resolving it through search-engine handling, then loading it in the WebKit-backed engine; Firefox additionally has account and sync services, while Focus has its own search and content-blocking paths. The graph also preserves major shared capabilities visible in the tree, including Quick Answers and onboarding. Some edges are omitted or dashed because the supplied excerpts do not show their wiring.

Main entry points: [`firefox-ios/Client`](https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/Client) (Firefox app), [`firefox-ios/Providers`](https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/Providers) (Firefox profile), [`BrowserKit/Sources/WebEngine/WKWebview/WKEngineSession.swift`](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/WebEngine/WKWebview/WKEngineSession.swift) (Web engine session), [`firefox-ios/RustFxA/RustFirefoxAccounts.swift`](https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/RustFxA/RustFirefoxAccounts.swift) (Firefox accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["iOS apps"]
  node_firefox["Firefox app"]
  node_focus["Focus app"]
  node_share["Share extension"]
end

subgraph group_web["Browser runtime"]
  node_search["Firefox search manager"]
  node_focussearch["Focus search manager"]
  node_engine["Web engine session"]
  node_enginecontract["Engine session API"]
  node_contentblocking["Content blocking"]
end

subgraph group_services["Accounts and services"]
  node_searchprovider["Remote search provider"]
  node_profile[("Firefox profile")]
  node_accounts["Firefox accounts"]
  node_accountcore["Account components"]
  node_sync["Rust sync manager"]
  node_logins[("Login storage")]
  node_quickanswers["Quick Answers"]
  node_speech["Speech services"]
end

subgraph group_shared["Shared UI and platform"]
  node_prefs[("Preferences<br/>[Prefs.swift]")]
  node_onboarding["Onboarding"]
  node_components["UI components"]
  node_themes["Theming<br/>[ThemeManager.swift]"]
  node_container["Dependency container<br/>[AppContainer.swift]"]
  node_logger["Logging"]
end

node_user(("User"))

node_user -.->|"uses"| node_firefox
node_user -.->|"uses"| node_focus
node_firefox -.->|"manages search"| node_search
node_search -->|"loads engines"| node_searchprovider
node_search -->|"persists settings"| node_prefs
node_focus -.->|"manages search"| node_focussearch
node_focussearch -.->|"stores engine choices"| node_prefs
node_firefox -.->|"loads pages"| node_engine
node_focus -.->|"loads pages"| node_engine
node_engine -->|"implements"| node_enginecontract
node_engine -.->|"applies rules"| node_contentblocking
node_firefox -.->|"uses profile"| node_profile
node_profile -->|"delegates sync"| node_sync
node_profile -->|"uses account"| node_accounts
node_accounts -.->|"creates manager"| node_accountcore
node_sync -->|"uses account manager"| node_accounts
node_sync -->|"reads settings"| node_prefs
node_profile -.->|"provides login storage"| node_logins
node_quickanswers -.->|"uses transcription"| node_speech
node_firefox -.->|"offers answers"| node_quickanswers
node_firefox -.->|"presents onboarding"| node_onboarding
node_onboarding -.->|"uses controls"| node_components
node_firefox -.->|"shares content"| node_share
node_share -->|"starts account service"| node_accounts
node_firefox -.->|"configures services"| node_container
node_container -->|"provides dependencies"| node_searchprovider
node_themes -.->|"resolves dependencies"| node_container
node_logger -->|"records events"| node_logger

click node_firefox "https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/Client"
click node_focus "https://github.com/mozilla-mobile/firefox-ios/tree/main/focus-ios/Blockzilla"
click node_search "https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift"
click node_searchprovider "https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Client/Application/RemoteSettings/Application%20Services/ASSearchEngineProvider.swift"
click node_focussearch "https://github.com/mozilla-mobile/firefox-ios/blob/main/focus-ios/Blockzilla/Search/SearchEngineManager.swift"
click node_engine "https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/WebEngine/WKWebview/WKEngineSession.swift"
click node_enginecontract "https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/WebEngine/EngineSession.swift"
click node_profile "https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/Providers"
click node_prefs "https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Shared/Prefs.swift"
click node_accounts "https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/RustFxA/RustFirefoxAccounts.swift"
click node_accountcore "https://github.com/mozilla-mobile/firefox-ios/tree/main/MozillaRustComponents/Sources/MozillaRustComponentsWrapper/FxAClient"
click node_sync "https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Providers/RustSyncManager.swift"
click node_logins "https://github.com/mozilla-mobile/firefox-ios/blob/main/MozillaRustComponents/Sources/MozillaRustComponentsWrapper/Logins/LoginsStorage.swift"
click node_contentblocking "https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/ContentBlockingGenerator"
click node_quickanswers "https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/QuickAnswersKit"
click node_speech "https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/QuickAnswersKit/Backend/SpeechService"
click node_onboarding "https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/OnboardingKit"
click node_components "https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/ComponentLibrary"
click node_themes "https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Common/Theming/ThemeManager.swift"
click node_container "https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Common/DependencyInjection/AppContainer.swift"
click node_logger "https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Common/Logger/DefaultLogger.swift"
click node_share "https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Extensions/ShareTo/ShareViewController.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_firefox,node_focus,node_share,node_user toneBlue
class node_search,node_focussearch,node_engine,node_enginecontract,node_contentblocking toneAmber
class node_searchprovider,node_profile,node_accounts,node_accountcore,node_sync,node_logins,node_quickanswers,node_speech toneMint
class node_prefs,node_onboarding,node_components,node_themes,node_container,node_logger toneRose
```

## Components

### iOS apps

- [Firefox app](https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/Client): `firefox-ios/Client`
- [Focus app](https://github.com/mozilla-mobile/firefox-ios/tree/main/focus-ios/Blockzilla): `focus-ios/Blockzilla`
- [Share extension](https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Extensions/ShareTo/ShareViewController.swift): `firefox-ios/Extensions/ShareTo/ShareViewController.swift`

### Browser runtime

- [Firefox search manager](https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift): `firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift`
- [Focus search manager](https://github.com/mozilla-mobile/firefox-ios/blob/main/focus-ios/Blockzilla/Search/SearchEngineManager.swift): `focus-ios/Blockzilla/Search/SearchEngineManager.swift`
- [Web engine session](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/WebEngine/WKWebview/WKEngineSession.swift): `BrowserKit/Sources/WebEngine/WKWebview/WKEngineSession.swift`
- [Engine session API](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/WebEngine/EngineSession.swift): `BrowserKit/Sources/WebEngine/EngineSession.swift`
- [Content blocking](https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/ContentBlockingGenerator): `BrowserKit/Sources/ContentBlockingGenerator`

### Accounts and services

- [Remote search provider](https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Client/Application/RemoteSettings/Application%20Services/ASSearchEngineProvider.swift): `firefox-ios/Client/Application/RemoteSettings/Application Services/ASSearchEngineProvider.swift`
- [Firefox profile](https://github.com/mozilla-mobile/firefox-ios/tree/main/firefox-ios/Providers): `firefox-ios/Providers`
- [Firefox accounts](https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/RustFxA/RustFirefoxAccounts.swift): `firefox-ios/RustFxA/RustFirefoxAccounts.swift`
- [Account components](https://github.com/mozilla-mobile/firefox-ios/tree/main/MozillaRustComponents/Sources/MozillaRustComponentsWrapper/FxAClient): `MozillaRustComponents/Sources/MozillaRustComponentsWrapper/FxAClient`
- [Rust sync manager](https://github.com/mozilla-mobile/firefox-ios/blob/main/firefox-ios/Providers/RustSyncManager.swift): `firefox-ios/Providers/RustSyncManager.swift`
- [Login storage](https://github.com/mozilla-mobile/firefox-ios/blob/main/MozillaRustComponents/Sources/MozillaRustComponentsWrapper/Logins/LoginsStorage.swift): `MozillaRustComponents/Sources/MozillaRustComponentsWrapper/Logins/LoginsStorage.swift`
- [Quick Answers](https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/QuickAnswersKit): `BrowserKit/Sources/QuickAnswersKit`
- [Speech services](https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/QuickAnswersKit/Backend/SpeechService): `BrowserKit/Sources/QuickAnswersKit/Backend/SpeechService`

### Shared UI and platform

- [Preferences](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Shared/Prefs.swift): `BrowserKit/Sources/Shared/Prefs.swift`
- [Onboarding](https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/OnboardingKit): `BrowserKit/Sources/OnboardingKit`
- [UI components](https://github.com/mozilla-mobile/firefox-ios/tree/main/BrowserKit/Sources/ComponentLibrary): `BrowserKit/Sources/ComponentLibrary`
- [Theming](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Common/Theming/ThemeManager.swift): `BrowserKit/Sources/Common/Theming/ThemeManager.swift`
- [Dependency container](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Common/DependencyInjection/AppContainer.swift): `BrowserKit/Sources/Common/DependencyInjection/AppContainer.swift`
- [Logging](https://github.com/mozilla-mobile/firefox-ios/blob/main/BrowserKit/Sources/Common/Logger/DefaultLogger.swift): `BrowserKit/Sources/Common/Logger/DefaultLogger.swift`

### Other components

- **User**

## Connections

- User → Firefox app: uses (evidence: `README.md`)
- User → Focus app: uses (evidence: `README.md`)
- Firefox app → Firefox search manager: manages search (evidence: `firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift`)
- Firefox search manager → Remote search provider: loads engines (evidence: `firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift`)
- Firefox search manager → Preferences: persists settings (evidence: `firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift`)
- Focus app → Focus search manager: manages search (evidence: `focus-ios/Blockzilla/Settings/Controller/AddSearchEngineViewController.swift`)
- Focus search manager → Preferences: stores engine choices
- Firefox app → Web engine session: loads pages
- Focus app → Web engine session: loads pages
- Web engine session → Engine session API: implements (evidence: `BrowserKit/Sources/WebEngine/WKWebview/WKEngineSession.swift`)
- Web engine session → Content blocking: applies rules
- Firefox app → Firefox profile: uses profile (evidence: `firefox-ios/Client/Application/RemoteSettings/Application Services/ASSearchEngineProvider.swift`)
- Firefox profile → Rust sync manager: delegates sync (evidence: `firefox-ios/Providers/Profile.swift`)
- Firefox profile → Firefox accounts: uses account (evidence: `firefox-ios/Providers/Profile.swift`)
- Firefox accounts → Account components: creates manager (evidence: `firefox-ios/RustFxA/RustFirefoxAccounts.swift`)
- Rust sync manager → Firefox accounts: uses account manager (evidence: `firefox-ios/Providers/RustSyncManager.swift`)
- Rust sync manager → Preferences: reads settings (evidence: `firefox-ios/Providers/RustSyncManager.swift`)
- Firefox profile → Login storage: provides login storage
- Quick Answers → Speech services: uses transcription
- Firefox app → Quick Answers: offers answers
- Firefox app → Onboarding: presents onboarding
- Onboarding → UI components: uses controls
- Firefox app → Share extension: shares content
- Share extension → Firefox accounts: starts account service (evidence: `firefox-ios/Extensions/ShareTo/ShareViewController.swift`)
- Firefox app → Dependency container: configures services (evidence: `firefox-ios/Client/Frontend/Browser/SearchEngines/SearchEnginesManager.swift`)
- Dependency container → Remote search provider: provides dependencies (evidence: `firefox-ios/Client/Application/RemoteSettings/Application Services/ASSearchEngineProvider.swift`)
- Theming → Dependency container: resolves dependencies
- Logging → Logging: records events (evidence: `BrowserKit/Sources/Common/Logger/DefaultLogger.swift`)
