# xevrion/gyotaku architecture

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

- Interactive diagram: https://gitdiagram.com/xevrion/gyotaku
- Repository: https://github.com/xevrion/gyotaku

## Overview

gyotaku is an offline screenshot-text search application for Linux and Windows. Users choose screenshot folders, which the CLI indexer scans and watches; OCR extracts text and the core index makes it searchable. The desktop app searches that index and presents matching screenshots with highlighted text, while settings cover folders, appearance, shortcuts, and background indexing. The graph preserves these product stages and the documented platform-specific background behavior. Some internal indexing and UI details are unsampled, so those links are limited to documented relationships.

Main entry points: [`crates/app/src/app.rs`](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/app.rs) (Search window), [`crates/cli/src/indexer.rs`](https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/indexer.rs) (File indexer), [`crates/ocr/src/lib.rs`](https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/lib.rs) (OCR pipeline), [`crates/cli/src/main.rs`](https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/main.rs) (CLI commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop search"]
  node_app["Search window<br/>[app.rs]"]
  node_input["Search input<br/>[input.rs]"]
  node_grid["Results grid<br/>[grid.rs]"]
  node_images["Screenshot display<br/>[images.rs]"]
  node_settings["Onboarding settings<br/>[settings.rs]"]
  node_setup["Folder discovery<br/>[setup.rs]"]
  node_keys["Keyboard shortcuts<br/>[keys.rs]"]
  node_theme["Theme<br/>[theme.rs]"]
end

subgraph group_ingestion["Screenshot ingestion"]
  node_cli["CLI commands<br/>[main.rs]"]
  node_indexer["File indexer<br/>[indexer.rs]"]
  node_watcher["Background watcher<br/>[watch.rs]"]
  node_ocr["OCR pipeline<br/>[lib.rs]"]
  node_detection["Text detection<br/>[det.rs]"]
  node_recognition["Text recognition<br/>[rec.rs]"]
  node_models["OCR models<br/>[models.rs]"]
end

subgraph group_engine["Search engine"]
  node_index[("Search index<br/>[index.rs]")]
  node_config["Configuration<br/>[config.rs]"]
  node_status["Index status<br/>[status.rs]"]
  node_trash["Trash handling<br/>[freedesktop.rs]"]
end

subgraph group_platform["Platform integration"]
  node_app_platform["Desktop platform services<br/>[linux.rs]"]
  node_cli_platform["Indexer platform services<br/>[mod.rs]"]
end

node_user(("User"))
node_screenshots["Screenshot folders"]

node_user -->|"searches in"| node_app
node_user -->|"configures"| node_settings
node_app -->|"uses"| node_input
node_app -->|"renders"| node_grid
node_app -->|"renders"| node_images
node_app -->|"uses"| node_keys
node_app -->|"uses"| node_theme
node_settings -->|"uses"| node_setup
node_settings -->|"saves settings"| node_config
node_setup -->|"suggests folders"| node_screenshots
node_app -.->|"searches"| node_index
node_cli -->|"runs indexing"| node_indexer
node_cli -->|"runs watcher"| node_watcher
node_cli -->|"searches"| node_index
node_cli -->|"runs OCR"| node_ocr
node_screenshots -->|"provides images"| node_indexer
node_indexer -.->|"extracts text"| node_ocr
node_ocr -->|"detects text regions"| node_detection
node_ocr -->|"recognizes text"| node_recognition
node_ocr -->|"loads models"| node_models
node_indexer -.->|"stores extracted text"| node_index
node_watcher -->|"indexes new files"| node_indexer
node_watcher -->|"uses services"| node_cli_platform
node_settings -->|"controls background service"| node_app_platform
node_app -->|"uses OS services"| node_app_platform
node_indexer -->|"sets idle priority"| node_cli_platform

click node_app "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/app.rs"
click node_input "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/input.rs"
click node_grid "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/grid.rs"
click node_images "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/images.rs"
click node_settings "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/app/settings.rs"
click node_setup "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/setup.rs"
click node_keys "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/keys.rs"
click node_theme "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/theme.rs"
click node_cli "https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/main.rs"
click node_indexer "https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/indexer.rs"
click node_watcher "https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/watch.rs"
click node_ocr "https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/lib.rs"
click node_detection "https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/det.rs"
click node_recognition "https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/rec.rs"
click node_models "https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/models.rs"
click node_index "https://github.com/xevrion/gyotaku/blob/main/crates/core/src/index.rs"
click node_config "https://github.com/xevrion/gyotaku/blob/main/crates/core/src/config.rs"
click node_status "https://github.com/xevrion/gyotaku/blob/main/crates/core/src/status.rs"
click node_trash "https://github.com/xevrion/gyotaku/blob/main/crates/core/src/trash/freedesktop.rs"
click node_app_platform "https://github.com/xevrion/gyotaku/blob/main/crates/app/src/platform/linux.rs"
click node_cli_platform "https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/platform/mod.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_input,node_grid,node_images,node_settings,node_setup,node_keys,node_theme,node_user,node_screenshots toneBlue
class node_cli,node_indexer,node_watcher,node_ocr,node_detection,node_recognition,node_models toneAmber
class node_index,node_config,node_status,node_trash toneMint
class node_app_platform,node_cli_platform toneRose
```

## Components

### Desktop search

- [Search window](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/app.rs): `crates/app/src/app.rs`
- [Search input](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/input.rs): `crates/app/src/input.rs`
- [Results grid](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/grid.rs): `crates/app/src/grid.rs`
- [Screenshot display](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/images.rs): `crates/app/src/images.rs`
- [Onboarding settings](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/app/settings.rs): `crates/app/src/app/settings.rs`
- [Folder discovery](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/setup.rs): `crates/app/src/setup.rs`
- [Keyboard shortcuts](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/keys.rs): `crates/app/src/keys.rs`
- [Theme](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/theme.rs): `crates/app/src/theme.rs`

### Screenshot ingestion

- [CLI commands](https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/main.rs): `crates/cli/src/main.rs`
- [File indexer](https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/indexer.rs): `crates/cli/src/indexer.rs`
- [Background watcher](https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/watch.rs): `crates/cli/src/watch.rs`
- [OCR pipeline](https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/lib.rs): `crates/ocr/src/lib.rs`
- [Text detection](https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/det.rs): `crates/ocr/src/det.rs`
- [Text recognition](https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/rec.rs): `crates/ocr/src/rec.rs`
- [OCR models](https://github.com/xevrion/gyotaku/blob/main/crates/ocr/src/models.rs): `crates/ocr/src/models.rs`

### Search engine

- [Search index](https://github.com/xevrion/gyotaku/blob/main/crates/core/src/index.rs): `crates/core/src/index.rs`
- [Configuration](https://github.com/xevrion/gyotaku/blob/main/crates/core/src/config.rs): `crates/core/src/config.rs`
- [Index status](https://github.com/xevrion/gyotaku/blob/main/crates/core/src/status.rs): `crates/core/src/status.rs`
- [Trash handling](https://github.com/xevrion/gyotaku/blob/main/crates/core/src/trash/freedesktop.rs): `crates/core/src/trash/freedesktop.rs`

### Platform integration

- [Desktop platform services](https://github.com/xevrion/gyotaku/blob/main/crates/app/src/platform/linux.rs): `crates/app/src/platform/linux.rs`
- [Indexer platform services](https://github.com/xevrion/gyotaku/blob/main/crates/cli/src/platform/mod.rs): `crates/cli/src/platform/mod.rs`

### Other components

- **User**
- **Screenshot folders**

## Connections

- User → Search window: searches in (evidence: `README.md`)
- User → Onboarding settings: configures (evidence: `README.md`)
- Search window → Search input: uses (evidence: `crates/app/src/app.rs`)
- Search window → Results grid: renders (evidence: `crates/app/src/app.rs`)
- Search window → Screenshot display: renders (evidence: `crates/app/src/app.rs`)
- Search window → Keyboard shortcuts: uses (evidence: `crates/app/src/app.rs`)
- Search window → Theme: uses (evidence: `crates/app/src/app.rs`)
- Onboarding settings → Folder discovery: uses (evidence: `crates/app/src/app/settings.rs`)
- Onboarding settings → Configuration: saves settings (evidence: `README.md`)
- Folder discovery → Screenshot folders: suggests folders (evidence: `crates/app/src/setup.rs`)
- Search window → Search index: searches
- CLI commands → File indexer: runs indexing (evidence: `crates/cli/src/main.rs`)
- CLI commands → Background watcher: runs watcher (evidence: `README.md`)
- CLI commands → Search index: searches (evidence: `crates/cli/src/main.rs`)
- CLI commands → OCR pipeline: runs OCR (evidence: `crates/cli/src/main.rs`)
- Screenshot folders → File indexer: provides images (evidence: `README.md`)
- File indexer → OCR pipeline: extracts text
- OCR pipeline → Text detection: detects text regions (evidence: `crates/ocr/src/lib.rs`)
- OCR pipeline → Text recognition: recognizes text (evidence: `crates/ocr/src/lib.rs`)
- OCR pipeline → OCR models: loads models (evidence: `crates/ocr/src/lib.rs`)
- File indexer → Search index: stores extracted text
- Background watcher → File indexer: indexes new files (evidence: `crates/cli/src/watch.rs`)
- Background watcher → Indexer platform services: uses services (evidence: `crates/cli/src/watch.rs`)
- Onboarding settings → Desktop platform services: controls background service (evidence: `crates/app/src/app/settings.rs`)
- Search window → Desktop platform services: uses OS services (evidence: `crates/app/src/platform/linux.rs`)
- File indexer → Indexer platform services: sets idle priority (evidence: `crates/cli/src/indexer.rs`)
