# gabrielfrutuoso/flyboard architecture

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

- Interactive diagram: https://gitdiagram.com/gabrielfrutuoso/flyboard
- Repository: https://github.com/gabrielfrutuoso/flyboard

## Overview

FlyBoard is a desktop virtual keyboard: users click rendered keys, and the app translates key and macro actions into native input so the focused application receives keyboard events. A second workflow edits layouts and macros, saving board data through the Tauri backend. The README also documents Linux uinput input, Windows support is represented in the source tree, and physical-key highlighting is a documented capability. Some frontend-to-native command wiring is implicit in Tauri invokes; edges are limited to relationships shown in excerpts, the source index, or README.

Main entry points: [`src/App.tsx`](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/App.tsx) (Window router), [`src/utils/boardConfig.ts`](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/utils/boardConfig.ts) (Board storage and model), [`src/components/editor/LayoutsTab.tsx`](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/LayoutsTab.tsx) (Layout editing), [`src/utils/useKeyboard.tsx`](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/utils/useKeyboard.tsx) (Key handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_keyboard["Keyboard interaction"]
  node_app["Window router<br/>[App.tsx]"]
  node_keyboard_logic["Key handling<br/>[useKeyboard.tsx]"]
  node_key_view["Key display<br/>[Key.tsx]"]
  node_grid_view["Keyboard grid<br/>[KeyboardGrid.tsx]"]
  node_title_bar["Window controls<br/>[TitleBar.tsx]"]
end

subgraph group_editing["Layout and macro editing"]
  node_layout_editor["Editor tabs<br/>[LayoutEditor.tsx]"]
  node_layout_tab["Layout editing<br/>[LayoutsTab.tsx]"]
  node_layout_state["Layout operations<br/>[useLayoutEditor.ts]"]
  node_layout_preview["Layout preview"]
  node_layout_drag["Layout drag-drop<br/>[dnd.tsx]"]
  node_macro_tab["Macro editing<br/>[MacrosTab.tsx]"]
  node_macro_state["Macro operations<br/>[useMacroEditor.ts]"]
  node_palette["Key palette<br/>[KeyPalette.tsx]"]
end

subgraph group_input["Native input"]
  node_linux_input["Linux uinput<br/>[linux.rs]"]
  node_windows_input["Windows input<br/>[windows.rs]"]
  node_input_dispatch["Platform dispatch<br/>[mod.rs]"]
  node_tauri_backend["Tauri commands<br/>[lib.rs]"]
end

subgraph group_data["Board data"]
  node_board_document["Board document"]
  node_board_config["Board storage and model<br/>[boardConfig.ts]"]
  node_key_model["Key mappings<br/>[keys.ts]"]
end

node_user(("User"))
node_focused_app["Focused application"]

node_user -->|"uses"| node_app
node_app -->|"uses"| node_keyboard_logic
node_app -->|"routes to"| node_layout_editor
node_app -->|"renders"| node_key_view
node_app -->|"renders"| node_grid_view
node_app -->|"renders"| node_title_bar
node_layout_editor -->|"renders"| node_layout_tab
node_layout_editor -->|"renders"| node_macro_tab
node_layout_editor -->|"loads and saves"| node_board_document
node_layout_tab -->|"uses"| node_layout_state
node_layout_tab -->|"renders"| node_layout_preview
node_layout_tab -->|"uses"| node_layout_drag
node_layout_state -->|"uses"| node_board_config
node_layout_preview -->|"renders"| node_key_view
node_layout_tab -->|"uses"| node_palette
node_macro_tab -->|"uses"| node_macro_state
node_macro_tab -->|"renders"| node_palette
node_macro_state -->|"runs macro steps"| node_board_config
node_board_document -->|"loads and saves"| node_board_config
node_keyboard_logic -->|"loads boards"| node_board_config
node_keyboard_logic -->|"uses mappings"| node_key_model
node_board_config -->|"uses key definitions"| node_key_model
node_board_config -->|"invokes commands"| node_tauri_backend
node_keyboard_logic -.->|"invokes input commands"| node_tauri_backend
node_tauri_backend -->|"dispatches input"| node_input_dispatch
node_input_dispatch -->|"selects platform"| node_linux_input
node_input_dispatch -->|"selects platform"| node_windows_input
node_linux_input -->|"sends key events"| node_focused_app
node_windows_input -.->|"sends key events"| node_focused_app

click node_app "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/App.tsx"
click node_keyboard_logic "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/utils/useKeyboard.tsx"
click node_key_view "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/Key.tsx"
click node_grid_view "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/KeyboardGrid.tsx"
click node_title_bar "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/TitleBar.tsx"
click node_layout_editor "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/LayoutEditor.tsx"
click node_layout_tab "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/LayoutsTab.tsx"
click node_layout_state "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/layouts/useLayoutEditor.ts"
click node_layout_preview "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/layouts/LayoutPreviewGrid.tsx"
click node_layout_drag "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/layouts/dnd.tsx"
click node_macro_tab "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/MacrosTab.tsx"
click node_macro_state "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/hooks/useMacroEditor.ts"
click node_palette "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/KeyPalette.tsx"
click node_board_document "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/hooks/useBoardDocument.ts"
click node_board_config "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/utils/boardConfig.ts"
click node_key_model "https://github.com/gabrielfrutuoso/flyboard/blob/main/src/keys.ts"
click node_linux_input "https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/input/linux.rs"
click node_windows_input "https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/input/windows.rs"
click node_input_dispatch "https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/input/mod.rs"
click node_tauri_backend "https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/lib.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_keyboard_logic,node_key_view,node_grid_view,node_title_bar,node_user toneBlue
class node_layout_editor,node_layout_tab,node_layout_state,node_layout_preview,node_layout_drag,node_macro_tab,node_macro_state,node_palette toneAmber
class node_linux_input,node_windows_input,node_input_dispatch,node_tauri_backend toneMint
class node_board_document,node_board_config,node_key_model toneRose
class node_focused_app toneIndigo
```

## Components

### Keyboard interaction

- [Window router](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/App.tsx): `src/App.tsx`
- [Key handling](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/utils/useKeyboard.tsx): `src/utils/useKeyboard.tsx`
- [Key display](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/Key.tsx): `src/components/Key.tsx`
- [Keyboard grid](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/KeyboardGrid.tsx): `src/components/KeyboardGrid.tsx`
- [Window controls](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/TitleBar.tsx): `src/components/TitleBar.tsx`

### Layout and macro editing

- [Editor tabs](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/LayoutEditor.tsx): `src/components/editor/LayoutEditor.tsx`
- [Layout editing](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/LayoutsTab.tsx): `src/components/editor/LayoutsTab.tsx`
- [Layout operations](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/layouts/useLayoutEditor.ts): `src/components/editor/layouts/useLayoutEditor.ts`
- [Layout preview](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/layouts/LayoutPreviewGrid.tsx): `src/components/editor/layouts/LayoutPreviewGrid.tsx`
- [Layout drag-drop](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/layouts/dnd.tsx): `src/components/editor/layouts/dnd.tsx`
- [Macro editing](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/MacrosTab.tsx): `src/components/editor/MacrosTab.tsx`
- [Macro operations](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/hooks/useMacroEditor.ts): `src/components/editor/hooks/useMacroEditor.ts`
- [Key palette](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/KeyPalette.tsx): `src/components/editor/KeyPalette.tsx`

### Native input

- [Linux uinput](https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/input/linux.rs): `src-tauri/src/input/linux.rs`
- [Windows input](https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/input/windows.rs): `src-tauri/src/input/windows.rs`
- [Platform dispatch](https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/input/mod.rs): `src-tauri/src/input/mod.rs`
- [Tauri commands](https://github.com/gabrielfrutuoso/flyboard/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Board data

- [Board document](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/components/editor/hooks/useBoardDocument.ts): `src/components/editor/hooks/useBoardDocument.ts`
- [Board storage and model](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/utils/boardConfig.ts): `src/utils/boardConfig.ts`
- [Key mappings](https://github.com/gabrielfrutuoso/flyboard/blob/main/src/keys.ts): `src/keys.ts`

### Other components

- **User**
- **Focused application**

## Connections

- User → Window router: uses (evidence: `README.md`)
- Window router → Key handling: uses (evidence: `src/App.tsx`)
- Window router → Editor tabs: routes to (evidence: `src/App.tsx`)
- Window router → Key display: renders (evidence: `src/App.tsx`)
- Window router → Keyboard grid: renders (evidence: `src/App.tsx`)
- Window router → Window controls: renders (evidence: `src/App.tsx`)
- Editor tabs → Layout editing: renders (evidence: `src/components/editor/LayoutEditor.tsx`)
- Editor tabs → Macro editing: renders (evidence: `src/components/editor/LayoutEditor.tsx`)
- Editor tabs → Board document: loads and saves (evidence: `src/components/editor/LayoutEditor.tsx`)
- Layout editing → Layout operations: uses (evidence: `src/components/editor/LayoutsTab.tsx`)
- Layout editing → Layout preview: renders (evidence: `src/components/editor/LayoutsTab.tsx`)
- Layout editing → Layout drag-drop: uses (evidence: `src/components/editor/LayoutsTab.tsx`)
- Layout operations → Board storage and model: uses (evidence: `src/components/editor/layouts/useLayoutEditor.ts`)
- Layout preview → Key display: renders (evidence: `src/components/editor/layouts/LayoutPreviewGrid.tsx`)
- Layout editing → Key palette: uses (evidence: `src/components/editor/LayoutsTab.tsx`)
- Macro editing → Macro operations: uses (evidence: `src/components/editor/MacrosTab.tsx`)
- Macro editing → Key palette: renders (evidence: `src/components/editor/MacrosTab.tsx`)
- Macro operations → Board storage and model: runs macro steps (evidence: `src/components/editor/hooks/useMacroEditor.ts`)
- Board document → Board storage and model: loads and saves (evidence: `src/components/editor/hooks/useBoardDocument.ts`)
- Key handling → Board storage and model: loads boards (evidence: `src/utils/useKeyboard.tsx`)
- Key handling → Key mappings: uses mappings (evidence: `src/utils/useKeyboard.tsx`)
- Board storage and model → Key mappings: uses key definitions (evidence: `src/utils/boardConfig.ts`)
- Board storage and model → Tauri commands: invokes commands (evidence: `src/utils/boardConfig.ts`)
- Key handling → Tauri commands: invokes input commands
- Tauri commands → Platform dispatch: dispatches input (evidence: `src-tauri/src/lib.rs`)
- Platform dispatch → Linux uinput: selects platform (evidence: `src-tauri/src/input/mod.rs`)
- Platform dispatch → Windows input: selects platform (evidence: `src-tauri/src/input/mod.rs`)
- Linux uinput → Focused application: sends key events (evidence: `README.md`)
- Windows input → Focused application: sends key events
