# avichaykagan/passwordsvault architecture

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

- Interactive diagram: https://gitdiagram.com/avichaykagan/passwordsvault
- Repository: https://github.com/avichaykagan/passwordsvault

## Overview

This is an interactive password-vault application. Its main workflow starts in the terminal, parses commands, and uses the shell to authenticate and perform vault operations; the vault encrypts its dictionary and persists it through the disk manager. The graph also includes password import, secure terminal I/O, and shared configuration. The README is empty, so capabilities are inferred from the sampled interfaces and source. Unsampled disk and shell behavior is represented only where the source index or excerpts support a relationship.

Main entry points: [`src/vault.cpp`](https://github.com/avichaykagan/passwordsvault/blob/main/src/vault.cpp) (Vault lifecycle and operations), [`src/shell.cpp`](https://github.com/avichaykagan/passwordsvault/blob/main/src/shell.cpp) (Command shell), [`src/crypt.cpp`](https://github.com/avichaykagan/passwordsvault/blob/main/src/crypt.cpp) (Cryptographic primitives), [`src/disk.cpp`](https://github.com/avichaykagan/passwordsvault/blob/main/src/disk.cpp) (Vault file manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Terminal interaction"]
  node_app_entry["Application entry<br/>[main.cpp]"]
  node_shell["Command shell<br/>[shell.cpp]"]
  node_parser["Command parser<br/>[parser.cpp]"]
  node_terminal_io["Secure terminal I/O<br/>[safe_io.hpp]"]
end

subgraph group_vault_domain["Vault operations"]
  node_vault["Vault lifecycle and operations<br/>[vault.cpp]"]
  node_dictionary["Password dictionary<br/>[dict.cpp]"]
end

subgraph group_secure_data["Secure data"]
  node_crypto["Cryptographic primitives<br/>[crypt.cpp]"]
  node_secure_memory["Secure variables<br/>[crypt.hpp]"]
  node_configuration["Vault configuration<br/>[configs.hpp]"]
end

subgraph group_persistence["Persistence"]
  node_import_batch["Import batch reader<br/>[disk.cpp]"]
  node_disk_manager[("Vault file manager<br/>[disk.cpp]")]
end

node_user(("Vault user"))

node_user -->|"enters input"| node_terminal_io
node_app_entry -->|"initializes"| node_crypto
node_app_entry -->|"starts"| node_shell
node_shell -->|"reads and displays"| node_terminal_io
node_shell -->|"parses commands"| node_parser
node_parser -->|"reads command metadata"| node_shell
node_shell -->|"dispatches operations"| node_vault
node_vault -->|"hashes and encrypts"| node_crypto
node_vault -->|"updates and packs"| node_dictionary
node_vault -->|"reads and writes"| node_disk_manager
node_vault -->|"loads import batch"| node_import_batch
node_import_batch -.->|"reads vault file"| node_disk_manager
node_crypto -.->|"implements operations"| node_secure_memory
node_vault -.->|"uses limits and errors"| node_configuration
node_disk_manager -.->|"uses vault paths"| node_configuration

click node_app_entry "https://github.com/avichaykagan/passwordsvault/blob/main/src/main.cpp"
click node_shell "https://github.com/avichaykagan/passwordsvault/blob/main/src/shell.cpp"
click node_parser "https://github.com/avichaykagan/passwordsvault/blob/main/src/parser.cpp"
click node_terminal_io "https://github.com/avichaykagan/passwordsvault/blob/main/include/safe_io.hpp"
click node_vault "https://github.com/avichaykagan/passwordsvault/blob/main/src/vault.cpp"
click node_dictionary "https://github.com/avichaykagan/passwordsvault/blob/main/src/dict.cpp"
click node_import_batch "https://github.com/avichaykagan/passwordsvault/blob/main/src/disk.cpp"
click node_disk_manager "https://github.com/avichaykagan/passwordsvault/blob/main/src/disk.cpp"
click node_crypto "https://github.com/avichaykagan/passwordsvault/blob/main/src/crypt.cpp"
click node_secure_memory "https://github.com/avichaykagan/passwordsvault/blob/main/include/crypt.hpp"
click node_configuration "https://github.com/avichaykagan/passwordsvault/blob/main/include/configs.hpp"

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_entry,node_shell,node_parser,node_terminal_io,node_user toneBlue
class node_vault,node_dictionary toneAmber
class node_crypto,node_secure_memory,node_configuration toneMint
class node_import_batch,node_disk_manager toneRose
```

## Components

### Terminal interaction

- [Application entry](https://github.com/avichaykagan/passwordsvault/blob/main/src/main.cpp): `src/main.cpp`
- [Command shell](https://github.com/avichaykagan/passwordsvault/blob/main/src/shell.cpp): `src/shell.cpp`
- [Command parser](https://github.com/avichaykagan/passwordsvault/blob/main/src/parser.cpp): `src/parser.cpp`
- [Secure terminal I/O](https://github.com/avichaykagan/passwordsvault/blob/main/include/safe_io.hpp): `include/safe_io.hpp`

### Vault operations

- [Vault lifecycle and operations](https://github.com/avichaykagan/passwordsvault/blob/main/src/vault.cpp): `src/vault.cpp`
- [Password dictionary](https://github.com/avichaykagan/passwordsvault/blob/main/src/dict.cpp): `src/dict.cpp`

### Secure data

- [Cryptographic primitives](https://github.com/avichaykagan/passwordsvault/blob/main/src/crypt.cpp): `src/crypt.cpp`
- [Secure variables](https://github.com/avichaykagan/passwordsvault/blob/main/include/crypt.hpp): `include/crypt.hpp`
- [Vault configuration](https://github.com/avichaykagan/passwordsvault/blob/main/include/configs.hpp): `include/configs.hpp`

### Persistence

- [Import batch reader](https://github.com/avichaykagan/passwordsvault/blob/main/src/disk.cpp): `src/disk.cpp`
- [Vault file manager](https://github.com/avichaykagan/passwordsvault/blob/main/src/disk.cpp): `src/disk.cpp`

### Other components

- **Vault user**

## Connections

- Vault user → Secure terminal I/O: enters input
- Application entry → Cryptographic primitives: initializes (evidence: `src/main.cpp`)
- Application entry → Command shell: starts (evidence: `src/main.cpp`)
- Command shell → Secure terminal I/O: reads and displays (evidence: `src/shell.cpp`)
- Command shell → Command parser: parses commands (evidence: `src/shell.cpp`)
- Command parser → Command shell: reads command metadata (evidence: `src/parser.cpp`)
- Command shell → Vault lifecycle and operations: dispatches operations (evidence: `src/shell.cpp`)
- Vault lifecycle and operations → Cryptographic primitives: hashes and encrypts (evidence: `src/vault.cpp`)
- Vault lifecycle and operations → Password dictionary: updates and packs (evidence: `src/vault.cpp`)
- Vault lifecycle and operations → Vault file manager: reads and writes (evidence: `src/vault.cpp`)
- Vault lifecycle and operations → Import batch reader: loads import batch (evidence: `src/vault.cpp`)
- Import batch reader → Vault file manager: reads vault file (evidence: `src/disk.cpp`)
- Cryptographic primitives → Secure variables: implements operations (evidence: `src/crypt.cpp`)
- Vault lifecycle and operations → Vault configuration: uses limits and errors
- Vault file manager → Vault configuration: uses vault paths
