How yenche123/liubai works
Backends
• The liubai-backends directory contains two key parts:
– “liubai-ffmpeg” (which likely does some media processing)
– “liubai-laf” which is the main backend built with Laf and organizes its cloud functions (found in the cloud-functions subfolder). These cloud functions implement APIs and business logic for tasks such as synchronizing data, handling user login, attachment processing, file operations, etc.
• They represent your server‐side logic, API endpoints, and integrations for the AI and cloud sync functionalities.
Frontends
• liubai‑web: This is the primary web-based frontend, built with Vue 3, Vite, and TypeScript. It includes a complex component hierarchy (many levels in the components directory) and is responsible for the main user interface for note‑taking, scheduling, and task management.
• liubai‑vscode‑extension: A VS Code extension built in TypeScript using esbuild. It provides an alternative interface (or an integration into a code editor) so users can quickly take notes from within IDE environments (also supporting web versions of VS Code).
• These interact with the backend via APIs or cloud functions to maintain real‑time data sync and offline capability.
Experimental Area
• The memory-bank directory is described as an experimental “workspace” where an AI (using GitHub Copilot and Agent Mode) autonomously generates content. It is mostly self‑documenting and is separate from production code, but you might note it as a sandbox environment for AI‑driven iterations.
Additional Integration & Technologies
• The README notes integrated external AI models (Baichuan, DeepSeek, Kimi, etc.) and specific messaging integrations (like WeChat’s official API for service messages). This means the system likely communicates with third‑party AI and messaging services.
• The project uses a modern front‑end toolchain (Vue 3, Vite, VueUse, Dexie.js for IndexedDB management, TipTap for rich text editing) as well as standard back‑end and cloud function patterns.
• Service-worker and PWA support ensure offline capability.
a. Main Components to Include:
• Clients/Frontends:
– Web (liubai‑web): Represent the browser-based UI.
– VS Code Extension (liubai‑vscode‑extension): Represented as a separate client that also runs in browser‑based IDE environments.
• Backend Services:
– Cloud Functions & API layer (liubai‑laf in liubai‑backends).
– Media processing utilities (liubai‑ffmpeg).
• Documentation Site:
– liubai‑docs powered by VitePress.
• Experimental/AI Workspace:
– memory‑bank (optional, annotate as experimental).
b. Relationships and Interactions:
• Both frontend clients (web and VS Code extension) communicate with the backend APIs (via REST or cloud function invocations) to fetch, update, synchronize notes and schedules.
• Offline functionality is managed via service‑workers and local databases (the project uses Dexie.js).
• Integrations with third‑party services (WeChat API, AI services) are part of the backend or invoked from the frontends for notifications and AI responses.
• The documentation site is typically separate, providing developer/user guidelines and is accessed via a separate URL.
c. Architectural Patterns and Design Principles:
• Separation of concerns is clear: the backend is isolated from the frontends.
• Modular design: cloud functions are individually responsible for specific features (e.g., user login, file management, notifications).
• Client‑side layer employs a component‑based UI architecture (e.g., composition API in Vue) and uses PWA design to enable offline support.
• Extensibility: the VS Code extension’s architecture supports additional integrations and works in both Node and Web environments.
d. Relevant Technologies:
• Backend: Laf framework, Node.js environment for cloud functions, potential use of other Node tools like nodeman, TypeScript for cloud functions.
• Frontend: Vue 3, Vite, TypeScript, VueUse, Dexie.js, TipTap.
• VS Code Extension: TypeScript, esbuild, vsce.
• Documentation: VitePress.
• Third‑Party Integrations: APIs for AI models and WeChat messaging.
– Data Storage & Offline: Illustrate local databases (Dexie.js) tied to the web client and how service workers provide offline capabilities.
– Experimental: Optionally include a branch for “AI-driven Memory Bank” as a side‑experiment.
– Lines from the backend to third‑party AI or messaging services.
Remember to use as much detail as practical:
• Submodule (e.g., list a few cloud functions by purpose if needed).
• Integration with offline PWA capabilities and AI services.
• Clearly label how the VS Code extension differs from the web client.