# mountain-loop/yaak architecture

> Architecture diagram of the GitHub repository mountain-loop/yaak, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mountain-loop/yaak
- Repository: https://github.com/mountain-loop/yaak

## Overview

##### Project type and purpose
- This is a full-stack, desktop-first API client (Yaak) built on Tauri.
- It combines a Rust/Tauri “host engine” with a React/TypeScript UI, an embedded SQLite-backed data layer, and a Node-based plugin runtime.

##### File structure at a high level
- src-tauri – Rust/Tauri host crates and modules (commands.rs, http_request.rs, plugin_events.rs, plus many yaak-* Rust crates for crypto, HTTP, gRPC, sync, etc.)
- src-web – React/TypeScript UI rendered in a WebView (components, hooks, lib, routes)
- packages – shared TypeScript libs and plugin-runtime support types
- plugins – individual plugin packages (auth-*, importer-*, filter-*, template-function-*, theme-*, etc.) that run under the plugin runtime
- scripts – build/migration/publish helper scripts
- sqlite migrations under src-tauri/yaak-models

##### README
- Describes Yaak as a “fast, privacy-first API client” for REST, GraphQL, SSE, WebSocket, gRPC
- Highlights importers (Postman, OpenAPI, Curl), authentication plugins, template tags, theming, file-system sync

- Blue rectangles for UI components
- Green for core host engine and Rust crates
- Orange for plugin runtime and plugin modules

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        ReactUI["React/TypeScript UI"]:::ui
    end

    %% Tauri Host Engine and Core Services
    subgraph "Tauri Host Engine"
        HostEngine["Tauri Host Engine"]:::host

        subgraph "Core Rust Services"
            Common["yaak-common"]:::host
            Crypto["yaak-crypto"]:::host
            HTTP["yaak-http"]:::host
            GRPC["yaak-grpc"]:::host
            WS["yaak-ws"]:::host
            SSE["yaak-sse"]:::host
            Git["yaak-git"]:::host
            Sync["yaak-sync"]:::host
            Templates["yaak-templates"]:::host
        end

        DataLayer["SQLite (yaak-models)"]:::data
        PluginsManager["Plugin Microkernel"]:::host
        StaticAssets["Static Assets & Config"]:::host
        Entry["Desktop App Entrypoint"]:::host
    end

    %% Plugin Layer
    subgraph "Plugin Layer"
        PluginRuntime["Plugin Runtime (Node.js)"]:::plugin
        PluginTypes["Plugin Runtime Types"]:::plugin

        subgraph "Plugins"
            PluginPackages["Plugin Packages"]:::plugin
        end
    end

    %% External Services
    subgraph "External Services"
        Network["Network (HTTP/gRPC/WS/SSE)"]:::external
        Keychain["OS Keychain"]:::external
        FS["File System"]:::external
    end

    %% Connections
    ReactUI -->|"Tauri Command"| HostEngine
    HostEngine -->|"Tauri Event"| ReactUI
    HostEngine -->|"uses"| Common
    HostEngine -->|"uses"| Crypto
    HostEngine -->|"uses"| HTTP
    HostEngine -->|"uses"| GRPC
    HostEngine -->|"uses"| WS
    HostEngine -->|"uses"| SSE
    HostEngine -->|"uses"| Git
    HostEngine -->|"uses"| Sync
    HostEngine -->|"uses"| Templates
    HostEngine -->|"SQL queries"| DataLayer
    HostEngine -->|"spawn + IPC/WebSocket"| PluginRuntime
    PluginRuntime -->|"loads"| PluginPackages
    PluginRuntime -->|"API surface"| PluginTypes
    HostEngine -->|"HTTP/gRPC/WS/SSE"| Network
    HostEngine -->|"Keychain API"| Keychain
    HostEngine -->|"File operations"| FS

    %% Click Events
    click ReactUI "https://github.com/mountain-loop/yaak/tree/main/src-web/"
    click HostEngine "https://github.com/mountain-loop/yaak/tree/main/src-tauri/src/"
    click PluginRuntime "https://github.com/mountain-loop/yaak/tree/main/packages/plugin-runtime/src/"
    click PluginTypes "https://github.com/mountain-loop/yaak/tree/main/packages/plugin-runtime-types/src/"
    click Common "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-common/src/"
    click Crypto "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-crypto/src/"
    click HTTP "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-http/src/"
    click GRPC "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-grpc/src/"
    click WS "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-ws/src/"
    click SSE "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-sse/src/"
    click Git "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-git/src/"
    click Sync "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-sync/src/"
    click Templates "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-templates/src/"
    click DataLayer "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-models/src/"
    click PluginsManager "https://github.com/mountain-loop/yaak/tree/main/src-tauri/yaak-plugins/src/"
    click StaticAssets "https://github.com/mountain-loop/yaak/tree/main/src-tauri/static/"
    click Entry "https://github.com/mountain-loop/yaak/blob/main/src-tauri/src/main.rs"
    click PluginPackages "https://github.com/mountain-loop/yaak/tree/main/plugins/"

    %% Styles
    classDef ui fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px
    classDef host fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px
    classDef data fill:#D7CCC8,stroke:#4E342E,stroke-width:2px
    classDef plugin fill:#FFE0B2,stroke:#E65100,stroke-width:2px
    classDef external fill:#CFD8DC,stroke:#37474F,stroke-width:2px
```
