How gronxb/hot-updater works
• Web Console UI: (look in packages/console) – provides an intuitive update management interface.
• Update Management Core: (packages/core) – encapsulates the core update logic, version management (using semantic versioning), and utility functions.
• Hot Updater CLI/Logic: (packages/hot-updater) – handles commands such as initialization, deployment, building and triggering command flows.
• React Native Integration: (packages/react-native) – delivers native module integrations for both Android and iOS to trigger updates on client devices.
• Plugin System: (plugins/…) – houses various plugins for extending functionality:
• Build Plugins (e.g., Metro integration in plugins/metro)
• Storage Plugins (e.g., AWS S3, Cloudflare R2, Supabase Storage, JS-based implementations)
• Database Plugins (e.g., Supabase Database, PostgreSQL, Cloudflare D1 via plugins/aws, plugins/supabase, plugins/postgres, etc.)
• Additional plugins (e.g., plugin-core for helper functions, mock plugins for testing, standalone plugins, etc.)
• Examples and Documentation: (examples/ and docs/) – provide concrete usage examples for different versions and platforms (v0.71, v0.74, v0.77, etc.) as well as extensive user guidance.
Out the relationships and interactions
• The Web Console interacts with the Core and Hot Updater backend to trigger deployments and manage OTA updates.
• The Hot Updater CLI uses the core update logic and then delegates specific tasks (build processes, fetching updates, package integrity, etc.) to various plugins.
• The React Native package integrates with mobile apps by consuming update info from the backend, triggering native update processes via methods (e.g., checkForUpdate, runUpdateProcess).
• The Plugin System acts as an abstraction layer. The updater core is connected to different storage and database services (using plugins) that can be interchangeably swapped with configuration (as shown in the README examples for Supabase, Cloudflare, and AWS).
• The configuration file (hot-updater.config.ts) and similar entry points in packages/console and in examples show how users define the plugin configurations for their specific environments.
Architectural patterns and design principles
• Modular and extensible design: The separation into distinct packages and plugins indicates adherence to the separation of concerns principle.
• Plugin-based architecture: Extensibility is achieved by abstracting the build, storage, and database concerns into configurable, interchangeable plugins.
• Monorepo structure: Multiple packages coexist with shared configurations (tsconfig.base.json, pnpm-workspace.yaml) ensuring consistency across various components.
• Multi-platform support: There are explicit components for React Native integration as well as separate examples for Android and iOS demonstrating platform-specific builds.