How rubickcenter/rubick works
Main Components
• UI/Renderer Layer:
– Found in directories like “src/renderer” and “guide/src/App.vue” or “feature/src/App.vue”.
– Built using Vue (as indicated by .vue files, shims for Vue/TS files, and related assets).
– It handles user interactions—search input, plugin market access, and launching system plugins.
• Main/Backend Process:
– Managed in “src/main” and “src/core”.
– Contains modules for system interactions such as “registerHotKey”, “tray”, “versionHandler”, “app-search” (with OS-specific search modules for Darwin, Linux, Windows) and “plugin-handler” that manages installation, loading, and integration of plugins.
• Core Modules:
– Under “src/core”, various submodules (e.g., “app-search”, “db”, “screen-capture”) encapsulate the key business logic.
– The “db” module may handle local data persistence and integration with external data sources like WebDAV.
• Plugin Infrastructure:
– Plugins are installed/uninstalled in a manner similar to npm packages (as described in the README).
– The system plugin mode, which makes plugins an integral part of Rubick, can be highlighted as a dynamic extension point.
– This is supported by both UI components (viewing in the plugin market) and backend/plugin-handler services.
• External Services & Integrations:
– WebDAV for multi-device data synchronization.
– OS-level integrations (launching local apps, file/folder search, system shortcuts).
Relationships and Interactions
• The Main Process forwards requests to Core modules (e.g., app-search, plugin-handler, db) and then returns data or results through the UI.
– For example: a search request travels from “src/renderer/search.vue” → “src/main/common” → “src/core/app-search” → back to UI.
• Plugin Manager:
– Illustrate the integration pathway between the UI’s plugin market and the plugin-handler module in the core.
– Show connections with the external npm registry (or its mirror) and local installation directories.
• Data Synchronization:
– The WebDAV module (in “src/core/db/webdav.ts”) handles the export/import process for settings and plugin data, communicating with remote endpoints.
• Multiple Build Variants:
– Folders like “detach”, “feature”, “guide”, and “tpl” suggest different deployment flavors or interface variations.
Architectural Patterns and Design Principles
• Modular Design:
• Separation of Concerns:
– Separate UI rendering from business logic (main process/core) and external synchronization.
• Extensibility/Plug-in Architecture:
– Emphasize the extension point for plugins, showing how they integrate into both the UI (via a dedicated plugin market view) and backend (via a plugin handler).
• Multi-environment Support:
– Some modules are designed to work across various operating systems (e.g., OS-specific search modules in core/app-search).