How renmu123/bililive-tools works
• Monorepo Core: Show that the project is managed as a monorepo using a PNPM workspace (indicated by “pnpm-lock.yaml” and “pnpm-workspace.yaml”).
• Recording Libraries: Separate packages (e.g., BilibiliRecorder, DouYinRecorder, DouYuRecorder, HuYaRecorder, and also huya-danmu) function as the core modules for handling platform-specific recording, danmu processing, and stream management.
• CLI Module: The “CLI” package encapsulates the command-line interface functionalities.
• Desktop Application: The “app” package is clearly the Electron-based desktop client. Inside it you have split responsibilities (main process, renderer process) for handling application logic and UI components.
• HTTP/API Service: The “http” package defines middleware, routes, and services to accept webhook calls and API requests.
• Shared/Common Utilities: The “shared” and “types” packages include common code (utilities, database models, presets, configuration) used across modules.
• Live Manager & Others: The “liveManager” package further orchestrates live stream recording and processing.
• Docker & Deployment Components: The “docker” folder (and associated GitHub workflows) indicates containerized versions of the backend API, web UI, and third-party recorder integration (e.g., BililiveRecorder/recorder).
Relationships and Interactions
• That the Desktop App (Electron UI) and the CLI interact with the underlying recording libraries and shared utilities.
• The HTTP/API service (backend) exposes routes such as webhook endpoints (e.g., for BililiveRecorder, blrec, DDTV, custom webhooks) that trigger processing in the recording modules.
• The Shared package is used by multiple components (CLI, HTTP API, Live Manager, Desktop App) to maintain consistency in presets, configuration, and type definitions.
Architectural Patterns and Design Principles
• Modular Design: Clearly illustrate each package/module as an independent component within the monorepo while noting their reusability (like shared utilities and types).
• Separation of Concerns: Distinguish between the UI layers (Desktop App, WebUI), service layers (HTTP/mock API service), and core domain libraries (recorders, live management).
• Microservices Components (in Docker): Note the separation between the “frontend” container (web UI) and “backend” container (API server) in a Docker Compose environment.
• Extensibility: Indicate that the design supports plugin-like recording modules for platforms, making it easy to add more in the future.
Detail the Technologies, Frameworks, or Libraries Involved
• Electron is used for the desktop application (packages/app).
• Likely Vue (or a similar framework) is used in the renderer process for building the UI (as seen from the “src/renderer” structure and .vue components).
• Node.js is the runtime environment (with a defined .node-version).
• Tools like ffmpeg, DanmakuFactory, and possibly better-sqlite3 (for danmu analysis) are integrated as binary dependencies.
• Docker is used for containerized deployments, and GitHub Actions streamline CI/CD.