# smallhug/aura architecture

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

- Interactive diagram: https://gitdiagram.com/smallhug/aura
- Repository: https://github.com/smallhug/aura

## Overview

Aura is a Tauri desktop translation tool centered on a floating Island: the user triggers translation, the frontend reads clipboard text, and the backend translates it before opening a result window. Settings, appearance, window behavior, clipboard utilities, and screenshot launch are separate supporting capabilities. The excerpts show the translation and IPC paths; some README features, including clipboard monitoring and screenshot recognition, are documented but not verified in sampled implementation, so those links are left unverified or omitted.

Main entry points: [`src/services/tauriApi.ts`](https://github.com/smallhug/aura/blob/main/src/services/tauriApi.ts) (Tauri API Adapter), [`src/store/islandStore.ts`](https://github.com/smallhug/aura/blob/main/src/store/islandStore.ts) (Island State), [`src-tauri/src/commands/translate.rs`](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/translate.rs) (Translation Command), [`src-tauri/src/lib.rs`](https://github.com/smallhug/aura/blob/main/src-tauri/src/lib.rs) (Tauri Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop UI"]
  node_island["Floating Island<br/>[Island.tsx]"]
  node_island_state["Island State<br/>[islandStore.ts]"]
  node_settings_ui["Settings UI<br/>[SettingsApp.tsx]"]
  node_translate_ui["Translation Window UI<br/>[TranslateApp.tsx]"]
  node_about_ui["About UI<br/>[AboutApp.tsx]"]
end

subgraph group_ipc["IPC and Windowing"]
  node_api["Tauri API Adapter<br/>[tauriApi.ts]"]
  node_app_shell["Tauri Runtime<br/>[lib.rs]"]
  node_translate_window["Translation Window Commands<br/>[window.rs]"]
  node_clipboard["Clipboard Commands<br/>[clipboard.rs]"]
  node_window_commands["Window Commands<br/>[window.rs]"]
end

subgraph group_translation["Translation"]
  node_translate_command["Translation Command<br/>[translate.rs]"]
  node_splitter["Text Splitter<br/>[text_splitter.rs]"]
  node_cache[("Translation Cache<br/>[cache.rs]")]
  node_bing["Bing Translator<br/>[translator.rs]"]
end

subgraph group_settings["Configuration"]
  node_config_commands["Configuration Commands<br/>[config.rs]"]
  node_autostart["Autostart Commands<br/>[autostart.rs]"]
end

node_user(("User"))
node_bing_service["Bing Translation Service"]
node_screenshot_tool["OS Screenshot Tool"]

node_user -->|"interacts with"| node_island
node_island -->|"updates state"| node_island_state
node_island_state -->|"invokes"| node_api
node_island_state -->|"reads clipboard"| node_clipboard
node_island_state -->|"requests translation"| node_translate_command
node_island_state -->|"opens result window"| node_translate_window
node_api -->|"invokes translation"| node_translate_command
node_api -->|"invokes clipboard"| node_clipboard
node_api -->|"invokes configuration"| node_config_commands
node_api -->|"invokes window actions"| node_window_commands
node_settings_ui -->|"loads and saves"| node_api
node_translate_ui -->|"loads translation content"| node_api
node_about_ui -->|"loads app information"| node_api
node_app_shell -->|"registers commands"| node_translate_window
node_app_shell -->|"registers commands"| node_config_commands
node_app_shell -->|"registers commands"| node_autostart
node_translate_command -->|"checks and stores"| node_cache
node_translate_command -->|"splits and merges"| node_splitter
node_translate_command -->|"translates chunks"| node_bing
node_bing -->|"requests translation"| node_bing_service
node_api -.->|"launches screenshot"| node_window_commands
node_window_commands -->|"launches clip utility"| node_screenshot_tool
node_user -->|"configures app"| node_settings_ui
node_user -.->|"starts screenshot flow"| node_screenshot_tool

click node_island "https://github.com/smallhug/aura/blob/main/src/components/Island/Island.tsx"
click node_island_state "https://github.com/smallhug/aura/blob/main/src/store/islandStore.ts"
click node_settings_ui "https://github.com/smallhug/aura/blob/main/src/SettingsApp.tsx"
click node_translate_ui "https://github.com/smallhug/aura/blob/main/src/TranslateApp.tsx"
click node_about_ui "https://github.com/smallhug/aura/blob/main/src/AboutApp.tsx"
click node_api "https://github.com/smallhug/aura/blob/main/src/services/tauriApi.ts"
click node_app_shell "https://github.com/smallhug/aura/blob/main/src-tauri/src/lib.rs"
click node_translate_window "https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/window.rs"
click node_clipboard "https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/clipboard.rs"
click node_config_commands "https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/config.rs"
click node_autostart "https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/autostart.rs"
click node_window_commands "https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/window.rs"
click node_translate_command "https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/translate.rs"
click node_splitter "https://github.com/smallhug/aura/blob/main/src-tauri/src/services/text_splitter.rs"
click node_cache "https://github.com/smallhug/aura/blob/main/src-tauri/src/services/cache.rs"
click node_bing "https://github.com/smallhug/aura/blob/main/src-tauri/src/services/translator.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_island,node_island_state,node_settings_ui,node_translate_ui,node_about_ui,node_user,node_screenshot_tool toneBlue
class node_api,node_app_shell,node_translate_window,node_clipboard,node_window_commands toneAmber
class node_translate_command,node_splitter,node_cache,node_bing toneMint
class node_config_commands,node_autostart toneRose
class node_bing_service toneIndigo
```

## Components

### Desktop UI

- [Floating Island](https://github.com/smallhug/aura/blob/main/src/components/Island/Island.tsx): `src/components/Island/Island.tsx`
- [Island State](https://github.com/smallhug/aura/blob/main/src/store/islandStore.ts): `src/store/islandStore.ts`
- [Settings UI](https://github.com/smallhug/aura/blob/main/src/SettingsApp.tsx): `src/SettingsApp.tsx`
- [Translation Window UI](https://github.com/smallhug/aura/blob/main/src/TranslateApp.tsx): `src/TranslateApp.tsx`
- [About UI](https://github.com/smallhug/aura/blob/main/src/AboutApp.tsx): `src/AboutApp.tsx`

### IPC and Windowing

- [Tauri API Adapter](https://github.com/smallhug/aura/blob/main/src/services/tauriApi.ts): `src/services/tauriApi.ts`
- [Tauri Runtime](https://github.com/smallhug/aura/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Translation Window Commands](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/window.rs): `src-tauri/src/commands/window.rs`
- [Clipboard Commands](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/clipboard.rs): `src-tauri/src/commands/clipboard.rs`
- [Window Commands](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/window.rs): `src-tauri/src/commands/window.rs`

### Translation

- [Translation Command](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/translate.rs): `src-tauri/src/commands/translate.rs`
- [Text Splitter](https://github.com/smallhug/aura/blob/main/src-tauri/src/services/text_splitter.rs): `src-tauri/src/services/text_splitter.rs`
- [Translation Cache](https://github.com/smallhug/aura/blob/main/src-tauri/src/services/cache.rs): `src-tauri/src/services/cache.rs`
- [Bing Translator](https://github.com/smallhug/aura/blob/main/src-tauri/src/services/translator.rs): `src-tauri/src/services/translator.rs`

### Configuration

- [Configuration Commands](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/config.rs): `src-tauri/src/commands/config.rs`
- [Autostart Commands](https://github.com/smallhug/aura/blob/main/src-tauri/src/commands/autostart.rs): `src-tauri/src/commands/autostart.rs`

### Other components

- **User**
- **Bing Translation Service**
- **OS Screenshot Tool**

## Connections

- User → Floating Island: interacts with (evidence: `README.md`)
- Floating Island → Island State: updates state (evidence: `src/components/Island/Island.tsx`)
- Island State → Tauri API Adapter: invokes (evidence: `src/store/islandStore.ts`)
- Island State → Clipboard Commands: reads clipboard
- Island State → Translation Command: requests translation (evidence: `src-tauri/src/commands/translate.rs`)
- Island State → Translation Window Commands: opens result window (evidence: `src-tauri/src/commands/window.rs`)
- Tauri API Adapter → Translation Command: invokes translation (evidence: `src/services/tauriApi.ts`)
- Tauri API Adapter → Clipboard Commands: invokes clipboard (evidence: `src/services/tauriApi.ts`)
- Tauri API Adapter → Configuration Commands: invokes configuration (evidence: `src/services/tauriApi.ts`)
- Tauri API Adapter → Window Commands: invokes window actions (evidence: `src/services/tauriApi.ts`)
- Settings UI → Tauri API Adapter: loads and saves (evidence: `src/SettingsApp.tsx`)
- Translation Window UI → Tauri API Adapter: loads translation content (evidence: `src/TranslateApp.tsx`)
- About UI → Tauri API Adapter: loads app information (evidence: `src/AboutApp.tsx`)
- Tauri Runtime → Translation Window Commands: registers commands (evidence: `src-tauri/src/lib.rs`)
- Tauri Runtime → Configuration Commands: registers commands (evidence: `src-tauri/src/lib.rs`)
- Tauri Runtime → Autostart Commands: registers commands (evidence: `src-tauri/src/lib.rs`)
- Translation Command → Translation Cache: checks and stores (evidence: `src-tauri/src/commands/translate.rs`)
- Translation Command → Text Splitter: splits and merges (evidence: `src-tauri/src/commands/translate.rs`)
- Translation Command → Bing Translator: translates chunks (evidence: `src-tauri/src/commands/translate.rs`)
- Bing Translator → Bing Translation Service: requests translation (evidence: `src-tauri/src/services/translator.rs`)
- Tauri API Adapter → Window Commands: launches screenshot
- Window Commands → OS Screenshot Tool: launches clip utility (evidence: `src-tauri/src/commands/window.rs`)
- User → Settings UI: configures app (evidence: `README.md`)
- User → OS Screenshot Tool: starts screenshot flow
