跳到主要内容

Overview

npmGitHub

The Central Data Framework (CDF) is a state management solution built on top of the @espressif/rainmaker-base-sdk. It provides a centralized store system that handles caching, persistence, and real-time updates automatically, simplifying the integration of ESP RainMaker features into your application.

CDF eliminates the need for manual state management by providing reactive stores that automatically synchronize with the RainMaker backend, keeping your application data up-to-date with minimal effort.

CDF Architecture

CDF organizes data into specialized stores, each handling a specific domain of your application:

CDF Stores

CDF provides the following specialized stores, each managing a specific domain of your application:

  • UserStore - Manages user authentication, profile, and account operations
  • NodeStore - Handles device provisioning, node management, and device control
  • GroupStore - Manages group operations and group-related data
  • AutomationStore - Handles automation triggers and automation management
  • SceneStore - Manages scene configurations and scene operations
  • ScheduleStore - Handles scheduling operations and schedule management
  • SubscriptionStore - Manages subscriptions and notification preferences

For detailed information about each store and their capabilities, refer to the respective sections in the documentation.

Why Use CDF?

CDF provides several advantages over using the base SDK directly:

  • Automatic State Synchronization: Stores automatically sync with the SDK backend, eliminating the need for manual state management and API calls
  • Reactive Updates: UI updates automatically when data changes, ensuring your application always displays the latest information
  • Simplified API: Higher-level abstractions for common operations, reducing boilerplate code and complexity
  • Real-time Updates: Real-time data synchronization across your application, keeping all components in sync
  • Centralized State Management: Single source of truth for all application data, making state management predictable and maintainable
  • Reduced Complexity: Less code to write and maintain compared to manual state management implementations

Getting Started

To get started with CDF:

  1. Getting Started with CDF - Install and initialize CDF
  2. User Store - Learn about UserStore operations
  3. Node Store - Learn about NodeStore operations
  4. Group Store - Learn about GroupStore operations
  5. Automation Store - Learn about AutomationStore operations
  6. Scene Store - Learn about SceneStore operations
  7. Schedule Store - Learn about ScheduleStore operations
  8. Subscription Store - Learn about SubscriptionStore operations

For detailed information about each store and their capabilities, refer to the respective sections.

Package Information

On this page