# aliplfrh/sunny architecture

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

- Interactive diagram: https://gitdiagram.com/aliplfrh/sunny
- Repository: https://github.com/aliplfrh/sunny

## Overview

Sunny is a Windows keyboard launcher: the user opens it with a hotkey, types a query or chooses a tool, and gets an app/file result, generated content, clipboard action, or web search. Its domain capabilities include app discovery, file and clipboard search, utility generators, settings, and optional video downloads. The Rust/Tauri host coordinates the desktop app; the sampled excerpts do not expose most UI-to-command calls, so those connections are omitted or marked unverified. The README documents the capabilities and user outcomes.

Main entry points: [`crates/sun-core/src/video.rs`](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/video.rs) (Video Downloads), [`crates/sun-core/src/search.rs`](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/search.rs) (Query Search), [`apps/sunny/src-tauri/src/main.rs`](https://github.com/aliplfrh/sunny/blob/main/apps/sunny/src-tauri/src/main.rs) (Tauri Host), [`crates/sun-core/src/settings.rs`](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/settings.rs) (Preferences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Shell"]
  node_ui["Launcher UI<br/>[main.js]"]
  node_host["Tauri Host<br/>[main.rs]"]
  node_snapshot["App Snapshot Cache<br/>[index.rs]"]
end

subgraph group_discovery["Search and Discovery"]
  node_appscan["App Discovery<br/>[apps.rs]"]
  node_search["Query Search<br/>[search.rs]"]
  node_matcher["Fuzzy Matcher<br/>[match_rank.rs]"]
  node_files["File Search<br/>[files.rs]"]
  node_clipboard[("Clipboard History<br/>[clipboard.rs]")]
end

subgraph group_utilities["Launcher Utilities"]
  node_websearch["Web Search<br/>[websearch.rs]"]
  node_calculator["Calculator<br/>[calc.rs]"]
  node_emoji["Emoji Picker<br/>[emoji.rs]"]
  node_lorem["Lorem Generator<br/>[lorem.rs]"]
  node_qr["QR Generator<br/>[qr.rs]"]
  node_video["Video Downloads<br/>[video.rs]"]
  node_setup["OmniGet Setup<br/>[omniget_setup.rs]"]
end

subgraph group_state["Settings and State"]
  node_settings[("Preferences<br/>[settings.rs]")]
  node_statefiles["Atomic State Writes<br/>[fsutil.rs]"]
end

subgraph group_integrations["Platform Integrations"]
  node_appsplatform["Windows App Support<br/>[lib.rs]"]
  node_hotkey["Hotkey Observer<br/>[win_space.rs]"]
  node_omniget["OmniGet Runner<br/>[omniget.rs]"]
end

node_user(("User"))
node_browser["Web Browser"]
node_windows["Windows"]

node_user -->|"opens and types"| node_ui
node_ui -.->|"invokes commands"| node_host
node_host -.->|"uses cache"| node_snapshot
node_search -->|"searches apps"| node_appscan
node_search -->|"scores matches"| node_matcher
node_search -->|"queries files"| node_files
node_appscan -.->|"merges store apps"| node_appsplatform
node_host -.->|"observes shortcut"| node_hotkey
node_user -->|"finds a file"| node_files
node_user -->|"searches history"| node_clipboard
node_user -->|"calculates query"| node_calculator
node_user -->|"searches web"| node_websearch
node_websearch -->|"opens search"| node_browser
node_user -->|"copies emoji"| node_emoji
node_user -->|"generates text"| node_lorem
node_user -->|"generates code"| node_qr
node_user -->|"downloads media"| node_video
node_video -.->|"uses setup"| node_setup
node_video -.->|"runs downloads"| node_omniget
node_omniget -.->|"runs local CLI"| node_windows
node_video -->|"reads preferences"| node_settings
node_settings -->|"validates engine"| node_websearch
node_settings -->|"uses atomic writes"| node_statefiles
node_clipboard -->|"uses atomic writes"| node_statefiles

click node_ui "https://github.com/aliplfrh/sunny/blob/main/apps/sunny/ui/main.js"
click node_host "https://github.com/aliplfrh/sunny/blob/main/apps/sunny/src-tauri/src/main.rs"
click node_snapshot "https://github.com/aliplfrh/sunny/blob/main/apps/sunny/src-tauri/src/index.rs"
click node_appscan "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/apps.rs"
click node_search "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/search.rs"
click node_matcher "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/match_rank.rs"
click node_files "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/files.rs"
click node_clipboard "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/clipboard.rs"
click node_appsplatform "https://github.com/aliplfrh/sunny/blob/main/crates/sun-platform/src/lib.rs"
click node_hotkey "https://github.com/aliplfrh/sunny/blob/main/crates/sun-platform/src/win_space.rs"
click node_settings "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/settings.rs"
click node_statefiles "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/fsutil.rs"
click node_websearch "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/websearch.rs"
click node_calculator "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/calc.rs"
click node_emoji "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/emoji.rs"
click node_lorem "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/lorem.rs"
click node_qr "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/qr.rs"
click node_video "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/video.rs"
click node_setup "https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/omniget_setup.rs"
click node_omniget "https://github.com/aliplfrh/sunny/blob/main/crates/sun-platform/src/omniget.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_ui,node_host,node_snapshot,node_user,node_browser toneBlue
class node_appscan,node_search,node_matcher,node_files,node_clipboard toneAmber
class node_websearch,node_calculator,node_emoji,node_lorem,node_qr,node_video,node_setup toneMint
class node_settings,node_statefiles toneRose
class node_appsplatform,node_hotkey,node_omniget,node_windows toneIndigo
```

## Components

### Desktop Shell

- [Launcher UI](https://github.com/aliplfrh/sunny/blob/main/apps/sunny/ui/main.js): `apps/sunny/ui/main.js`
- [Tauri Host](https://github.com/aliplfrh/sunny/blob/main/apps/sunny/src-tauri/src/main.rs): `apps/sunny/src-tauri/src/main.rs`
- [App Snapshot Cache](https://github.com/aliplfrh/sunny/blob/main/apps/sunny/src-tauri/src/index.rs): `apps/sunny/src-tauri/src/index.rs`

### Search and Discovery

- [App Discovery](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/apps.rs): `crates/sun-core/src/apps.rs`
- [Query Search](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/search.rs): `crates/sun-core/src/search.rs`
- [Fuzzy Matcher](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/match_rank.rs): `crates/sun-core/src/match_rank.rs`
- [File Search](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/files.rs): `crates/sun-core/src/files.rs`
- [Clipboard History](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/clipboard.rs): `crates/sun-core/src/clipboard.rs`

### Launcher Utilities

- [Web Search](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/websearch.rs): `crates/sun-core/src/websearch.rs`
- [Calculator](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/calc.rs): `crates/sun-core/src/calc.rs`
- [Emoji Picker](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/emoji.rs): `crates/sun-core/src/emoji.rs`
- [Lorem Generator](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/lorem.rs): `crates/sun-core/src/lorem.rs`
- [QR Generator](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/qr.rs): `crates/sun-core/src/qr.rs`
- [Video Downloads](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/video.rs): `crates/sun-core/src/video.rs`
- [OmniGet Setup](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/omniget_setup.rs): `crates/sun-core/src/omniget_setup.rs`

### Settings and State

- [Preferences](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/settings.rs): `crates/sun-core/src/settings.rs`
- [Atomic State Writes](https://github.com/aliplfrh/sunny/blob/main/crates/sun-core/src/fsutil.rs): `crates/sun-core/src/fsutil.rs`

### Platform Integrations

- [Windows App Support](https://github.com/aliplfrh/sunny/blob/main/crates/sun-platform/src/lib.rs): `crates/sun-platform/src/lib.rs`
- [Hotkey Observer](https://github.com/aliplfrh/sunny/blob/main/crates/sun-platform/src/win_space.rs): `crates/sun-platform/src/win_space.rs`
- [OmniGet Runner](https://github.com/aliplfrh/sunny/blob/main/crates/sun-platform/src/omniget.rs): `crates/sun-platform/src/omniget.rs`

### Other components

- **User**
- **Web Browser**
- **Windows**

## Connections

- User → Launcher UI: opens and types (evidence: `README.md`)
- Launcher UI → Tauri Host: invokes commands
- Tauri Host → App Snapshot Cache: uses cache (evidence: `apps/sunny/src-tauri/src/main.rs`)
- Query Search → App Discovery: searches apps (evidence: `crates/sun-core/src/search.rs`)
- Query Search → Fuzzy Matcher: scores matches (evidence: `crates/sun-core/src/search.rs`)
- Query Search → File Search: queries files (evidence: `crates/sun-core/src/search.rs`)
- App Discovery → Windows App Support: merges store apps
- Tauri Host → Hotkey Observer: observes shortcut
- User → File Search: finds a file (evidence: `README.md`)
- User → Clipboard History: searches history (evidence: `README.md`)
- User → Calculator: calculates query (evidence: `README.md`)
- User → Web Search: searches web (evidence: `README.md`)
- Web Search → Web Browser: opens search (evidence: `crates/sun-core/src/websearch.rs`)
- User → Emoji Picker: copies emoji (evidence: `README.md`)
- User → Lorem Generator: generates text (evidence: `README.md`)
- User → QR Generator: generates code (evidence: `README.md`)
- User → Video Downloads: downloads media (evidence: `README.md`)
- Video Downloads → OmniGet Setup: uses setup
- Video Downloads → OmniGet Runner: runs downloads
- OmniGet Runner → Windows: runs local CLI
- Video Downloads → Preferences: reads preferences (evidence: `crates/sun-core/src/video.rs`)
- Preferences → Web Search: validates engine (evidence: `crates/sun-core/src/settings.rs`)
- Preferences → Atomic State Writes: uses atomic writes (evidence: `crates/sun-core/src/settings.rs`)
- Clipboard History → Atomic State Writes: uses atomic writes (evidence: `crates/sun-core/src/clipboard.rs`)
