> ## Documentation Index
> Fetch the complete documentation index at: https://stratasync.blode.md/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

A local-first sync engine for TypeScript, React, and Next.js. Reads come from a local store, so the UI stays fast. Writes queue offline and sync when you reconnect. A server-sequenced log ensures every client converges.

Built on the sync architecture [Linear](https://linear.app) described but never open-sourced, extended with Yjs CRDT collaboration, undo/redo, and pluggable adapters.

## Key features

- **Local-first reads**: render from IndexedDB, no network round-trips
- **Server-sequenced consistency**: a monotonic `syncId` orders all changes globally
- **MobX reactivity**: only re-renders components that read changed fields
- **Offline writes**: a persistent outbox replays mutations on reconnect
- **Rich-text collaboration**: Yjs CRDT for multi-user editing
- **Undo/redo**: transaction-based history tracking
- **Field-level conflict resolution**: LWW rebase with configurable strategies
- **Partial replication**: load strategies control eager vs. on-demand sync
- **Type-safe schema**: decorators define models, typed hooks bind them to React

## What you can build

Strata Sync fits products that need local-first responsiveness with predictable sync:

- Collaborative editors with offline draft support
- Task and project apps that must work on unreliable networks
- Customer-facing dashboards backed by a shared canonical state
- Mobile workflows that queue writes and reconcile after reconnecting
- Internal tools that need strong consistency without giving up responsiveness

## How it works

1. Define models with decorators (`@ClientModel`, `@Property`, `@ManyToOne`, `@OneToMany`).
2. Create a sync client with storage, transport, and reactivity adapters.
3. Wrap your React tree with `SyncProvider`.
4. Read data with hooks (`useModel`, `useQuery`) that auto-update.
5. Write data with `create`, `update`, and `delete`: applied optimistically, synced in the background.

## How Strata Sync compares

| Feature             | Strata Sync            | ElectricSQL    | Zero                 | InstantDB            | PowerSync            |
| ------------------- | ---------------------- | -------------- | -------------------- | -------------------- | -------------------- |
| Local storage       | Built-in (IndexedDB)   | Bring your own | Built-in (IndexedDB) | Built-in (IndexedDB) | Built-in (SQLite)    |
| Conflict resolution | Automatic, field-level | Bring your own | Server decides       | Server decides       | Customisable         |
| Real-time editing   | Rich-text with Yjs     | Not included   | Not included         | Not included         | Not included         |
| Offline writes      | Full offline support   | Bring your own | Not supported        | Basic support        | Full offline support |
| Undo / redo         | Built-in               | Not included   | Not included         | Not included         | Not included         |

## Packages

Install only the packages you need.

| Package                         | Description                                          |
| ------------------------------- | ---------------------------------------------------- |
| `@stratasync/core`              | Model runtime, schema decorators, transactions       |
| `@stratasync/client`            | Client orchestrator, CRUD, query engine, outbox      |
| `@stratasync/react`             | React hooks and `SyncProvider` binding               |
| `@stratasync/next`              | Next.js App Router SSR bootstrap and serialization   |
| `@stratasync/y-doc`             | Yjs CRDT document and presence management            |
| `@stratasync/mobx`              | MobX reactivity adapter for observable models        |
| `@stratasync/storage-idb`       | IndexedDB storage for data, outbox, and metadata     |
| `@stratasync/transport-graphql` | GraphQL + WebSocket transport for sync and mutations |