# darshseraphic/rocen architecture

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

- Interactive diagram: https://gitdiagram.com/darshseraphic/rocen
- Repository: https://github.com/darshseraphic/rocen

## Overview

Rocen is a local-first Flutter workspace for notes, tasks, date-linked ideas, and media, with optional encrypted GitHub backup. The primary workflow is entering information in a tool inside the app shell, keeping workspace data locally, and optionally backing up encrypted notes to a user-owned GitHub repository. Settings also handles password and recovery management and reports device security posture. The README documents capabilities beyond the sampled source; those implementation links are therefore limited to its explicit descriptions.

Main entry points: [`lib/navbar.dart`](https://github.com/darshseraphic/rocen/blob/main/lib/navbar.dart) (Navigation), [`lib/features/settings.dart`](https://github.com/darshseraphic/rocen/blob/main/lib/features/settings.dart) (Settings), [`lib/features/quicknote.dart`](https://github.com/darshseraphic/rocen/blob/main/lib/features/quicknote.dart) (QuickNote), [`lib/core/database.dart`](https://github.com/darshseraphic/rocen/blob/main/lib/core/database.dart) (Local Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Workspace"]
  node_shell["App Shell<br/>[main.dart]"]
  node_navigation["Navigation<br/>[navbar.dart]"]
end

subgraph group_features["Workspace Tools"]
  node_quicknote["QuickNote<br/>[quicknote.dart]"]
  node_tasks["To-Do List"]
  node_ideas["Idea Inbox<br/>[ideainbox.dart]"]
  node_media["Media Registry"]
  node_bookmarks["Bookmarks<br/>[bookmarks.dart]"]
  node_settings["Settings<br/>[settings.dart]"]
  node_clipboard["Clipboard<br/>[clipboard.dart]"]
end

subgraph group_security["Security and Keys"]
  node_password["Password Derivation"]
  node_masterkey["Master Key"]
  node_keyservice["Production Key Service"]
  node_localkeys[("Local Key Store")]
  node_recovery["Recovery Phrase<br/>[BIP39.dart]"]
  node_crypto["Crypto Engine<br/>[crypto_engine.dart]"]
  node_android["Android Platform Bridge<br/>[MainActivity.kt]"]
  node_integrity["Device Integrity<br/>[MainActivity.kt]"]
  node_passwordstate["Password State"]
end

subgraph group_persistence["Local Data and Backup"]
  node_localdb[("Local Database<br/>[database.dart]")]
  node_github["GitHub Backup"]
end

node_user(("User"))
node_keystore[("Android Keystore")]

node_user -->|"opens"| node_shell
node_shell -->|"shows"| node_navigation
node_navigation -->|"opens"| node_quicknote
node_navigation -->|"opens"| node_tasks
node_navigation -->|"opens"| node_ideas
node_navigation -->|"opens"| node_media
node_navigation -->|"opens"| node_settings
node_quicknote -->|"stores locally"| node_localdb
node_ideas -.->|"stores locally"| node_localdb
node_tasks -.->|"stores locally"| node_localdb
node_media -->|"imports locally"| node_localdb
node_settings -->|"configures backup"| node_github
node_quicknote -->|"optionally encrypts"| node_crypto
node_quicknote -->|"backs up"| node_github
node_github -->|"transfers encrypted data"| node_crypto
node_settings -->|"sets or rotates"| node_password
node_settings -->|"manages phrase"| node_recovery
node_settings -->|"reports posture"| node_integrity
node_crypto -.->|"uses"| node_masterkey
node_masterkey -.->|"delegates"| node_keyservice
node_keyservice -.->|"persists keys"| node_localkeys
node_keyservice -.->|"uses platform channel"| node_android
node_android -->|"encrypts with"| node_keystore
node_password -.->|"updates state"| node_passwordstate

click node_shell "https://github.com/darshseraphic/rocen/blob/main/lib/main.dart"
click node_navigation "https://github.com/darshseraphic/rocen/blob/main/lib/navbar.dart"
click node_quicknote "https://github.com/darshseraphic/rocen/blob/main/lib/features/quicknote.dart"
click node_tasks "https://github.com/darshseraphic/rocen/tree/main/lib/features"
click node_ideas "https://github.com/darshseraphic/rocen/blob/main/lib/features/ideainbox.dart"
click node_media "https://github.com/darshseraphic/rocen/tree/main/lib/features"
click node_bookmarks "https://github.com/darshseraphic/rocen/blob/main/lib/features/bookmarks.dart"
click node_settings "https://github.com/darshseraphic/rocen/blob/main/lib/features/settings.dart"
click node_localdb "https://github.com/darshseraphic/rocen/blob/main/lib/core/database.dart"
click node_github "https://github.com/darshseraphic/rocen/blob/main/lib/core/github_backup_service.dart"
click node_password "https://github.com/darshseraphic/rocen/blob/main/lib/core/password_key_derivation.dart"
click node_masterkey "https://github.com/darshseraphic/rocen/blob/main/lib/core/master_key_manager.dart"
click node_keyservice "https://github.com/darshseraphic/rocen/blob/main/lib/core/master_key_production_service.dart"
click node_localkeys "https://github.com/darshseraphic/rocen/blob/main/lib/core/master_key_local_store.dart"
click node_recovery "https://github.com/darshseraphic/rocen/blob/main/lib/core/BIP39.dart"
click node_crypto "https://github.com/darshseraphic/rocen/blob/main/lib/core/crypto_engine.dart"
click node_android "https://github.com/darshseraphic/rocen/blob/main/android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt"
click node_integrity "https://github.com/darshseraphic/rocen/blob/main/android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt"
click node_clipboard "https://github.com/darshseraphic/rocen/blob/main/lib/features/clipboard.dart"
click node_passwordstate "https://github.com/darshseraphic/rocen/blob/main/lib/core/password_state_manager.dart"

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_shell,node_navigation,node_user toneBlue
class node_quicknote,node_tasks,node_ideas,node_media,node_bookmarks,node_settings,node_clipboard,node_keystore toneAmber
class node_password,node_masterkey,node_keyservice,node_localkeys,node_recovery,node_crypto,node_android,node_integrity,node_passwordstate toneMint
class node_localdb,node_github toneRose
```

## Components

### Workspace

- [App Shell](https://github.com/darshseraphic/rocen/blob/main/lib/main.dart): `lib/main.dart`
- [Navigation](https://github.com/darshseraphic/rocen/blob/main/lib/navbar.dart): `lib/navbar.dart`

### Workspace Tools

- [QuickNote](https://github.com/darshseraphic/rocen/blob/main/lib/features/quicknote.dart): `lib/features/quicknote.dart`
- [To-Do List](https://github.com/darshseraphic/rocen/tree/main/lib/features): `lib/features`
- [Idea Inbox](https://github.com/darshseraphic/rocen/blob/main/lib/features/ideainbox.dart): `lib/features/ideainbox.dart`
- [Media Registry](https://github.com/darshseraphic/rocen/tree/main/lib/features): `lib/features`
- [Bookmarks](https://github.com/darshseraphic/rocen/blob/main/lib/features/bookmarks.dart): `lib/features/bookmarks.dart`
- [Settings](https://github.com/darshseraphic/rocen/blob/main/lib/features/settings.dart): `lib/features/settings.dart`
- [Clipboard](https://github.com/darshseraphic/rocen/blob/main/lib/features/clipboard.dart): `lib/features/clipboard.dart`

### Security and Keys

- [Password Derivation](https://github.com/darshseraphic/rocen/blob/main/lib/core/password_key_derivation.dart): `lib/core/password_key_derivation.dart`
- [Master Key](https://github.com/darshseraphic/rocen/blob/main/lib/core/master_key_manager.dart): `lib/core/master_key_manager.dart`
- [Production Key Service](https://github.com/darshseraphic/rocen/blob/main/lib/core/master_key_production_service.dart): `lib/core/master_key_production_service.dart`
- [Local Key Store](https://github.com/darshseraphic/rocen/blob/main/lib/core/master_key_local_store.dart): `lib/core/master_key_local_store.dart`
- [Recovery Phrase](https://github.com/darshseraphic/rocen/blob/main/lib/core/BIP39.dart): `lib/core/BIP39.dart`
- [Crypto Engine](https://github.com/darshseraphic/rocen/blob/main/lib/core/crypto_engine.dart): `lib/core/crypto_engine.dart`
- [Android Platform Bridge](https://github.com/darshseraphic/rocen/blob/main/android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt): `android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt`
- [Device Integrity](https://github.com/darshseraphic/rocen/blob/main/android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt): `android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt`
- [Password State](https://github.com/darshseraphic/rocen/blob/main/lib/core/password_state_manager.dart): `lib/core/password_state_manager.dart`

### Local Data and Backup

- [Local Database](https://github.com/darshseraphic/rocen/blob/main/lib/core/database.dart): `lib/core/database.dart`
- [GitHub Backup](https://github.com/darshseraphic/rocen/blob/main/lib/core/github_backup_service.dart): `lib/core/github_backup_service.dart`

### Other components

- **User**
- **Android Keystore**

## Connections

- User → App Shell: opens (evidence: `README.md`)
- App Shell → Navigation: shows (evidence: `README.md`)
- Navigation → QuickNote: opens (evidence: `README.md`)
- Navigation → To-Do List: opens (evidence: `README.md`)
- Navigation → Idea Inbox: opens (evidence: `README.md`)
- Navigation → Media Registry: opens (evidence: `README.md`)
- Navigation → Settings: opens (evidence: `README.md`)
- QuickNote → Local Database: stores locally (evidence: `README.md`)
- Idea Inbox → Local Database: stores locally
- To-Do List → Local Database: stores locally
- Media Registry → Local Database: imports locally (evidence: `README.md`)
- Settings → GitHub Backup: configures backup (evidence: `README.md`)
- QuickNote → Crypto Engine: optionally encrypts (evidence: `README.md`)
- QuickNote → GitHub Backup: backs up (evidence: `README.md`)
- GitHub Backup → Crypto Engine: transfers encrypted data (evidence: `README.md`)
- Settings → Password Derivation: sets or rotates (evidence: `README.md`)
- Settings → Recovery Phrase: manages phrase (evidence: `README.md`)
- Settings → Device Integrity: reports posture (evidence: `README.md`)
- Crypto Engine → Master Key: uses
- Master Key → Production Key Service: delegates
- Production Key Service → Local Key Store: persists keys
- Production Key Service → Android Platform Bridge: uses platform channel
- Android Platform Bridge → Android Keystore: encrypts with (evidence: `android/app/src/main/kotlin/com/darshseraphic/Rocen/MainActivity.kt`)
- Password Derivation → Password State: updates state
