# sansyourways/sans_password_manager architecture

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

- Interactive diagram: https://gitdiagram.com/sansyourways/sans_password_manager
- Repository: https://github.com/sansyourways/sans_password_manager

## Overview

SPM is a local-first password manager whose shared Python core protects and mutates the encrypted vault. The primary workflow is to unlock locally, retrieve a domain-bound credential, and fill it through the CLI/dashboard or browser extension; browser requests pass through a native-messaging host. The README also documents recovery, import/export, sync, plugins, automation scopes, and dashboard features. Those unsampled capabilities are represented at their supported source-directory level; their internal links are omitted where excerpts do not establish callers.

Main entry points: [`src/spm_core.py`](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py) (Vault Operations), [`browser-extension-universal/background.js`](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/background.js) (Extension Coordinator), [`browser-extension-universal/content.js`](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/content.js) (Page Detection and Capture), [`src/spm_web_server.py`](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_web_server.py) (Web Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vault["Vault Core"]
  node_core["Vault Operations<br/>[spm_core.py]"]
  node_vaultfile[("Encrypted Vault")]
end

subgraph group_interfaces["User Interfaces"]
  node_cli["CLI and TUI<br/>[spm.sh.in]"]
  node_dashboard["Web Dashboard<br/>[spm_web_server.py]"]
  node_organization["Search and Organization"]
  node_locales["Dashboard Languages"]
end

subgraph group_extension["Browser Extension"]
  node_content["Page Detection and Capture<br/>[content.js]"]
  node_background["Extension Coordinator<br/>[background.js]"]
  node_menu["Account Picker<br/>[menu.js]"]
  node_popup["Extension Popup<br/>[popup.js]"]
  node_fill["Form Fill and Generation<br/>[fill.js]"]
  node_host["Native Messaging Host<br/>[native_host.py]"]
end

subgraph group_security["Security and Recovery"]
  node_history["History and Backups<br/>[spm_core.py]"]
  node_recovery["Recovery and Shares<br/>[spm_core.py]"]
  node_securitykeys["Security Keys<br/>[spm_core.py]"]
end

subgraph group_ecosystem["Data and Extensions"]
  node_dataflows["Import and Export"]
  node_sync["Encrypted Sync"]
  node_plugins["Plugin SDK"]
  node_automation["Secret Scopes and Run"]
end

node_user(("User"))
node_hibp["Breach Review API"]
node_browser(("Browser Page"))

node_user -->|"uses"| node_cli
node_user -->|"uses"| node_dashboard
node_user -->|"uses"| node_popup
node_cli -->|"invokes"| node_core
node_dashboard -->|"imports"| node_core
node_core -->|"reads and writes"| node_vaultfile
node_core -.->|"archives and backs up"| node_history
node_core -.->|"recovers"| node_recovery
node_core -.->|"uses"| node_securitykeys
node_core -.->|"checks hashes"| node_hibp
node_browser -->|"hosts scripts"| node_content
node_content -->|"messages"| node_background
node_background -->|"requests"| node_host
node_host -->|"runs bridge commands"| node_core
node_background -->|"loads account list"| node_menu
node_background -->|"requests credential fill"| node_content
node_content -.->|"fills fields"| node_fill
node_popup -->|"requests session"| node_background
node_popup -->|"injects fill function"| node_fill
node_user -->|"imports or exports"| node_dataflows
node_user -->|"configures transport"| node_sync
node_user -->|"consents to plugins"| node_plugins
node_user -->|"runs scoped secrets"| node_automation
node_user -->|"searches and filters"| node_organization
node_dashboard -.->|"supports languages"| node_locales

click node_cli "https://github.com/sansyourways/sans_password_manager/blob/main/src/spm.sh.in"
click node_dashboard "https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_web_server.py"
click node_core "https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py"
click node_history "https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py"
click node_recovery "https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py"
click node_securitykeys "https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py"
click node_content "https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/content.js"
click node_background "https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/background.js"
click node_menu "https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/menu.js"
click node_popup "https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/popup.js"
click node_fill "https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/fill.js"
click node_host "https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/native_host.py"
click node_dataflows "https://github.com/sansyourways/sans_password_manager/tree/main/src"
click node_sync "https://github.com/sansyourways/sans_password_manager/tree/main/src"
click node_plugins "https://github.com/sansyourways/sans_password_manager/tree/main/src"
click node_automation "https://github.com/sansyourways/sans_password_manager/tree/main/src"
click node_organization "https://github.com/sansyourways/sans_password_manager/tree/main/src"
click node_locales "https://github.com/sansyourways/sans_password_manager/tree/main/locales"

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_core,node_vaultfile,node_user,node_hibp,node_browser toneBlue
class node_cli,node_dashboard,node_organization,node_locales toneAmber
class node_content,node_background,node_menu,node_popup,node_fill,node_host toneMint
class node_history,node_recovery,node_securitykeys toneRose
class node_dataflows,node_sync,node_plugins,node_automation toneIndigo
```

## Components

### Vault Core

- [Vault Operations](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py): `src/spm_core.py`
- **Encrypted Vault**

### User Interfaces

- [CLI and TUI](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm.sh.in): `src/spm.sh.in`
- [Web Dashboard](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_web_server.py): `src/spm_web_server.py`
- [Search and Organization](https://github.com/sansyourways/sans_password_manager/tree/main/src): `src`
- [Dashboard Languages](https://github.com/sansyourways/sans_password_manager/tree/main/locales): `locales`

### Browser Extension

- [Page Detection and Capture](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/content.js): `browser-extension-universal/content.js`
- [Extension Coordinator](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/background.js): `browser-extension-universal/background.js`
- [Account Picker](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/menu.js): `browser-extension-universal/menu.js`
- [Extension Popup](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/popup.js): `browser-extension-universal/popup.js`
- [Form Fill and Generation](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/fill.js): `browser-extension-universal/fill.js`
- [Native Messaging Host](https://github.com/sansyourways/sans_password_manager/blob/main/browser-extension-universal/native_host.py): `browser-extension-universal/native_host.py`

### Security and Recovery

- [History and Backups](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py): `src/spm_core.py`
- [Recovery and Shares](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py): `src/spm_core.py`
- [Security Keys](https://github.com/sansyourways/sans_password_manager/blob/main/src/spm_core.py): `src/spm_core.py`

### Data and Extensions

- [Import and Export](https://github.com/sansyourways/sans_password_manager/tree/main/src): `src`
- [Encrypted Sync](https://github.com/sansyourways/sans_password_manager/tree/main/src): `src`
- [Plugin SDK](https://github.com/sansyourways/sans_password_manager/tree/main/src): `src`
- [Secret Scopes and Run](https://github.com/sansyourways/sans_password_manager/tree/main/src): `src`

### Other components

- **User**
- **Breach Review API**
- **Browser Page**

## Connections

- User → CLI and TUI: uses (evidence: `README.md`)
- User → Web Dashboard: uses (evidence: `README.md`)
- User → Extension Popup: uses (evidence: `README.md`)
- CLI and TUI → Vault Operations: invokes (evidence: `README.md`)
- Web Dashboard → Vault Operations: imports (evidence: `src/spm_core.py`)
- Vault Operations → Encrypted Vault: reads and writes (evidence: `src/spm_core.py`)
- Vault Operations → History and Backups: archives and backs up (evidence: `src/spm_core.py`)
- Vault Operations → Recovery and Shares: recovers (evidence: `src/spm_core.py`)
- Vault Operations → Security Keys: uses (evidence: `src/spm_core.py`)
- Vault Operations → Breach Review API: checks hashes (evidence: `README.md`)
- Browser Page → Page Detection and Capture: hosts scripts (evidence: `browser-extension-universal/content.js`)
- Page Detection and Capture → Extension Coordinator: messages (evidence: `browser-extension-universal/content.js`)
- Extension Coordinator → Native Messaging Host: requests (evidence: `browser-extension-universal/background.js`)
- Native Messaging Host → Vault Operations: runs bridge commands (evidence: `browser-extension-universal/native_host.py`)
- Extension Coordinator → Account Picker: loads account list (evidence: `browser-extension-universal/menu.js`)
- Extension Coordinator → Page Detection and Capture: requests credential fill (evidence: `browser-extension-universal/background.js`)
- Page Detection and Capture → Form Fill and Generation: fills fields
- Extension Popup → Extension Coordinator: requests session (evidence: `browser-extension-universal/popup.js`)
- Extension Popup → Form Fill and Generation: injects fill function (evidence: `browser-extension-universal/popup.js`)
- User → Import and Export: imports or exports (evidence: `README.md`)
- User → Encrypted Sync: configures transport (evidence: `README.md`)
- User → Plugin SDK: consents to plugins (evidence: `README.md`)
- User → Secret Scopes and Run: runs scoped secrets (evidence: `README.md`)
- User → Search and Organization: searches and filters (evidence: `README.md`)
- Web Dashboard → Dashboard Languages: supports languages
