When to Use This Template
Use the sync template when:- Offline support - App works without network
- Collaborative editing - Multiple users edit same data
- Optimistic updates - UI updates before server confirms
- Conflict resolution - Automatic merge of concurrent changes
What You Get
- Sync engine - Handles data synchronization
- Operation log - Tracks changes for replay
- Deduplication - Prevents duplicate operations
- Live updates - Real-time broadcast of changes
- Snapshot support - Fast initial load
Quick Start
http://localhost:8080 to see a syncing todo list.
How It Works
1. Client Makes Change
User adds a todo item (works offline).2. Operation Logged
Change is recorded as an operation.3. Sync to Server
When online, operation is sent to server.4. Server Applies
Server validates and applies the operation.5. Broadcast
Change is broadcast to all connected clients.6. UI Updates
All clients see the new todo.Project Structure
Key Concepts
Operations
Changes are expressed as operations:Apply Function
Server applies operations to state:Snapshots
Fast initial load with current state:Example: Todo App
The template includes a todo list that syncs:Benefits
Works Offline
Operations queue locally, sync when online.Optimistic UI
Changes appear immediately, confirmed later.Conflict-Free
Operations merge automatically using timestamps.Efficient Sync
Only operations are sent, not full state.Next Steps
Project Structure
Understand every file
Tutorial
Build a syncing app