# 3dyuval/tabby architecture

> Architecture diagram of the GitHub repository 3dyuval/tabby, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/3dyuval/tabby
- Repository: https://github.com/3dyuval/tabby

## Overview

##### Main Components
- Core Functionality Module: Represent “tabby-core” as the central component which contains APIs, the primary business logic, services (like configuration, profiles, hotkeys, window management, notifications, etc.) plus UI component definitions.
- Shell and Runtime: Include the “tabby-electron” package which is responsible for interfacing with the operating system, providing platform-specific integrations (e.g., file providers, docking, electron services, and host window management).
- Terminal Engine: Highlight components that implement the terminal emulator (the VT220 emulation, Unicode support, split panes, input/output processing), which can be found in the “tabby-terminal” package.
- Web and Local Variants: There are separate packages for running Tabby as a web application (tabby-web and tabby-web-demo) and for local configurations (tabby-local, tabby-settings) to manage user settings, profiles, and configuration synchronization.

##### Relationships and Interactions
- At the center, place Tabby Core as the nexus that defines APIs and service interfaces shared between UI components and platform-dependent modules.
- That protocol-specific modules (SSH, Telnet, Serial) plug into the core application, with the Plugin Manager enabling dynamic loading of additional functionality.
- Interactions from the UI front-end (rendered using Electron’s web stack) that communicates with the core services, for example:
– Terminal UI sends input to the terminal engine.
– Session management forwards connection data to respective protocol handlers.
– Plugin manager loads extra UI modules and wiring event handlers.
- External dependencies such as Electron runtime, Node.js modules, and third-party libraries (for example, for VT220 emulation or file handling).

##### Architectural and Design Patterns
- Modular and Layered Architecture: Emphasize that the repository is split into distinct modules (core, UI shell, communication protocols, plugins) following separation of concerns.
- Plugin Architecture: Represent extension points and a plugin manager that dynamically loads additional components (using “pluginManager.ts” in the app/lib). Indicate how core APIs are exposed to plugins.
- Cross-Platform Abstraction: Incorporate how the application supports different OS-specific behaviors (with separate configuration defaults for Windows, macOS, Linux) and uses Electron as a platform-agnostic container.

##### Technology Stack and Frameworks
- Electron is used for the desktop application shell.
- TypeScript is predominant (look at the .ts files, tsconfig.json files).
- Webpack is configured to bundle the modules.
- For styling, there are SCSS and Pug templates for components.
- Node.js runtime and various Node modules are core to the back-end/desktop integration.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Core Layer
    subgraph "Core Layer"
        core["Tabby Core"] 
    end

    %% Native Integration Layer
    subgraph "Native Integration"
        electron["Shell/Runtime (Electron)"]
        uac["Elevated Privileges (UAC)"]
    end

    %% Terminal and Protocol Modules
    subgraph "Terminal & Protocol Modules"
        terminal["Terminal Engine"]
        ssh["SSH Module"]
        telnet["Telnet Module"]
        serial["Serial Module"]
        linkifier["Linkifier"]
    end

    %% Plugin and Extension Manager
    subgraph "Plugin & Extensions"
        pluginManager["Plugin Manager"]
    end

    %% UI and Configuration Modules
    subgraph "UI & Configuration"
        localConfig["Local Configurations"]
        web["Web Variant"]
    end

    %% Connections
    electron -->|"calls_core_API"| core
    core -->|"exposes_API"| electron

    core -->|"processes_input"| terminal
    terminal -->|"sends_output"| core

    ssh -->|"handles_protocol"| core
    telnet -->|"handles_protocol"| core
    serial -->|"handles_protocol"| core
    core -->|"integrates_protocols"| ssh
    core -->|"integrates_protocols"| telnet
    core -->|"integrates_protocols"| serial

    linkifier -->|"parses_links"| core
    core -->|"uses_linkifier"| linkifier

    pluginManager -->|"loads_extensions"| core
    core -->|"exposes_plugins"| pluginManager

    localConfig -->|"updates_config"| core
    core -->|"notifies_config"| localConfig

    web -->|"accesses_core"| core
    core -->|"serves_API"| web

    electron -->|"manages_native"| uac
    uac -->|"requests_privilege"| electron

    electron -->|"integrates_UI_plugins"| pluginManager
    pluginManager -->|"sends_plugin_data"| electron

    %% Styles
    classDef core fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef shell fill:#cce5ff,stroke:#0047b3,stroke-width:2px;
    classDef terminal fill:#dfffdf,stroke:#006600,stroke-width:2px;
    classDef protocol fill:#ffffcc,stroke:#b3b300,stroke-width:2px;
    classDef plugin fill:#e5ccff,stroke:#6600cc,stroke-width:2px;
    classDef ui fill:#ffe6cc,stroke:#cc5200,stroke-width:2px;

    class core core;
    class electron,uac shell;
    class terminal,linkifier terminal;
    class ssh,telnet,serial protocol;
    class pluginManager plugin;
    class localConfig,web ui;

    %% Click Events
    click core "https://github.com/3dyuval/tabby/tree/master/tabby-core/"
    click electron "https://github.com/3dyuval/tabby/tree/master/tabby-electron/"
    click terminal "https://github.com/3dyuval/tabby/tree/master/tabby-terminal/"
    click ssh "https://github.com/3dyuval/tabby/tree/master/tabby-ssh/"
    click telnet "https://github.com/3dyuval/tabby/tree/master/tabby-telnet/"
    click serial "https://github.com/3dyuval/tabby/tree/master/tabby-serial/"
    click pluginManager "https://github.com/3dyuval/tabby/tree/master/tabby-plugin-manager/"
    click linkifier "https://github.com/3dyuval/tabby/tree/master/tabby-linkifier/"
    click localConfig "https://github.com/3dyuval/tabby/tree/master/tabby-local/"
    click localConfig "https://github.com/3dyuval/tabby/tree/master/tabby-settings/"
    click web "https://github.com/3dyuval/tabby/tree/master/tabby-web/"
    click web "https://github.com/3dyuval/tabby/tree/master/tabby-web-demo/"
    click uac "https://github.com/3dyuval/tabby/tree/master/tabby-uac/"
```
