# offrange/keygo architecture

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

- Interactive diagram: https://gitdiagram.com/offrange/keygo
- Repository: https://github.com/offrange/keygo

## Overview

KeyGo is an Android password vault for locally stored credentials, passkeys, cards, and TOTP secrets. The main user path is entering the app, unlocking access, then managing vault data; system autofill is a separate entry point that extracts a form and offers matching datasets or a save prompt. Security, backup, and Rust-backed functionality are important supporting capabilities. The tree and excerpts establish only selected calls, so uncertain links are shown as dashed rather than asserted as runtime wiring.

Main entry points: [`core/item/src/main/kotlin/de/davis/keygo/core/item/domain/model/Item.kt`](https://github.com/offrange/keygo/blob/v2/core/item/src/main/kotlin/de/davis/keygo/core/item/domain/model/Item.kt) (Vault items), [`app/src/main/kotlin/de/davis/keygo/app/presentation/navigation/AppShell.kt`](https://github.com/offrange/keygo/blob/v2/app/src/main/kotlin/de/davis/keygo/app/presentation/navigation/AppShell.kt) (App navigation), [`feature/autofill/src/main/kotlin/de/davis/keygo/feature/autofill/presentation/KeyGoAutofillService.kt`](https://github.com/offrange/keygo/blob/v2/feature/autofill/src/main/kotlin/de/davis/keygo/feature/autofill/presentation/KeyGoAutofillService.kt) (Autofill service), [`rust/crates/keygo-client/src/sync/pipeline.rs`](https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/pipeline.rs) (Sync pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_appui["App navigation<br/>[AppShell.kt]"]
  node_dashboard["Dashboard"]
  node_auth["Authentication UI<br/>[AuthContent.kt]"]
end

subgraph group_vault["Vault management"]
  node_vaultitems["Vault items<br/>[Item.kt]"]
  node_vaultcontext["Vault context"]
  node_itemstore[("Item database<br/>[ItemDatabase.kt]")]
  node_totp["TOTP codes<br/>[Totp.kt]"]
  node_passkeys["Passkeys<br/>[PasskeyManager.kt]"]
  node_cards["Card management<br/>[Card.kt]"]
end

subgraph group_security["Identity and security"]
  node_cryptoscope["Item encryption"]
  node_keystore["Android keystore"]
  node_account["Account access"]
  node_biometrics["Biometric unlock"]
end

subgraph group_integrations["System integrations"]
  node_autofill["Autofill service"]
  node_backup["Backup jobs<br/>[BackupWorker.kt]"]
  node_backupengine["Backup formats"]
end

subgraph group_sync["Rust services"]
  node_syncclient["Sync client<br/>[client.rs]"]
  node_syncpipeline["Sync pipeline<br/>[pipeline.rs]"]
  node_synctokens["Session tokens<br/>[tokens.rs]"]
  node_transport["HTTP transport<br/>[transport.rs]"]
end

node_user(("User"))

node_user -.->|"opens"| node_appui
node_appui -.->|"navigates"| node_dashboard
node_appui -.->|"routes to"| node_auth
node_dashboard -.->|"opens vault"| node_vaultitems
node_auth -.->|"checks access"| node_account
node_account -.->|"supports unlock"| node_biometrics
node_vaultitems -.->|"persists locally"| node_itemstore
node_vaultitems -.->|"encrypts per item"| node_cryptoscope
node_cryptoscope -.->|"requests cipher"| node_keystore
node_vaultitems -.->|"uses context"| node_vaultcontext
node_user -.->|"requests fill"| node_autofill
node_autofill -->|"checks access"| node_account
node_autofill -.->|"offers credentials"| node_vaultitems
node_user -.->|"starts backup"| node_backup
node_backup -.->|"exports data"| node_backupengine
node_vaultitems -.->|"generates codes"| node_totp
node_vaultitems -.->|"manages passkeys"| node_passkeys
node_vaultitems -.->|"manages cards"| node_cards
node_syncclient -.->|"dispatches calls"| node_syncpipeline
node_syncpipeline -->|"sends requests"| node_transport
node_syncpipeline -->|"uses session tokens"| node_synctokens

click node_appui "https://github.com/offrange/keygo/blob/v2/app/src/main/kotlin/de/davis/keygo/app/presentation/navigation/AppShell.kt"
click node_dashboard "https://github.com/offrange/keygo/blob/v2/app/src/main/kotlin/de/davis/keygo/dashboard/presentation/DashboardEntries.kt"
click node_auth "https://github.com/offrange/keygo/blob/v2/feature/auth/src/main/kotlin/de/davis/keygo/feature/auth/presentation/AuthContent.kt"
click node_vaultitems "https://github.com/offrange/keygo/blob/v2/core/item/src/main/kotlin/de/davis/keygo/core/item/domain/model/Item.kt"
click node_itemstore "https://github.com/offrange/keygo/blob/v2/core/item/src/main/kotlin/de/davis/keygo/core/item/data/local/datasource/ItemDatabase.kt"
click node_cryptoscope "https://github.com/offrange/keygo/blob/v2/core/security/src/main/kotlin/de/davis/keygo/core/security/data/crypto/CryptographicScopeImpl.kt"
click node_keystore "https://github.com/offrange/keygo/blob/v2/core/security/src/main/kotlin/de/davis/keygo/core/security/data/KeyStoreManagerImpl.kt"
click node_account "https://github.com/offrange/keygo/blob/v2/core/identity/src/main/kotlin/de/davis/keygo/core/identity/domain/repository/AccountRepository.kt"
click node_biometrics "https://github.com/offrange/keygo/blob/v2/core/identity/src/main/kotlin/de/davis/keygo/core/identity/domain/usecase/UnlockWithBiometricsUseCase.kt"
click node_autofill "https://github.com/offrange/keygo/blob/v2/feature/autofill/src/main/kotlin/de/davis/keygo/feature/autofill/presentation/KeyGoAutofillService.kt"
click node_backup "https://github.com/offrange/keygo/blob/v2/feature/backup/src/main/kotlin/de/davis/keygo/feature/backup/worker/BackupWorker.kt"
click node_totp "https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/totp/Totp.kt"
click node_passkeys "https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/passkey/PasskeyManager.kt"
click node_cards "https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/card/Card.kt"
click node_syncclient "https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/client.rs"
click node_syncpipeline "https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/pipeline.rs"
click node_synctokens "https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/tokens.rs"
click node_transport "https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/transport.rs"
click node_backupengine "https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/backup/JsonBackupManager.kt"

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_appui,node_dashboard,node_auth,node_user toneBlue
class node_vaultitems,node_vaultcontext,node_itemstore,node_totp,node_passkeys,node_cards toneAmber
class node_cryptoscope,node_keystore,node_account,node_biometrics toneMint
class node_autofill,node_backup,node_backupengine toneRose
class node_syncclient,node_syncpipeline,node_synctokens,node_transport toneIndigo
```

## Components

### App experience

- [App navigation](https://github.com/offrange/keygo/blob/v2/app/src/main/kotlin/de/davis/keygo/app/presentation/navigation/AppShell.kt): `app/src/main/kotlin/de/davis/keygo/app/presentation/navigation/AppShell.kt`
- [Dashboard](https://github.com/offrange/keygo/blob/v2/app/src/main/kotlin/de/davis/keygo/dashboard/presentation/DashboardEntries.kt): `app/src/main/kotlin/de/davis/keygo/dashboard/presentation/DashboardEntries.kt`
- [Authentication UI](https://github.com/offrange/keygo/blob/v2/feature/auth/src/main/kotlin/de/davis/keygo/feature/auth/presentation/AuthContent.kt): `feature/auth/src/main/kotlin/de/davis/keygo/feature/auth/presentation/AuthContent.kt`

### Vault management

- [Vault items](https://github.com/offrange/keygo/blob/v2/core/item/src/main/kotlin/de/davis/keygo/core/item/domain/model/Item.kt): `core/item/src/main/kotlin/de/davis/keygo/core/item/domain/model/Item.kt`
- **Vault context**
- [Item database](https://github.com/offrange/keygo/blob/v2/core/item/src/main/kotlin/de/davis/keygo/core/item/data/local/datasource/ItemDatabase.kt): `core/item/src/main/kotlin/de/davis/keygo/core/item/data/local/datasource/ItemDatabase.kt`
- [TOTP codes](https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/totp/Totp.kt): `core/rust/src/main/kotlin/de/davis/keygo/rust/totp/Totp.kt`
- [Passkeys](https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/passkey/PasskeyManager.kt): `core/rust/src/main/kotlin/de/davis/keygo/rust/passkey/PasskeyManager.kt`
- [Card management](https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/card/Card.kt): `core/rust/src/main/kotlin/de/davis/keygo/rust/card/Card.kt`

### Identity and security

- [Item encryption](https://github.com/offrange/keygo/blob/v2/core/security/src/main/kotlin/de/davis/keygo/core/security/data/crypto/CryptographicScopeImpl.kt): `core/security/src/main/kotlin/de/davis/keygo/core/security/data/crypto/CryptographicScopeImpl.kt`
- [Android keystore](https://github.com/offrange/keygo/blob/v2/core/security/src/main/kotlin/de/davis/keygo/core/security/data/KeyStoreManagerImpl.kt): `core/security/src/main/kotlin/de/davis/keygo/core/security/data/KeyStoreManagerImpl.kt`
- [Account access](https://github.com/offrange/keygo/blob/v2/core/identity/src/main/kotlin/de/davis/keygo/core/identity/domain/repository/AccountRepository.kt): `core/identity/src/main/kotlin/de/davis/keygo/core/identity/domain/repository/AccountRepository.kt`
- [Biometric unlock](https://github.com/offrange/keygo/blob/v2/core/identity/src/main/kotlin/de/davis/keygo/core/identity/domain/usecase/UnlockWithBiometricsUseCase.kt): `core/identity/src/main/kotlin/de/davis/keygo/core/identity/domain/usecase/UnlockWithBiometricsUseCase.kt`

### System integrations

- [Autofill service](https://github.com/offrange/keygo/blob/v2/feature/autofill/src/main/kotlin/de/davis/keygo/feature/autofill/presentation/KeyGoAutofillService.kt): `feature/autofill/src/main/kotlin/de/davis/keygo/feature/autofill/presentation/KeyGoAutofillService.kt`
- [Backup jobs](https://github.com/offrange/keygo/blob/v2/feature/backup/src/main/kotlin/de/davis/keygo/feature/backup/worker/BackupWorker.kt): `feature/backup/src/main/kotlin/de/davis/keygo/feature/backup/worker/BackupWorker.kt`
- [Backup formats](https://github.com/offrange/keygo/blob/v2/core/rust/src/main/kotlin/de/davis/keygo/rust/backup/JsonBackupManager.kt): `core/rust/src/main/kotlin/de/davis/keygo/rust/backup/JsonBackupManager.kt`

### Rust services

- [Sync client](https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/client.rs): `rust/crates/keygo-client/src/sync/client.rs`
- [Sync pipeline](https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/pipeline.rs): `rust/crates/keygo-client/src/sync/pipeline.rs`
- [Session tokens](https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/tokens.rs): `rust/crates/keygo-client/src/sync/tokens.rs`
- [HTTP transport](https://github.com/offrange/keygo/blob/v2/rust/crates/keygo-client/src/sync/transport.rs): `rust/crates/keygo-client/src/sync/transport.rs`

### Other components

- **User**

## Connections

- User → App navigation: opens
- App navigation → Dashboard: navigates
- App navigation → Authentication UI: routes to
- Dashboard → Vault items: opens vault
- Authentication UI → Account access: checks access
- Account access → Biometric unlock: supports unlock
- Vault items → Item database: persists locally
- Vault items → Item encryption: encrypts per item
- Item encryption → Android keystore: requests cipher (evidence: `core/security/src/main/kotlin/de/davis/keygo/core/security/data/KeyStoreManagerImpl.kt`)
- Vault items → Vault context: uses context
- User → Autofill service: requests fill
- Autofill service → Account access: checks access (evidence: `feature/autofill/src/main/kotlin/de/davis/keygo/feature/autofill/presentation/KeyGoAutofillService.kt`)
- Autofill service → Vault items: offers credentials
- User → Backup jobs: starts backup
- Backup jobs → Backup formats: exports data
- Vault items → TOTP codes: generates codes
- Vault items → Passkeys: manages passkeys
- Vault items → Card management: manages cards
- Sync client → Sync pipeline: dispatches calls (evidence: `rust/crates/keygo-client/src/sync/client.rs`)
- Sync pipeline → HTTP transport: sends requests (evidence: `rust/crates/keygo-client/src/sync/pipeline.rs`)
- Sync pipeline → Session tokens: uses session tokens (evidence: `rust/crates/keygo-client/src/sync/pipeline.rs`)
