# Atlas architecture Deep technical reference for Atlas. The README has the pitch and feature list; this has the file paths and invariants. Atlas is a Tauri v2 desktop app: a React 19 frontend talking to a Rust backend over IPC. Almost every real feature crosses the whole stack: ``` src/features//components → stores (Zustand) → lib/*-api.ts (invoke + listen) ↓ src-tauri/src/commands/.rs ↓ crates/atlas-* ``` - **The frontend never touches the filesystem or spawns processes.** Everything goes through `invoke()` and `listen()`. - **Rust owns the heavy, stateful subsystems** — agent sessions, the terminal PTY. The stores that mirror them stay thin. ## High-level layout ``` ┌────────────────────────────────────────────────────────────────────────┐ │ Atlas (Tauri shell) │ │ │ │ ┌─────────────────────────────┐ ┌───────────────────────────────┐ │ │ │ React 19 frontend │ │ Rust backend │ │ │ │ (WKWebView on macOS) │◀──▶│ (tokio + tauri 2) │ │ │ │ │ IPC│ │ │ │ │ • Zustand stores │ │ • commands/ — 365 IPC verbs │ │ │ │ • code view, xterm, │ │ across 70 domain modules │ │ │ │ Tiptap, Pixi, TanStack │ │ • ported ACP stack (10 crates) │ │ │ │ • Tailwind v4 │ │ • atlas-native-agent (engine) │ │ │ │ │ │ • atlas-terminal (PTY) │ │ │ │ │ │ • atlas-memory / atlas-embed │ │ │ │ │ │ • spawn_blocking for all I/O │ │ │ └─────────────────────────────┘ └───────────────────────────────┘ │ │ │ │ Persistence: │ │ • Per-project: /.atlas/ (knowledge, canvas.json, │ │ editor-state.json, logs.jsonl, memory index, │ │ cloned repos, skills, packs) │ │ • Global: ~/.atlas/ (pinned log rows), │ │ /threads.db (session history) │ └────────────────────────────────────────────────────────────────────────┘ ``` ## Frontend (`src/`) Organized by **feature**, not file type: ``` src/features// components/ — React components; containers at the top level views/ — views: render from props alone (see "Containers and views") stores/ — Zustand store(s) for this feature lib/ — pure helpers, and the invoke()/listen() wrappers (-api.ts) ``` `src/features/` holds ~30 slices: app, chat, editor, terminal, browser, git, github, explorer, knowledge, canvas, layout, log, monitor, settings, memory, mission-control, model-chat, organisations, packs, projects, skills, telemetry, updater, and more. - **Cross-feature widgets** live in `src/components/`. - **UI primitives** come from the design package, `@tryatlas/design` (ADR-0027). - **Shared helpers** live in `src/lib/`. `@/` aliases `src/`. ### The design package and themes `@tryatlas/design` is installed from a git tag, pinned exactly in `package.json` (ADR-0027). It owns the primitives, the scales and named utilities, `keys.toml` (every theme key and how it derives), the TypeScript resolver, the built-in themes and the ratchet's rules. Change it there and bump the pin. A theme reaches the screen like this: 1. Rust (`crates/atlas-theme`) loads the built-in themes and the user's `~/.config/atlas/themes/*.toml` (`atlas-dev` under `bun run dev:app`; an absolute `XDG_CONFIG_HOME` replaces `~/.config`), against the key list and rule tables `bun run theme:keys` copied from the package. A file that is not `schema = 1` is skipped with a warning and the default `atlas` theme still loads; there is no legacy format. 2. `src/features/theme/apply-theme.ts` resolves the theme with the package's `resolveTheme` and writes every value under `html:root` in `