# rebots-online/enzime-v4 architecture

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

- Interactive diagram: https://gitdiagram.com/rebots-online/enzime-v4
- Repository: https://github.com/rebots-online/enzime-v4
- Video tour (about a minute): https://gitdiagram.com/rebots-online/enzime-v4/video

## Overview

EnZIME is a desktop reading and personal-knowledge application: users browse and install ZIM content, read articles, and create or manage annotations and memory. Its README also describes sidecar import, local inference, diagnostics, and encrypted or plain backup/restore. The graph combines those documented product branches with relationships visible in the supplied source index and excerpts; several domain integrations are documented but their implementation was not sampled, so those links are dashed.

Main entry points: [`crates/application/src/reader_nav.rs`](https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/reader_nav.rs) (Reader workflows), [`apps/reader/src/router.tsx`](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/router.tsx) (Route selection), [`apps/reader/src/services/libraryService.ts`](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/services/libraryService.ts) (Library operations), [`crates/backup/src/create.rs`](https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/create.rs) (Backup creation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Reader experience"]
  node_app["App composition<br/>[App.tsx]"]
  node_router["Route selection<br/>[router.tsx]"]
  node_home["Home experience<br/>[HomeView.tsx]"]
end

subgraph group_content["Content and installation"]
  node_library_ui["Library browser<br/>[LibraryView.tsx]"]
  node_library_service["Library operations<br/>[libraryService.ts]"]
  node_library_state["Library state<br/>[libraryStore.ts]"]
  node_catalog["ZIM catalog<br/>[kiwix.rs]"]
  node_installation["Pack installation<br/>[install.rs]"]
  node_zim["ZIM content access<br/>[convert.rs]"]
end

subgraph group_knowledge["Annotations and memory"]
  node_notes_ui["Notes experience<br/>[NotesView.tsx]"]
  node_annotation_service["Annotation operations"]
  node_annotation_import["Annotation import flow<br/>[import_flow.rs]"]
  node_sidecar_import["Sidecar import policy<br/>[import.rs]"]
  node_sidecar_codec["Sidecar codec<br/>[codec.rs]"]
  node_lore[("Lore memory service<br/>[service.rs]")]
  node_lore_policy["Lore policy<br/>[policy.rs]"]
  node_inference["Local inference<br/>[session.rs]"]
end

subgraph group_platform["Application services"]
  node_application["Reader workflows<br/>[reader_nav.rs]"]
  node_object_store[("Object store<br/>[store.rs]")]
  node_diagnostics["Diagnostics<br/>[quarantine.rs]"]
end

subgraph group_portability["Backup and portability"]
  node_backup_create["Backup creation<br/>[create.rs]"]
  node_backup_payload["User-data payload<br/>[payload.rs]"]
  node_backup_manifest["Backup manifest<br/>[manifest.rs]"]
  node_backup_restore["Backup restore<br/>[restore.rs]"]
  node_sidecar_export["Sidecar export<br/>[sidecar.rs]"]
end

node_reader(("Reader"))

node_reader -->|"opens"| node_app
node_app -->|"provides routes"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_library_ui
node_router -->|"routes to"| node_notes_ui
node_library_ui -.->|"uses operations"| node_library_service
node_library_state -->|"calls"| node_library_service
node_library_service -.->|"uses catalog"| node_catalog
node_library_service -.->|"requests install"| node_installation
node_installation -.->|"stores objects"| node_object_store
node_notes_ui -.->|"uses operations"| node_annotation_service
node_annotation_service -.->|"delegates import"| node_annotation_import
node_annotation_import -.->|"evaluates sidecars"| node_sidecar_import
node_sidecar_import -->|"uses codec"| node_sidecar_codec
node_application -.->|"uses memory"| node_lore
node_lore -->|"applies policy"| node_lore_policy
node_application -.->|"requests generation"| node_inference
node_application -.->|"persists data"| node_object_store
node_application -.->|"starts backup"| node_backup_create
node_backup_create -->|"serializes snapshot"| node_backup_payload
node_backup_create -->|"builds manifest"| node_backup_manifest
node_backup_restore -->|"reads manifest"| node_backup_manifest
node_backup_restore -->|"reads payload"| node_backup_payload
node_application -.->|"starts restore"| node_backup_restore
node_diagnostics -.->|"inspects storage"| node_object_store
node_application -.->|"uses sidecar flow"| node_sidecar_export

click node_app "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/App.tsx"
click node_router "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/router.tsx"
click node_home "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/components/home/HomeView.tsx"
click node_library_ui "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/routes/library/LibraryView.tsx"
click node_library_service "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/services/libraryService.ts"
click node_library_state "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/stores/libraryStore.ts"
click node_catalog "https://github.com/rebots-online/enzime-v4/blob/master/crates/catalog-openzim/src/kiwix.rs"
click node_installation "https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/install.rs"
click node_zim "https://github.com/rebots-online/enzime-v4/blob/master/crates/zim-anzimmerman/src/convert.rs"
click node_notes_ui "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/routes/notes/NotesView.tsx"
click node_annotation_service "https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/services/annotationService.ts"
click node_annotation_import "https://github.com/rebots-online/enzime-v4/blob/master/crates/annotations/src/import_flow.rs"
click node_sidecar_import "https://github.com/rebots-online/enzime-v4/blob/master/crates/sidecar/src/import.rs"
click node_sidecar_codec "https://github.com/rebots-online/enzime-v4/blob/master/crates/sidecar/src/codec.rs"
click node_lore "https://github.com/rebots-online/enzime-v4/blob/master/crates/lore/src/service.rs"
click node_lore_policy "https://github.com/rebots-online/enzime-v4/blob/master/crates/lore/src/policy.rs"
click node_inference "https://github.com/rebots-online/enzime-v4/blob/master/crates/inference-wllama/src/session.rs"
click node_application "https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/reader_nav.rs"
click node_object_store "https://github.com/rebots-online/enzime-v4/blob/master/crates/object-store/src/store.rs"
click node_diagnostics "https://github.com/rebots-online/enzime-v4/blob/master/crates/diagnostics/src/quarantine.rs"
click node_backup_create "https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/create.rs"
click node_backup_payload "https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/payload.rs"
click node_backup_manifest "https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/manifest.rs"
click node_backup_restore "https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/restore.rs"
click node_sidecar_export "https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/sidecar.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_router,node_home toneBlue
class node_library_ui,node_library_service,node_library_state,node_catalog,node_installation,node_zim toneAmber
class node_notes_ui,node_annotation_service,node_annotation_import,node_sidecar_import,node_sidecar_codec,node_lore,node_lore_policy,node_inference toneMint
class node_application,node_object_store,node_diagnostics toneRose
class node_backup_create,node_backup_payload,node_backup_manifest,node_backup_restore,node_sidecar_export,node_reader toneIndigo
```

## Components

### Reader experience

- [App composition](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/App.tsx): `apps/reader/src/App.tsx`
- [Route selection](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/router.tsx): `apps/reader/src/router.tsx`
- [Home experience](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/components/home/HomeView.tsx): `apps/reader/src/components/home/HomeView.tsx`

### Content and installation

- [Library browser](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/routes/library/LibraryView.tsx): `apps/reader/src/routes/library/LibraryView.tsx`
- [Library operations](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/services/libraryService.ts): `apps/reader/src/services/libraryService.ts`
- [Library state](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/stores/libraryStore.ts): `apps/reader/src/stores/libraryStore.ts`
- [ZIM catalog](https://github.com/rebots-online/enzime-v4/blob/master/crates/catalog-openzim/src/kiwix.rs): `crates/catalog-openzim/src/kiwix.rs`
- [Pack installation](https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/install.rs): `crates/application/src/install.rs`
- [ZIM content access](https://github.com/rebots-online/enzime-v4/blob/master/crates/zim-anzimmerman/src/convert.rs): `crates/zim-anzimmerman/src/convert.rs`

### Annotations and memory

- [Notes experience](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/routes/notes/NotesView.tsx): `apps/reader/src/routes/notes/NotesView.tsx`
- [Annotation operations](https://github.com/rebots-online/enzime-v4/blob/master/apps/reader/src/services/annotationService.ts): `apps/reader/src/services/annotationService.ts`
- [Annotation import flow](https://github.com/rebots-online/enzime-v4/blob/master/crates/annotations/src/import_flow.rs): `crates/annotations/src/import_flow.rs`
- [Sidecar import policy](https://github.com/rebots-online/enzime-v4/blob/master/crates/sidecar/src/import.rs): `crates/sidecar/src/import.rs`
- [Sidecar codec](https://github.com/rebots-online/enzime-v4/blob/master/crates/sidecar/src/codec.rs): `crates/sidecar/src/codec.rs`
- [Lore memory service](https://github.com/rebots-online/enzime-v4/blob/master/crates/lore/src/service.rs): `crates/lore/src/service.rs`
- [Lore policy](https://github.com/rebots-online/enzime-v4/blob/master/crates/lore/src/policy.rs): `crates/lore/src/policy.rs`
- [Local inference](https://github.com/rebots-online/enzime-v4/blob/master/crates/inference-wllama/src/session.rs): `crates/inference-wllama/src/session.rs`

### Application services

- [Reader workflows](https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/reader_nav.rs): `crates/application/src/reader_nav.rs`
- [Object store](https://github.com/rebots-online/enzime-v4/blob/master/crates/object-store/src/store.rs): `crates/object-store/src/store.rs`
- [Diagnostics](https://github.com/rebots-online/enzime-v4/blob/master/crates/diagnostics/src/quarantine.rs): `crates/diagnostics/src/quarantine.rs`

### Backup and portability

- [Backup creation](https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/create.rs): `crates/backup/src/create.rs`
- [User-data payload](https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/payload.rs): `crates/backup/src/payload.rs`
- [Backup manifest](https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/manifest.rs): `crates/backup/src/manifest.rs`
- [Backup restore](https://github.com/rebots-online/enzime-v4/blob/master/crates/backup/src/restore.rs): `crates/backup/src/restore.rs`
- [Sidecar export](https://github.com/rebots-online/enzime-v4/blob/master/crates/application/src/sidecar.rs): `crates/application/src/sidecar.rs`

### Other components

- **Reader**

## Connections

- Reader → App composition: opens
- App composition → Route selection: provides routes (evidence: `apps/reader/src/App.tsx`)
- Route selection → Home experience: routes to (evidence: `apps/reader/src/router.tsx`)
- Route selection → Library browser: routes to (evidence: `apps/reader/src/router.tsx`)
- Route selection → Notes experience: routes to (evidence: `apps/reader/src/router.tsx`)
- Library browser → Library operations: uses operations
- Library state → Library operations: calls (evidence: `apps/reader/src/stores/libraryStore.ts`)
- Library operations → ZIM catalog: uses catalog
- Library operations → Pack installation: requests install
- Pack installation → Object store: stores objects
- Notes experience → Annotation operations: uses operations
- Annotation operations → Annotation import flow: delegates import
- Annotation import flow → Sidecar import policy: evaluates sidecars
- Sidecar import policy → Sidecar codec: uses codec (evidence: `crates/sidecar/src/import.rs`)
- Reader workflows → Lore memory service: uses memory
- Lore memory service → Lore policy: applies policy (evidence: `crates/lore/src/service.rs`)
- Reader workflows → Local inference: requests generation
- Reader workflows → Object store: persists data
- Reader workflows → Backup creation: starts backup
- Backup creation → User-data payload: serializes snapshot (evidence: `crates/backup/src/create.rs`)
- Backup creation → Backup manifest: builds manifest (evidence: `crates/backup/src/create.rs`)
- Backup restore → Backup manifest: reads manifest (evidence: `crates/backup/src/restore.rs`)
- Backup restore → User-data payload: reads payload (evidence: `crates/backup/src/restore.rs`)
- Reader workflows → Backup restore: starts restore
- Diagnostics → Object store: inspects storage
- Reader workflows → Sidecar export: uses sidecar flow
