How deepshit2025/tuboshu works
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.