Knowledge Base updated: 2026-11-16
Knowledge Base Index
Orientation
This repository is a Tauri desktop wrapper for ChatGPT, with a React/Vite frontend driving the user-facing views and a Rust/Tauri backend providing native commands, configuration, windows, setup, and packaging.
Main parts:
src/— React frontend shell, views, hooks, styling, and window chrome.src-tauri/— Rust/Tauri desktop runtime, native commands, setup, config, templates, and window management.src-tauri/scripts/anddocs/static/— browser-side assets used by the Ask/chat experience.- root build/config files — Vite, TypeScript, Tailwind/PostCSS, npm/pnpm, and Rust workspace/package configuration.
Critical state primarily lives in local native configuration managed by the Tauri backend; the frontend reads and updates app behavior through Tauri commands and hooks rather than a database or remote service owned by this repo.
Architecture diagrams
flowchart LR
subgraph Frontend[src]
Main[src/main.tsx]
App[src/App.tsx]
Ask[src/view/Ask.tsx]
Settings[src/view/Settings.tsx]
Chrome[Titlebar + WinTitlebar]
Hooks[useInfo + useTheme]
end
subgraph Native[src-tauri]
TauriMain[src-tauri/src/main.rs]
Setup[core/setup.rs]
Commands[core/cmd.rs]
Config[core/conf.rs]
Templates[core/template.rs]
Windows[core/window.rs]
end
subgraph Assets[assets/config]
Scripts[src-tauri/scripts/ask.js]
Static[docs/static]
TauriConf[tauri.conf.json + capabilities]
end
Main --> App
App --> Ask
App --> Settings
App --> Chrome
Settings --> Hooks
Ask --> Scripts
Ask --> Static
App --> Commands
Chrome --> Windows
TauriMain --> Setup
Setup --> Commands
Commands --> Config
Commands --> Templates
Commands --> Windows
TauriMain --> TauriConf
sequenceDiagram
participant User
participant React as React views
participant Tauri as Tauri command layer
participant Config as Native config/template/window modules
User->>React: interact with Ask, Settings, or titlebar
React->>Tauri: invoke native command or use hook
Tauri->>Config: read/write config, templates, or windows
Config-->>Tauri: native result
Tauri-->>React: response/event result
React-->>User: update UI
Glossary
- Ask view — the ChatGPT interaction surface implemented by src/…/Ask.tsx and related injected/static assets.
- Template system — Rust-side content/template handling in src-tauri/…/template.rs.
- Window chrome — custom frontend titlebar controls plus native window helpers.
Codebase-wide invariants
- Frontend and native code are partitioned by top-level directory: React/Vite code is under
src/, while Rust/Tauri code is undersrc-tauri/(src/main.tsx, src-tauri/…/main.rs). - Native Rust functionality is organized into focused modules under
src-tauri/src/core/, with module wiring represented by src-tauri/…/mod.rs. - Tauri packaging and permissions are configured in src-tauri/tauri.conf.json and
src-tauri/capabilities/**, while Rust dependencies live in src-tauri/Cargo.toml and the workspace/root lockfiles. - Frontend build and styling configuration lives at the repository root (vite.config.ts, tsconfig*.json, tailwind.config.js, postcss.config.js) rather than inside
src/.
Routing table
- package.json, pnpm-lock.yaml, index.html, vite.config.ts, tsconfig*.json, postcss.config.js, tailwind.config.js,
public/**, src/main.tsx, src/App.tsx, src/base.css, src/types.d.ts, src/vite-env.d.ts -> docs/frontend-app-shell.md - src/…/Ask.tsx, src-tauri/…/ask.js,
docs/static/**-> docs/ask-view-flow.md - src/…/Settings.tsx, src/…/useInfo.tsx, src/…/useTheme.tsx -> docs/settings-theme-info.md
- src/…/Titlebar.tsx, src/…/WinTitlebar.tsx -> docs/window-chrome.md
- Cargo.toml, Cargo.lock, rustfmt.toml, src-tauri/Cargo.toml, src-tauri/build.rs, src-tauri/tauri.conf.json,
src-tauri/Info.plist,src-tauri/capabilities/**,src-tauri/icons/**, src-tauri/…/main.rs, src-tauri/…/mod.rs, src-tauri/…/setup.rs, src-tauri/…/constant.rs -> docs/tauri-bootstrap.md - src-tauri/…/cmd.rs, any new or changed Tauri command exposed to the frontend -> docs/tauri-commands.md
- src-tauri/…/conf.rs, any change to persisted native settings/schema/defaults -> docs/config-persistence.md
- src-tauri/…/template.rs, any change to template loading/rendering/management behavior -> docs/template-system.md
- src-tauri/…/window.rs, any native window creation, lookup, focus, sizing, or visibility behavior -> docs/native-window-management.md