# bitwarden/web architecture

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

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

## Overview

##### Project type and purpose
- This is a single‐page Angular web application (“Bitwarden Web Vault”) that provides a front-end for the Bitwarden password manager.
- It is not a full back-end; it connects to external API services (identity, events, notifications) via configured proxies.

##### File structure
- Top-level config: Dockerfile, webpack.config.js, tsconfig.json, config/*.json for environment overrides, entrypoint.sh.
- Source code under two major trees:
- `src/` – main OSS Angular app with modules (accounts, vault, organizations, providers, reports, tools, settings) and assets (images, styles, locales, connectors).
- `bitwarden_license/src/` – a parallel Angular app for licensing UI.
- Shared JS library under `jslib` (common abstractions and environment definitions).
- Build and CI: GitHub Actions workflows, Docker, optimization scripts in `scripts/optimize.js`.

##### README
- Confirms Angular application for `vault.bitwarden.com`.
- Provides build/run commands, environment variable overrides for API endpoints.
- Mentions jslib URL type and localized support via Crowdin.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Browser / User Agent"
        Browser["Browser / User Agent"]:::browser
    end

    subgraph "Angular Web Vault (OSS)"
        AppModule["App Module"]:::service
        UI["UI Components & Layout"]:::ui
        subgraph "Feature Modules"
            Accounts["Accounts Module"]:::module
            Vault["Vault Module"]:::module
            Orgs["Organizations Module"]:::module
            Providers["Providers Module"]:::module
            Reports["Reports Module"]:::module
            Tools["Tools Module"]:::module
            Settings["Settings Module"]:::module
        end
        subgraph "Services Layer"
            HTTP["HTTP Services"]:::service
            State["State Management"]:::service
            Router["Router Service"]:::service
        end
        subgraph "Connectors"
            WebAuthn["WebAuthn Connector"]:::connector
            Duo["Duo Connector"]:::connector
            SSO["SSO Connector"]:::connector
            Captcha["Captcha Connector"]:::connector
        end
        Loc["Localization Service"]:::service
        Theme["Styling & Theming"]:::service
    end

    subgraph "Licensing UI Sub-App"
        LicApp["License App Module"]:::module
    end

    subgraph "External APIs"
        VaultAPI["Bitwarden API"]:::external
        Identity["Identity Service"]:::external
        Events["Events & Notifications Service"]:::external
    end

    subgraph "Build & CI Pipeline"
        Scripts["Optimization Script"]:::build
        Webpack["Webpack Build"]:::build
        Docker["Docker Container"]:::build
        CI["GitHub Actions CI/CD"]:::build
    end

    Browser --> UI
    UI --> HTTP
    HTTP --> VaultAPI
    HTTP --> Identity
    HTTP --> Events
    UI --> State
    State --> UI
    UI --> WebAuthn
    UI --> Duo
    UI --> SSO
    UI --> Captcha
    Loc -.-> UI
    Theme -.-> UI
    Scripts --> Webpack --> Docker --> Browser
    CI --> Docker
    LicApp --> HTTP

    click Accounts "https://github.com/bitwarden/web/tree/master/src/app/accounts"
    click Vault "https://github.com/bitwarden/web/tree/master/src/app/vault"
    click Orgs "https://github.com/bitwarden/web/tree/master/src/app/organizations"
    click Providers "https://github.com/bitwarden/web/tree/master/src/app/providers"
    click Reports "https://github.com/bitwarden/web/tree/master/src/app/reports"
    click Tools "https://github.com/bitwarden/web/tree/master/src/app/tools"
    click Settings "https://github.com/bitwarden/web/tree/master/src/app/settings"
    click AppModule "https://github.com/bitwarden/web/blob/master/src/app/app.module.ts"
    click HTTP "https://github.com/bitwarden/web/tree/master/src/app/services"
    click State "https://github.com/bitwarden/web/tree/master/src/services"
    click WebAuthn "https://github.com/bitwarden/web/tree/master/src/connectors"
    click Loc "https://github.com/bitwarden/web/tree/master/src/locales"
    click Theme "https://github.com/bitwarden/web/tree/master/src/scss"
    click LicApp "https://github.com/bitwarden/web/tree/master/bitwarden_license/src/app"
    click Webpack "https://github.com/bitwarden/web/blob/master/webpack.config.js"
    click Webpack "https://github.com/bitwarden/web/blob/master/bitwarden_license/webpack.config.js"
    click Scripts "https://github.com/bitwarden/web/blob/master/scripts/optimize.js"
    click Docker "https://github.com/bitwarden/web/tree/master/Dockerfile"
    click Docker "https://github.com/bitwarden/web/blob/master/entrypoint.sh"
    click CI "https://github.com/bitwarden/web/blob/master/.github/workflows/build.yml"
    click VaultAPI "https://github.com/bitwarden/web/blob/master/config/base.json"

    classDef browser fill:#E8F0FE,stroke:#4285F4
    classDef ui fill:#D1E8FF,stroke:#1A73E8
    classDef module fill:#A7D7C5,stroke:#107C41
    classDef service fill:#FDEBD0,stroke:#D68910
    classDef connector fill:#F9E79F,stroke:#B7950B
    classDef external fill:#F5B7B1,stroke:#C0392B,stroke-dasharray: 5 5
    classDef build fill:#D6EAF8,stroke:#2E86C1
```
