# deepshit2025/tuboshu architecture

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

- Interactive diagram: https://gitdiagram.com/deepshit2025/tuboshu
- Repository: https://github.com/deepshit2025/tuboshu

## Overview

##### Core Project Purpose and Type
- Tuboshu is a desktop conversion tool built on Electron. Its main purpose is to let users quickly transform websites into independent desktop applications with features like multi-account support, global hotkeys, and deep customization.
- It is essentially a full-stack desktop application where the “backend” is the Electron main process and supporting modules (managing windows, events, store, tray, etc.) and the “frontend” consists of two major parts:
– The primary GUI (in gui/dist) for the main user interface.
– A dedicated settings interface (in gui/setting) built with Vue.

##### File Structure for Architectural Clues
- Key directories/folders:
- app: Contains the core Electron main process code and supporting modules.
- Modules include: constants, disguise (for fingerprint/userAgent spoofing), eventManager, plugin (for optional UI/function modules), preload (scripts injected into rendered webpages), shortcut (hotkey handling), store (state management through Loki DB with lokiManager), trayManager, utility, viewManager, and windowManager.
- gui: Houses the graphical user interface assets.
- gui/dist: The compiled assets and HTML used to display the desktop app’s main view.
- gui/setting: A standalone subproject (built on Vue) that provides the settings UI, complete with its own package.json and related files.
- .github/workflows: Contains CI/CD pipeline configurations for building the project.
- The separation between core application logic (under app) and the GUI (under gui) implies a clear division between the backend (Electron main process & modules) and frontend (web technologies for UI).

##### Main Components and Their Roles
a. Core Electron Main Process (app/main.js):
- Orchestrates the overall application lifecycle, creates windows, and handles IPC between modules.
b. Supporting Modules:
- EventManager: Handles custom events and coordination between different parts of the system.
- Plugin Module (app/plugin): Dynamically loads or manages additional functionalities, e.g., floating navigation.
- Preload Scripts (app/preload): Inject scripts into web views for navigation, settings adjustments, and web context modifications.
- Shortcut Module (app/shortcut): Manages global hotkeys for quick UI actions.
- Store Management (app/store): Handles persistent configuration data using Loki DB (lokiManager) and a higher-level storeManager.
- TrayManager, ViewManager, and WindowManager: Each focuses on desktop app-specific features such as system tray integration, managing different views, and handling window behaviors.
c. Graphical User Interfaces:
- Main GUI (gui/dist): Represents the main interface the user interacts with in the desktop context.
d. External Dependencies and Build/Deployment:
- The build configuration, GitHub Actions workflows, and package management files ensure continuous integration and cross-platform builds.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Backend Modules"
        MP["Electron Main Process"]:::backend
        EM["Event Manager"]:::backend
        PM["Plugin Module"]:::backend
        PS["Preload Scripts"]:::backend
        SM["Shortcut Module"]:::backend
        ST["Store Management"]:::backend
        TM["Tray Manager"]:::backend
        UT["Utility Functions"]:::backend
        VM["View Manager"]:::backend
        WM["Window Manager"]:::backend
    end

    subgraph "Frontend Modules"
        MG["Main GUI"]:::frontend
        SG["Settings GUI"]:::frontend
    end

    subgraph "External Integrations"
        EX["External Website"]:::external
    end

    MP -->|"calls"| EM
    MP -->|"loads"| PM
    MP -->|"injects_into"| PS
    MP -->|"coordinates"| SM
    MP -->|"persists"| ST
    MP -->|"triggers"| TM
    MP -->|"manages_view"| VM
    MP -->|"controls"| WM
    MP -->|"uses"| UT

    SM -->|"hotkey_triggers"| WM

    MP -->|"IPC_updates"| MG
    MP -->|"IPC_updates"| SG

    PS -->|"modifies"| EX

    click MP "https://github.com/deepshit2025/tuboshu/blob/main/app/main.js"
    click EM "https://github.com/deepshit2025/tuboshu/blob/main/app/eventManager.js"
    click PM "https://github.com/deepshit2025/tuboshu/tree/main/app/plugin"
    click PS "https://github.com/deepshit2025/tuboshu/tree/main/app/preload"
    click SM "https://github.com/deepshit2025/tuboshu/tree/main/app/shortcut"
    click ST "https://github.com/deepshit2025/tuboshu/tree/main/app/store"
    click TM "https://github.com/deepshit2025/tuboshu/blob/main/app/trayManager.js"
    click UT "https://github.com/deepshit2025/tuboshu/tree/main/app/utility"
    click VM "https://github.com/deepshit2025/tuboshu/blob/main/app/viewManager.js"
    click WM "https://github.com/deepshit2025/tuboshu/blob/main/app/windowManager.js"
    click MG "https://github.com/deepshit2025/tuboshu/tree/main/gui/dist"
    click SG "https://github.com/deepshit2025/tuboshu/tree/main/gui/setting"

    classDef backend fill:#FFCCCB,stroke:#CD5C5C,stroke-width:2px;
    classDef frontend fill:#CCFFCC,stroke:#32CD32,stroke-width:2px;
    classDef external fill:#ADD8E6,stroke:#00008B,stroke-width:2px;
```
