# bitwarden/clients architecture

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

- Interactive diagram: https://gitdiagram.com/bitwarden/clients
- Repository: https://github.com/bitwarden/clients

## Overview

This repository contains Bitwarden’s non-mobile client applications: browser extension, web app, desktop app, and CLI. The browser tree shows a user-facing authentication and autofill product, including page DOM discovery, browser-background coordination, and popup settings; the README identifies the related Bitwarden server as the backend. Other substantial capabilities visible in the tree include billing, vault search, importing, and organization risk insights. The graph preserves these product areas, but many implementation relationships are unverified because their source was not sampled; those links are dashed.

Main entry points: [`apps/browser/src/background/main.background.ts`](https://github.com/bitwarden/clients/blob/main/apps/browser/src/background/main.background.ts) (Browser extension), [`apps/browser/src/autofill/background/autofill-orchestrator.ts`](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/background/autofill-orchestrator.ts) (Autofill coordination), [`libs/storage-core/src/storage-service.provider.ts`](https://github.com/bitwarden/clients/blob/main/libs/storage-core/src/storage-service.provider.ts) (Client storage), [`apps/web/src/app/app.module.ts`](https://github.com/bitwarden/clients/blob/main/apps/web/src/app/app.module.ts) (Web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client apps"]
  node_browserapp["Browser extension<br/>[main.background.ts]"]
  node_webapp["Web app<br/>[app.module.ts]"]
  node_desktopapp["Desktop app"]
  node_cliapp["CLI<br/>[program.ts]"]
end

subgraph group_browser["Browser experience"]
  node_auth["Extension authentication"]
  node_autofill["Autofill coordination"]
  node_domquery["Page DOM discovery"]
  node_fill["Credential insertion"]
  node_overlay["Autofill overlays"]
  node_fido["Passkey support"]
  node_browserprefs["Autofill settings"]
end

subgraph group_shared["Shared capabilities"]
  node_vaultsearch["Vault search"]
  node_importer["Vault importing<br/>[import.service.ts]"]
  node_billing["Billing and plans"]
  node_storage["Client storage"]
end

subgraph group_organization["Organization insights"]
  node_riskorchestrator["Risk report orchestration"]
  node_riskreport["Risk report service"]
  node_riskmodels["Risk report models<br/>[report-models.ts]"]
end

node_user(("Client user"))
node_server["Bitwarden server"]

node_user -.->|"uses"| node_browserapp
node_user -.->|"uses"| node_webapp
node_user -.->|"uses"| node_desktopapp
node_user -.->|"uses"| node_cliapp
node_browserapp -.->|"provides"| node_auth
node_browserapp -.->|"coordinates"| node_autofill
node_autofill -.->|"queries pages"| node_domquery
node_autofill -.->|"requests insertion"| node_fill
node_autofill -.->|"coordinates UI"| node_overlay
node_browserapp -.->|"supports passkeys"| node_fido
node_user -.->|"configures"| node_browserprefs
node_domquery -->|"uses DOM utilities"| node_browserapp
node_user -.->|"searches vault"| node_vaultsearch
node_user -.->|"imports items"| node_importer
node_user -.->|"manages subscription"| node_billing
node_browserapp -.->|"stores client state"| node_storage
node_webapp -.->|"stores client state"| node_storage
node_desktopapp -.->|"stores client state"| node_storage
node_cliapp -.->|"stores client state"| node_storage
node_user -.->|"views reports"| node_riskorchestrator
node_riskorchestrator -->|"fetches report"| node_riskreport
node_riskorchestrator -->|"uses report state"| node_riskmodels
node_browserapp -.->|"connects to backend"| node_server
node_webapp -.->|"connects to backend"| node_server
node_desktopapp -.->|"connects to backend"| node_server
node_cliapp -.->|"connects to backend"| node_server

click node_browserapp "https://github.com/bitwarden/clients/blob/main/apps/browser/src/background/main.background.ts"
click node_webapp "https://github.com/bitwarden/clients/blob/main/apps/web/src/app/app.module.ts"
click node_desktopapp "https://github.com/bitwarden/clients/blob/main/apps/desktop/src/platform/main/electron-storage.service.ts"
click node_cliapp "https://github.com/bitwarden/clients/blob/main/apps/cli/src/program.ts"
click node_auth "https://github.com/bitwarden/clients/blob/main/apps/browser/src/auth/popup/login/extension-login-component.service.ts"
click node_autofill "https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/background/autofill-orchestrator.ts"
click node_domquery "https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/services/dom-query.service.ts"
click node_fill "https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/services/insert-autofill-content.service.ts"
click node_overlay "https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts"
click node_fido "https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/fido2/background/fido2.background.ts"
click node_browserprefs "https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/popup/settings/autofill.component.ts"
click node_vaultsearch "https://github.com/bitwarden/clients/blob/main/libs/common/src/vault/services/lunr-search.service.ts"
click node_importer "https://github.com/bitwarden/clients/blob/main/libs/importer/src/services/import.service.ts"
click node_billing "https://github.com/bitwarden/clients/blob/main/apps/web/src/app/billing/clients/invoice-preview.client.ts"
click node_storage "https://github.com/bitwarden/clients/blob/main/libs/storage-core/src/storage-service.provider.ts"
click node_riskorchestrator "https://github.com/bitwarden/clients/blob/main/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts"
click node_riskreport "https://github.com/bitwarden/clients/blob/main/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-report.service.ts"
click node_riskmodels "https://github.com/bitwarden/clients/blob/main/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/report-models.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_browserapp,node_webapp,node_desktopapp,node_cliapp,node_user toneBlue
class node_auth,node_autofill,node_domquery,node_fill,node_overlay,node_fido,node_browserprefs toneAmber
class node_vaultsearch,node_importer,node_billing,node_storage,node_server toneMint
class node_riskorchestrator,node_riskreport,node_riskmodels toneRose
```

## Components

### Client apps

- [Browser extension](https://github.com/bitwarden/clients/blob/main/apps/browser/src/background/main.background.ts): `apps/browser/src/background/main.background.ts`
- [Web app](https://github.com/bitwarden/clients/blob/main/apps/web/src/app/app.module.ts): `apps/web/src/app/app.module.ts`
- [Desktop app](https://github.com/bitwarden/clients/blob/main/apps/desktop/src/platform/main/electron-storage.service.ts): `apps/desktop/src/platform/main/electron-storage.service.ts`
- [CLI](https://github.com/bitwarden/clients/blob/main/apps/cli/src/program.ts): `apps/cli/src/program.ts`

### Browser experience

- [Extension authentication](https://github.com/bitwarden/clients/blob/main/apps/browser/src/auth/popup/login/extension-login-component.service.ts): `apps/browser/src/auth/popup/login/extension-login-component.service.ts`
- [Autofill coordination](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/background/autofill-orchestrator.ts): `apps/browser/src/autofill/background/autofill-orchestrator.ts`
- [Page DOM discovery](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/services/dom-query.service.ts): `apps/browser/src/autofill/services/dom-query.service.ts`
- [Credential insertion](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/services/insert-autofill-content.service.ts): `apps/browser/src/autofill/services/insert-autofill-content.service.ts`
- [Autofill overlays](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts): `apps/browser/src/autofill/overlay/inline-menu/content/autofill-inline-menu-content.service.ts`
- [Passkey support](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/fido2/background/fido2.background.ts): `apps/browser/src/autofill/fido2/background/fido2.background.ts`
- [Autofill settings](https://github.com/bitwarden/clients/blob/main/apps/browser/src/autofill/popup/settings/autofill.component.ts): `apps/browser/src/autofill/popup/settings/autofill.component.ts`

### Shared capabilities

- [Vault search](https://github.com/bitwarden/clients/blob/main/libs/common/src/vault/services/lunr-search.service.ts): `libs/common/src/vault/services/lunr-search.service.ts`
- [Vault importing](https://github.com/bitwarden/clients/blob/main/libs/importer/src/services/import.service.ts): `libs/importer/src/services/import.service.ts`
- [Billing and plans](https://github.com/bitwarden/clients/blob/main/apps/web/src/app/billing/clients/invoice-preview.client.ts): `apps/web/src/app/billing/clients/invoice-preview.client.ts`
- [Client storage](https://github.com/bitwarden/clients/blob/main/libs/storage-core/src/storage-service.provider.ts): `libs/storage-core/src/storage-service.provider.ts`

### Organization insights

- [Risk report orchestration](https://github.com/bitwarden/clients/blob/main/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts): `bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts`
- [Risk report service](https://github.com/bitwarden/clients/blob/main/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-report.service.ts): `bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-report.service.ts`
- [Risk report models](https://github.com/bitwarden/clients/blob/main/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/report-models.ts): `bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/report-models.ts`

### Other components

- **Client user**
- **Bitwarden server**

## Connections

- Client user → Browser extension: uses
- Client user → Web app: uses
- Client user → Desktop app: uses
- Client user → CLI: uses
- Browser extension → Extension authentication: provides
- Browser extension → Autofill coordination: coordinates
- Autofill coordination → Page DOM discovery: queries pages
- Autofill coordination → Credential insertion: requests insertion
- Autofill coordination → Autofill overlays: coordinates UI
- Browser extension → Passkey support: supports passkeys
- Client user → Autofill settings: configures
- Page DOM discovery → Browser extension: uses DOM utilities (evidence: `apps/browser/src/autofill/services/dom-query.service.ts`)
- Client user → Vault search: searches vault
- Client user → Vault importing: imports items
- Client user → Billing and plans: manages subscription
- Browser extension → Client storage: stores client state
- Web app → Client storage: stores client state
- Desktop app → Client storage: stores client state
- CLI → Client storage: stores client state
- Client user → Risk report orchestration: views reports
- Risk report orchestration → Risk report service: fetches report (evidence: `bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts`)
- Risk report orchestration → Risk report models: uses report state (evidence: `bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/domain/risk-insights-orchestrator.service.ts`)
- Browser extension → Bitwarden server: connects to backend (evidence: `README.md`)
- Web app → Bitwarden server: connects to backend (evidence: `README.md`)
- Desktop app → Bitwarden server: connects to backend (evidence: `README.md`)
- CLI → Bitwarden server: connects to backend (evidence: `README.md`)
