# theachoem/storypad architecture

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

- Interactive diagram: https://gitdiagram.com/theachoem/storypad
- Repository: https://github.com/theachoem/storypad

## Overview

StoryPad is a privacy-first Flutter journaling app. The main user journey is creating and revisiting timeline entries, with local persistence and related features for organizing, finding, and enriching stories. The README also documents backup/export, customization, security, and Pro capabilities. Source excerpts focus on native platform services rather than Dart feature wiring, so feature relationships are documented at the subsystem level; unverified calls are omitted or marked dashed.

Main entry points: [`lib/views/home`](https://github.com/theachoem/storypad/tree/develop/lib/views/home) (Timeline entries), [`lib/app.dart`](https://github.com/theachoem/storypad/blob/develop/lib/app.dart) (Flutter app), [`android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt`](https://github.com/theachoem/storypad/blob/develop/android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt) (Android app bridge), [`macos/Runner/MainFlutterWindow.swift`](https://github.com/theachoem/storypad/blob/develop/macos/Runner/MainFlutterWindow.swift) (macOS window setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_journaling["Journal experience"]
  node_app["Flutter app<br/>[app.dart]"]
  node_timeline["Timeline entries"]
  node_editor["Rich writing editor"]
  node_memories["Throwback memories"]
end

subgraph group_organizing["Discovery and enrichment"]
  node_moods["Mood calendar"]
  node_search["Search and tags"]
  node_templates["Templates gallery"]
  node_stats["Writing statistics"]
end

subgraph group_persistence["Data and portability"]
  node_database[("ObjectBox data")]
  node_backup["Backup and sync"]
  node_export["Export and sharing"]
  node_lock["App lock"]
end

subgraph group_platform["Platform services"]
  node_android["Android app bridge<br/>[MainActivity.kt]"]
  node_android_logo["Android icon service<br/>[AppLogoService.kt]"]
  node_ios_logo["iOS icon service"]
  node_icloud["iCloud backup service"]
  node_mac_window["macOS window setup"]
  node_window_appearance["Window appearance"]
  node_editor_plugin["macOS editor plugin"]
end

node_person(("Journal writer"))

node_person -.->|"opens"| node_app
node_app -.->|"presents"| node_timeline
node_person -.->|"writes entries"| node_timeline
node_timeline -.->|"edits stories"| node_editor
node_timeline -.->|"persists locally"| node_database
node_person -.->|"revisits stories"| node_memories
node_person -.->|"tracks moods"| node_moods
node_person -.->|"finds stories"| node_search
node_person -.->|"uses templates"| node_templates
node_person -.->|"reviews writing"| node_stats
node_person -.->|"backs up data"| node_backup
node_person -.->|"exports stories"| node_export
node_person -.->|"secures access"| node_lock
node_android -->|"calls"| node_android_logo
node_mac_window -->|"dispatches to"| node_window_appearance

click node_app "https://github.com/theachoem/storypad/blob/develop/lib/app.dart"
click node_timeline "https://github.com/theachoem/storypad/tree/develop/lib/views/home"
click node_editor "https://github.com/theachoem/storypad/tree/develop/lib/widgets/rich_editor"
click node_memories "https://github.com/theachoem/storypad/tree/develop/lib/views/throwback"
click node_moods "https://github.com/theachoem/storypad/tree/develop/lib/views/calendar/mood"
click node_search "https://github.com/theachoem/storypad/tree/develop/lib/views/search"
click node_templates "https://github.com/theachoem/storypad/tree/develop/lib/views/templates"
click node_stats "https://github.com/theachoem/storypad/tree/develop/lib/views/stats"
click node_database "https://github.com/theachoem/storypad/tree/develop/lib/core/databases/adapters/objectbox"
click node_backup "https://github.com/theachoem/storypad/tree/develop/lib/core/services/backups"
click node_export "https://github.com/theachoem/storypad/tree/develop/lib/core/services/export"
click node_lock "https://github.com/theachoem/storypad/blob/develop/lib/core/initializers/app_lock_initializer.dart"
click node_android "https://github.com/theachoem/storypad/blob/develop/android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt"
click node_android_logo "https://github.com/theachoem/storypad/blob/develop/android/app/src/main/kotlin/com/tc/writestory/services/AppLogoService.kt"
click node_ios_logo "https://github.com/theachoem/storypad/blob/develop/ios/Runner/services/AppLogoService.swift"
click node_icloud "https://github.com/theachoem/storypad/blob/develop/ios/Runner/services/ICloudBackupService.swift"
click node_mac_window "https://github.com/theachoem/storypad/blob/develop/macos/Runner/MainFlutterWindow.swift"
click node_window_appearance "https://github.com/theachoem/storypad/blob/develop/macos/Runner/services/WindowAppearanceService.swift"
click node_editor_plugin "https://github.com/theachoem/storypad/blob/develop/packages/storypad_editor/macos/storypad_editor/Sources/storypad_editor/StorypadEditorPlugin.swift"

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_timeline,node_editor,node_memories toneBlue
class node_moods,node_search,node_templates,node_stats toneAmber
class node_database,node_backup,node_export,node_lock toneMint
class node_android,node_android_logo,node_ios_logo,node_icloud,node_mac_window,node_window_appearance,node_editor_plugin toneRose
class node_person toneIndigo
```

## Components

### Journal experience

- [Flutter app](https://github.com/theachoem/storypad/blob/develop/lib/app.dart): `lib/app.dart`
- [Timeline entries](https://github.com/theachoem/storypad/tree/develop/lib/views/home): `lib/views/home`
- [Rich writing editor](https://github.com/theachoem/storypad/tree/develop/lib/widgets/rich_editor): `lib/widgets/rich_editor`
- [Throwback memories](https://github.com/theachoem/storypad/tree/develop/lib/views/throwback): `lib/views/throwback`

### Discovery and enrichment

- [Mood calendar](https://github.com/theachoem/storypad/tree/develop/lib/views/calendar/mood): `lib/views/calendar/mood`
- [Search and tags](https://github.com/theachoem/storypad/tree/develop/lib/views/search): `lib/views/search`
- [Templates gallery](https://github.com/theachoem/storypad/tree/develop/lib/views/templates): `lib/views/templates`
- [Writing statistics](https://github.com/theachoem/storypad/tree/develop/lib/views/stats): `lib/views/stats`

### Data and portability

- [ObjectBox data](https://github.com/theachoem/storypad/tree/develop/lib/core/databases/adapters/objectbox): `lib/core/databases/adapters/objectbox`
- [Backup and sync](https://github.com/theachoem/storypad/tree/develop/lib/core/services/backups): `lib/core/services/backups`
- [Export and sharing](https://github.com/theachoem/storypad/tree/develop/lib/core/services/export): `lib/core/services/export`
- [App lock](https://github.com/theachoem/storypad/blob/develop/lib/core/initializers/app_lock_initializer.dart): `lib/core/initializers/app_lock_initializer.dart`

### Platform services

- [Android app bridge](https://github.com/theachoem/storypad/blob/develop/android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt): `android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt`
- [Android icon service](https://github.com/theachoem/storypad/blob/develop/android/app/src/main/kotlin/com/tc/writestory/services/AppLogoService.kt): `android/app/src/main/kotlin/com/tc/writestory/services/AppLogoService.kt`
- [iOS icon service](https://github.com/theachoem/storypad/blob/develop/ios/Runner/services/AppLogoService.swift): `ios/Runner/services/AppLogoService.swift`
- [iCloud backup service](https://github.com/theachoem/storypad/blob/develop/ios/Runner/services/ICloudBackupService.swift): `ios/Runner/services/ICloudBackupService.swift`
- [macOS window setup](https://github.com/theachoem/storypad/blob/develop/macos/Runner/MainFlutterWindow.swift): `macos/Runner/MainFlutterWindow.swift`
- [Window appearance](https://github.com/theachoem/storypad/blob/develop/macos/Runner/services/WindowAppearanceService.swift): `macos/Runner/services/WindowAppearanceService.swift`
- [macOS editor plugin](https://github.com/theachoem/storypad/blob/develop/packages/storypad_editor/macos/storypad_editor/Sources/storypad_editor/StorypadEditorPlugin.swift): `packages/storypad_editor/macos/storypad_editor/Sources/storypad_editor/StorypadEditorPlugin.swift`

### Other components

- **Journal writer**

## Connections

- Journal writer → Flutter app: opens
- Flutter app → Timeline entries: presents
- Journal writer → Timeline entries: writes entries
- Timeline entries → Rich writing editor: edits stories
- Timeline entries → ObjectBox data: persists locally
- Journal writer → Throwback memories: revisits stories
- Journal writer → Mood calendar: tracks moods
- Journal writer → Search and tags: finds stories
- Journal writer → Templates gallery: uses templates
- Journal writer → Writing statistics: reviews writing
- Journal writer → Backup and sync: backs up data
- Journal writer → Export and sharing: exports stories
- Journal writer → App lock: secures access
- Android app bridge → Android icon service: calls (evidence: `android/app/src/main/kotlin/com/tc/writestory/MainActivity.kt`)
- macOS window setup → Window appearance: dispatches to (evidence: `macos/Runner/MainFlutterWindow.swift`)
