@epicdm/flowstate-rxdb
v1.0.0
Published
RxDB database initialization package for Epic Flow applications
Maintainers
Readme
@epic-flow/flowstate-rxdb
RxDB database initialization package for Epic Flow applications. Provides a simple, opinionated way to create and configure RxDB databases with smart defaults and preset configurations.
Features
- 🎯 Simple Factory API - One function to create databases
- 🔧 Smart Defaults - Auto-detects environment and chooses appropriate storage
- 📦 Preset Configurations - Development, production, and minimal presets
- 🔌 Plugin Management - Automatic plugin initialization based on presets
- 💎 Premium Support - Built-in support for RxDB premium features
- 📝 TypeScript First - Comprehensive type definitions
- 🧪 Well Tested - Full test coverage
Installation
yarn add @epic-flow/flowstate-rxdbQuick Start
import { createDatabase } from '@epic-flow/flowstate-rxdb';
import { collections } from '@epic-flow/collections';
// Simple usage with preset
const db = await createDatabase({
name: 'my-app',
collections,
preset: 'development',
premium: true,
});Presets
Development
- DevMode, QueryBuilder, Update, Migration, LeaderElection plugins
- IndexedDB storage with validation
- Best for local development
Production
- QueryBuilder, Update, Migration, LeaderElection plugins (no DevMode)
- IndexedDB storage with validation
- Best for production builds
Minimal
- QueryBuilder plugin only
- Memory storage
- Best for testing
Advanced Configuration
const db = await createDatabase({
name: 'my-app',
collections,
storage: {
type: 'indexeddb',
options: { batchSize: 500 },
},
plugins: {
devMode: false,
queryBuilder: true,
update: true,
migration: true,
leaderElection: false,
custom: [MyCustomPlugin],
},
premium: true,
});API Reference
License
MIT
