# privonfoundation/privonvault architecture

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

- Interactive diagram: https://gitdiagram.com/privonfoundation/privonvault
- Repository: https://github.com/privonfoundation/privonvault

## Overview

Privon Vault is a client-side encrypted file vault combining file management with gallery, music, document, backup, and privacy controls. The principal flow is user authentication and key setup, followed by access to the dashboard and its file-focused views; crypto operations are exposed through a TypeScript wrapper over the Rust crypto core, while vault data is handled through the database layer. The sampled sources confirm authentication/key operations and crypto implementations, but not the database internals or most dashboard wiring; those relationships are therefore kept high-level.

Main entry points: [`components/Dashboard.tsx`](https://github.com/privonfoundation/privonvault/blob/main/components/Dashboard.tsx) (Dashboard), [`crypto-core/src/lib.rs`](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/lib.rs) (Rust crypto core), [`App.tsx`](https://github.com/privonfoundation/privonvault/blob/main/App.tsx) (App coordinator), [`crypto-core/index.ts`](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/index.ts) (Crypto API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthScreen.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_landing["Landing<br/>[LandingPage.tsx]"]
end

subgraph group_vault["Vault features"]
  node_vaultview["Vault files<br/>[VaultView.tsx]"]
  node_gallery["Gallery<br/>[GalleryView.tsx]"]
  node_music["Music player<br/>[MusicView.tsx]"]
  node_search["Search<br/>[SearchView.tsx]"]
  node_trash["Trash<br/>[TrashView.tsx]"]
  node_storageview["Storage view<br/>[StorageView.tsx]"]
  node_settings["Settings<br/>[SettingsView.tsx]"]
  node_backup["Backup<br/>[BackupView.tsx]"]
  node_fileactions["File actions<br/>[FileActionMenu.tsx]"]
end

subgraph group_security["Security and crypto"]
  node_cryptoapi["Crypto API<br/>[index.ts]"]
  node_cryptors["Rust crypto core<br/>[lib.rs]"]
  node_keywrap["Key wrapping<br/>[key_wrapping.rs]"]
  node_metadata["Metadata encryption<br/>[metadata_crypto.rs]"]
  node_stream["Streaming crypto<br/>[stream.rs]"]
  node_backupcrypto["Backup crypto<br/>[backup_crypto.rs]"]
end

subgraph group_runtime["Local runtime"]
  node_db[("Vault database<br/>[db.ts]")]
  node_tauri["Tauri bridge<br/>[lib.rs]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"shows"| node_auth
node_app -->|"shows after unlock"| node_dashboard
node_auth -->|"derives and unwraps keys"| node_cryptoapi
node_auth -->|"sets vault key"| node_db
node_app -->|"clears on wipe"| node_db
node_dashboard -->|"presents"| node_vaultview
node_dashboard -->|"presents"| node_gallery
node_dashboard -->|"presents"| node_music
node_dashboard -->|"presents"| node_search
node_dashboard -->|"presents"| node_trash
node_dashboard -->|"presents"| node_storageview
node_dashboard -->|"presents"| node_settings
node_dashboard -->|"presents"| node_backup
node_vaultview -->|"offers actions"| node_fileactions
node_cryptoapi -->|"calls crypto bindings"| node_cryptors
node_cryptors -->|"uses"| node_keywrap
node_cryptors -->|"uses"| node_metadata
node_cryptors -->|"uses"| node_stream
node_cryptors -->|"uses"| node_backupcrypto
node_backup -->|"requests backup crypto"| node_cryptoapi
node_fileactions -->|"requests file crypto"| node_cryptoapi
node_tauri -.->|"exposes native commands"| node_cryptors

click node_app "https://github.com/privonfoundation/privonvault/blob/main/App.tsx"
click node_auth "https://github.com/privonfoundation/privonvault/blob/main/components/AuthScreen.tsx"
click node_dashboard "https://github.com/privonfoundation/privonvault/blob/main/components/Dashboard.tsx"
click node_landing "https://github.com/privonfoundation/privonvault/blob/main/components/LandingPage.tsx"
click node_vaultview "https://github.com/privonfoundation/privonvault/blob/main/components/views/VaultView.tsx"
click node_gallery "https://github.com/privonfoundation/privonvault/blob/main/components/views/GalleryView.tsx"
click node_music "https://github.com/privonfoundation/privonvault/blob/main/components/views/MusicView.tsx"
click node_search "https://github.com/privonfoundation/privonvault/blob/main/components/views/SearchView.tsx"
click node_trash "https://github.com/privonfoundation/privonvault/blob/main/components/views/TrashView.tsx"
click node_storageview "https://github.com/privonfoundation/privonvault/blob/main/components/views/StorageView.tsx"
click node_settings "https://github.com/privonfoundation/privonvault/blob/main/components/views/SettingsView.tsx"
click node_backup "https://github.com/privonfoundation/privonvault/blob/main/components/views/BackupView.tsx"
click node_fileactions "https://github.com/privonfoundation/privonvault/blob/main/components/FileActionMenu.tsx"
click node_cryptoapi "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/index.ts"
click node_cryptors "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/lib.rs"
click node_keywrap "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/key_wrapping.rs"
click node_metadata "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/metadata_crypto.rs"
click node_stream "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/stream.rs"
click node_backupcrypto "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/backup_crypto.rs"
click node_db "https://github.com/privonfoundation/privonvault/blob/main/crypto-core/db.ts"
click node_tauri "https://github.com/privonfoundation/privonvault/blob/main/src-tauri/src/lib.rs"

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,node_auth,node_dashboard,node_landing,node_user toneBlue
class node_vaultview,node_gallery,node_music,node_search,node_trash,node_storageview,node_settings,node_backup,node_fileactions toneAmber
class node_cryptoapi,node_cryptors,node_keywrap,node_metadata,node_stream,node_backupcrypto toneMint
class node_db,node_tauri toneRose
```

## Components

### App experience

- [App coordinator](https://github.com/privonfoundation/privonvault/blob/main/App.tsx): `App.tsx`
- [Authentication](https://github.com/privonfoundation/privonvault/blob/main/components/AuthScreen.tsx): `components/AuthScreen.tsx`
- [Dashboard](https://github.com/privonfoundation/privonvault/blob/main/components/Dashboard.tsx): `components/Dashboard.tsx`
- [Landing](https://github.com/privonfoundation/privonvault/blob/main/components/LandingPage.tsx): `components/LandingPage.tsx`

### Vault features

- [Vault files](https://github.com/privonfoundation/privonvault/blob/main/components/views/VaultView.tsx): `components/views/VaultView.tsx`
- [Gallery](https://github.com/privonfoundation/privonvault/blob/main/components/views/GalleryView.tsx): `components/views/GalleryView.tsx`
- [Music player](https://github.com/privonfoundation/privonvault/blob/main/components/views/MusicView.tsx): `components/views/MusicView.tsx`
- [Search](https://github.com/privonfoundation/privonvault/blob/main/components/views/SearchView.tsx): `components/views/SearchView.tsx`
- [Trash](https://github.com/privonfoundation/privonvault/blob/main/components/views/TrashView.tsx): `components/views/TrashView.tsx`
- [Storage view](https://github.com/privonfoundation/privonvault/blob/main/components/views/StorageView.tsx): `components/views/StorageView.tsx`
- [Settings](https://github.com/privonfoundation/privonvault/blob/main/components/views/SettingsView.tsx): `components/views/SettingsView.tsx`
- [Backup](https://github.com/privonfoundation/privonvault/blob/main/components/views/BackupView.tsx): `components/views/BackupView.tsx`
- [File actions](https://github.com/privonfoundation/privonvault/blob/main/components/FileActionMenu.tsx): `components/FileActionMenu.tsx`

### Security and crypto

- [Crypto API](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/index.ts): `crypto-core/index.ts`
- [Rust crypto core](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/lib.rs): `crypto-core/src/lib.rs`
- [Key wrapping](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/key_wrapping.rs): `crypto-core/src/key_wrapping.rs`
- [Metadata encryption](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/metadata_crypto.rs): `crypto-core/src/metadata_crypto.rs`
- [Streaming crypto](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/stream.rs): `crypto-core/src/stream.rs`
- [Backup crypto](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/src/backup_crypto.rs): `crypto-core/src/backup_crypto.rs`

### Local runtime

- [Vault database](https://github.com/privonfoundation/privonvault/blob/main/crypto-core/db.ts): `crypto-core/db.ts`
- [Tauri bridge](https://github.com/privonfoundation/privonvault/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **User**

## Connections

- User → App coordinator: opens
- App coordinator → Authentication: shows
- App coordinator → Dashboard: shows after unlock
- Authentication → Crypto API: derives and unwraps keys
- Authentication → Vault database: sets vault key
- App coordinator → Vault database: clears on wipe
- Dashboard → Vault files: presents
- Dashboard → Gallery: presents
- Dashboard → Music player: presents
- Dashboard → Search: presents
- Dashboard → Trash: presents
- Dashboard → Storage view: presents
- Dashboard → Settings: presents
- Dashboard → Backup: presents
- Vault files → File actions: offers actions
- Crypto API → Rust crypto core: calls crypto bindings
- Rust crypto core → Key wrapping: uses
- Rust crypto core → Metadata encryption: uses
- Rust crypto core → Streaming crypto: uses
- Rust crypto core → Backup crypto: uses
- Backup → Crypto API: requests backup crypto
- File actions → Crypto API: requests file crypto
- Tauri bridge → Rust crypto core: exposes native commands
