How mayneyao/eidos works
Main Components
• Desktop App (Electron-based): This is the recommended, fully featured offline version. Include subcomponents such as:
• Electron Main Process & Preload Scripts (found under the “electron” folder)
• Window Manager and IPC (for inter-process communications)
• Native integrations (file-system, updater, protocol handler)
• Publish App: Represents another mode – perhaps for exporting or publishing data – located in apps/publish.
• Core Data Modules and Database Backends:
• SQLite Integration: Both the native SQLite in Electron and SQLite-wasm in the browser.
• Local Data Storage: Modules under lib/storage, which interact with IndexedDB or native files.
• AI and Extension Framework:
• AI integration modules (e.g., components/ai-chat, lib/ai, and worker/service-worker/ai)
• Extension mechanisms including Micro blocks, Doc Plugin, Script, and UDF functionality (visible in various folders including apps/desktop/settings and components/doc/plugins)
• Worker and Background Services:
• Background workers (worker folder) for tasks like data transformation, SQLite operations in a web-worker context, and AI processing.
• API/SDK Layer and Hooks:
• Common hooks (under “hooks”) and API/SDK modules (lib/action, lib/ai/functions, etc.) that allow extension and integration.
• Presentation/Rendering Components:
• A thorough components library (components/*) that handles UI elements from basic UI (buttons, dialogs, sidebar, etc.) to complex document and table rendering.
Relationships and Interactions
• For the Desktop App:
• How the Electron Main Process communicates with Renderer Processes (React UI) via IPC.
• How worker processes (electron/worker-manager and the worker folder) provide asynchronous data processing and AI features.
• For the Web App:
• PWA components that render in the browser, relying on SQLite-wasm for database operations.
• External libraries used in the web context (e.g., Lexical for the document editor, glide-data-grid for tables, web-llm for AI).
• Shared and Cross-Cutting Elements:
• The “lib” and “packages” directories hold core logic and standardization (e.g., a consistent SQLite interface throughout the system).
• The extension points (micro blocks, doc plugins, scripts) allow modular customization – indicate these as plug-in modules that hook into various parts of the system.
Important Architectural Patterns and Technologies
• Modular and Extensible Design: The project’s directory structure separates concerns into independent modules (UI components, hooks, workers, etc.) and extension points.
• Electron Architecture: Distinct separation between main process, renderer processes, and background services.
• Client-Side Database Standardization: Each “table” is a SQLite table, with standardized interfaces provided through lib/sqlite and related modules.
• Use of Web Workers/Service Workers: For asynchronous processing in both desktop and web contexts.
• Integration of AI Services: Using multiple vendors under lib/ai and components/ai-chat.
• Use of modern frontend frameworks and supporting libraries (e.g., React, Tailwind CSS, and Lexical).
Instructing the Principal Software Engineer
UI Components (Renderer) → IPC → Electron Main Process → Native File System / SQLite Provider.
Similarly, for the web app, show:
Web UI Components → Web Worker → SQLite-wasm / AI Processing.
• Blue for core application layers (Electron main/renderer)
• Green for data management and storage modules
• Orange for worker/service layers
• Purple for AI and extension modules.
• Connections with key protocols or library calls—for instance, mention “IPC”, “HTTP/WebRTC (for SQLite channel)”, or “Service Worker requests” where applicable.