# tentex1/passsafe architecture

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

- Interactive diagram: https://gitdiagram.com/tentex1/passsafe
- Repository: https://github.com/tentex1/passsafe

## Overview

PassSafe is an offline .NET MAUI password manager. The principal workflow authenticates the user, checks or creates the master password, opens the encrypted vault, and displays and manages saved credentials. Separate workflows analyze password strength, generate passwords, configure security and appearance, and export or verify imported encrypted backups. The graph reflects the shown view-model/service wiring and README capabilities; several feature implementations are represented by their exact tree paths, but their internal calls were not sampled.

Main entry points: [`PassSafe/Services/DatabaseService.cs`](https://github.com/tentex1/passsafe/blob/master/PassSafe/Services/DatabaseService.cs) (Encrypted Database), [`PassSafe/ViewModels/SettingsViewModel.cs`](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/SettingsViewModel.cs) (Preferences And Backup), [`PassSafe/ViewModels/SafeViewModel.cs`](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/SafeViewModel.cs) (Vault Browsing), [`PassSafe/ViewModels/PassAnalyzerViewModel.cs`](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/PassAnalyzerViewModel.cs) (Password Analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App Entry"]
  node_screens["App Screens"]
  node_mainvm["Launch Authentication<br/>[MainViewModel.cs]"]
  node_biometric["Device Biometrics"]
end

subgraph group_vault["Vault Security"]
  node_safevm["Vault Browsing<br/>[SafeViewModel.cs]"]
  node_dbservice["Encrypted Database<br/>[DatabaseService.cs]"]
  node_vaultfile[("SQLCipher Vault")]
  node_crypto["AES-GCM Crypto"]
  node_password["Password Records<br/>[Password.cs]"]
  node_addvm["Credential Editing"]
end

subgraph group_features["Password Features"]
  node_analyzer["Password Analyzer"]
  node_analysismodels["Analysis Results<br/>[AnalysisCard.cs]"]
  node_criticalactions["Risk Actions<br/>[CriticalAction.cs]"]
  node_generator["Password Generator"]
end

subgraph group_preferences["Settings And Backup"]
  node_settings["Preferences And Backup"]
  node_importverify["Backup Verification"]
  node_importmessage["Import Notification"]
  node_localization["Live Localization"]
  node_localfiles[("Local Backup Files")]
end

node_user(("User"))

node_user -->|"uses"| node_screens
node_screens -->|"binds"| node_mainvm
node_mainvm -->|"authenticates"| node_biometric
node_mainvm -->|"initializes"| node_dbservice
node_mainvm -->|"loads vault"| node_safevm
node_safevm -->|"reads records"| node_dbservice
node_safevm -->|"decrypts"| node_crypto
node_dbservice -->|"reads and writes"| node_vaultfile
node_dbservice -->|"stores"| node_password
node_safevm -->|"opens editor"| node_addvm
node_analyzer -->|"reads vault"| node_dbservice
node_analyzer -->|"decrypts"| node_crypto
node_analyzer -->|"builds cards"| node_analysismodels
node_analyzer -->|"builds actions"| node_criticalactions
node_generator -->|"loads generated"| node_addvm
node_settings -->|"updates records"| node_dbservice
node_settings -->|"re-encrypts"| node_crypto
node_settings -->|"exports and imports"| node_localfiles
node_importverify -->|"verifies vault"| node_dbservice
node_importverify -->|"sends"| node_importmessage
node_safevm -->|"refreshes on"| node_importmessage
node_settings -->|"changes language"| node_localization
node_settings -->|"starts verification"| node_importverify

click node_screens "https://github.com/tentex1/passsafe/tree/master/PassSafe/Views"
click node_mainvm "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/MainViewModel.cs"
click node_safevm "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/SafeViewModel.cs"
click node_dbservice "https://github.com/tentex1/passsafe/blob/master/PassSafe/Services/DatabaseService.cs"
click node_crypto "https://github.com/tentex1/passsafe/blob/master/PassSafe/Services/AesCryptoService.cs"
click node_password "https://github.com/tentex1/passsafe/blob/master/PassSafe/Models/Password.cs"
click node_addvm "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/AddPasswordViewModel.cs"
click node_analyzer "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/PassAnalyzerViewModel.cs"
click node_analysismodels "https://github.com/tentex1/passsafe/blob/master/PassSafe/Models/AnalysisCard.cs"
click node_criticalactions "https://github.com/tentex1/passsafe/blob/master/PassSafe/Models/CriticalAction.cs"
click node_generator "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/PassGeneratorViewModel.cs"
click node_settings "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/SettingsViewModel.cs"
click node_importverify "https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/ImportDatabaseVerifyViewModel.cs"
click node_importmessage "https://github.com/tentex1/passsafe/blob/master/PassSafe/Messages/DatabaseImportedMessage.cs"
click node_localization "https://github.com/tentex1/passsafe/blob/master/PassSafe/Helpers/LocalizationManager.cs"

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_screens,node_mainvm,node_biometric,node_user toneBlue
class node_safevm,node_dbservice,node_vaultfile,node_crypto,node_password,node_addvm toneAmber
class node_analyzer,node_analysismodels,node_criticalactions,node_generator toneMint
class node_settings,node_importverify,node_importmessage,node_localization,node_localfiles toneRose
```

## Components

### App Entry

- [App Screens](https://github.com/tentex1/passsafe/tree/master/PassSafe/Views): `PassSafe/Views`
- [Launch Authentication](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/MainViewModel.cs): `PassSafe/ViewModels/MainViewModel.cs`
- **Device Biometrics**

### Vault Security

- [Vault Browsing](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/SafeViewModel.cs): `PassSafe/ViewModels/SafeViewModel.cs`
- [Encrypted Database](https://github.com/tentex1/passsafe/blob/master/PassSafe/Services/DatabaseService.cs): `PassSafe/Services/DatabaseService.cs`
- **SQLCipher Vault**
- [AES-GCM Crypto](https://github.com/tentex1/passsafe/blob/master/PassSafe/Services/AesCryptoService.cs): `PassSafe/Services/AesCryptoService.cs`
- [Password Records](https://github.com/tentex1/passsafe/blob/master/PassSafe/Models/Password.cs): `PassSafe/Models/Password.cs`
- [Credential Editing](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/AddPasswordViewModel.cs): `PassSafe/ViewModels/AddPasswordViewModel.cs`

### Password Features

- [Password Analyzer](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/PassAnalyzerViewModel.cs): `PassSafe/ViewModels/PassAnalyzerViewModel.cs`
- [Analysis Results](https://github.com/tentex1/passsafe/blob/master/PassSafe/Models/AnalysisCard.cs): `PassSafe/Models/AnalysisCard.cs`
- [Risk Actions](https://github.com/tentex1/passsafe/blob/master/PassSafe/Models/CriticalAction.cs): `PassSafe/Models/CriticalAction.cs`
- [Password Generator](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/PassGeneratorViewModel.cs): `PassSafe/ViewModels/PassGeneratorViewModel.cs`

### Settings And Backup

- [Preferences And Backup](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/SettingsViewModel.cs): `PassSafe/ViewModels/SettingsViewModel.cs`
- [Backup Verification](https://github.com/tentex1/passsafe/blob/master/PassSafe/ViewModels/ImportDatabaseVerifyViewModel.cs): `PassSafe/ViewModels/ImportDatabaseVerifyViewModel.cs`
- [Import Notification](https://github.com/tentex1/passsafe/blob/master/PassSafe/Messages/DatabaseImportedMessage.cs): `PassSafe/Messages/DatabaseImportedMessage.cs`
- [Live Localization](https://github.com/tentex1/passsafe/blob/master/PassSafe/Helpers/LocalizationManager.cs): `PassSafe/Helpers/LocalizationManager.cs`
- **Local Backup Files**

### Other components

- **User**

## Connections

- User → App Screens: uses (evidence: `README.md`)
- App Screens → Launch Authentication: binds (evidence: `PassSafe/Views/MainPage.xaml.cs`)
- Launch Authentication → Device Biometrics: authenticates (evidence: `PassSafe/ViewModels/MainViewModel.cs`)
- Launch Authentication → Encrypted Database: initializes (evidence: `PassSafe/ViewModels/MainViewModel.cs`)
- Launch Authentication → Vault Browsing: loads vault (evidence: `PassSafe/ViewModels/MainViewModel.cs`)
- Vault Browsing → Encrypted Database: reads records (evidence: `PassSafe/ViewModels/SafeViewModel.cs`)
- Vault Browsing → AES-GCM Crypto: decrypts (evidence: `PassSafe/ViewModels/SafeViewModel.cs`)
- Encrypted Database → SQLCipher Vault: reads and writes (evidence: `PassSafe/Services/DatabaseService.cs`)
- Encrypted Database → Password Records: stores (evidence: `PassSafe/Services/DatabaseService.cs`)
- Vault Browsing → Credential Editing: opens editor (evidence: `PassSafe/ViewModels/SafeViewModel.cs`)
- Password Analyzer → Encrypted Database: reads vault (evidence: `PassSafe/ViewModels/PassAnalyzerViewModel.cs`)
- Password Analyzer → AES-GCM Crypto: decrypts (evidence: `PassSafe/ViewModels/PassAnalyzerViewModel.cs`)
- Password Analyzer → Analysis Results: builds cards (evidence: `PassSafe/ViewModels/PassAnalyzerViewModel.cs`)
- Password Analyzer → Risk Actions: builds actions (evidence: `PassSafe/ViewModels/PassAnalyzerViewModel.cs`)
- Password Generator → Credential Editing: loads generated (evidence: `PassSafe/ViewModels/PassGeneratorViewModel.cs`)
- Preferences And Backup → Encrypted Database: updates records (evidence: `PassSafe/ViewModels/SettingsViewModel.cs`)
- Preferences And Backup → AES-GCM Crypto: re-encrypts (evidence: `PassSafe/ViewModels/SettingsViewModel.cs`)
- Preferences And Backup → Local Backup Files: exports and imports (evidence: `PassSafe/ViewModels/SettingsViewModel.cs`)
- Backup Verification → Encrypted Database: verifies vault (evidence: `PassSafe/ViewModels/ImportDatabaseVerifyViewModel.cs`)
- Backup Verification → Import Notification: sends (evidence: `PassSafe/ViewModels/ImportDatabaseVerifyViewModel.cs`)
- Vault Browsing → Import Notification: refreshes on (evidence: `PassSafe/ViewModels/SafeViewModel.cs`)
- Preferences And Backup → Live Localization: changes language (evidence: `PassSafe/Helpers/LocalizationManager.cs`)
- Preferences And Backup → Backup Verification: starts verification (evidence: `PassSafe/ViewModels/SettingsViewModel.cs`)
