Skip to main content

Data Layer

The @repo/data package provides a comprehensive solution for data operations with a standardized interface across different data sources. It serves as the foundation for all data-related functionality in the zopio framework.

Features

  • Unified Interface: Consistent API across all data sources
  • Multiple Providers: Support for Supabase, Firebase, REST, GraphQL, and more
  • Type Safety: Full TypeScript support with comprehensive type definitions
  • React Integration: Hooks and components for seamless React integration
  • Schema Validation: Built-in schema definition and validation
  • Extensibility: Plugin architecture for custom functionality
  • Optimized Performance: Efficient data fetching and caching strategies

Installation

This package is part of the zopio monorepo and is available to all applications in the workspace.

Package Structure

The data package is organized into three main subpackages:
  • Base: Core types, utilities, and base interfaces
  • Providers: Data providers that implement the CrudProvider interface
  • UI: React components and hooks for working with data

Basic Usage

Creating a Data Provider

Performing CRUD Operations

Using React Hooks

Using UI Components

Detailed Documentation

For more detailed information on using the data package, see the following pages:

Environment Variables

Depending on the provider you’re using, you may need to set specific environment variables:

API Reference

For a complete API reference, please refer to the TypeScript definitions in the package or explore the detailed documentation pages.