Skip to content

[Issue]: Write local sync setup guide #69

Description

@dawidurbanski

[Issue]: Write Local Sync Setup Guide

Parent Epic: #57 - UDL as Production Data Layer
Phase: 6 - Documentation
Estimated Time: 0.5 day

Summary

Write documentation explaining how developers can configure their local UDL instance to sync with a remote UDL server via WebSocket and the sync API.

Context from Epic

The epic describes the local sync setup:

remote: {
  url: 'https://udl.example.com/graphql',  // Remote UDL URL
  websockets: true,                         // Enable WebSocket sync
}

Developers need a guide to connect their local dev environment to a production UDL instance for real-time updates.

Technical Specification

Documentation Content

Local Sync Setup Guide:

  1. Introduction

    • Why sync local with remote
    • Architecture: local UDL ↔ remote UDL
  2. Configuration

    // udl.config.ts
    export const config = defineConfig({
      port: 4000,
      plugins: [...],
      remote: {
        url: 'https://udl.example.com/graphql',
        websockets: true,
      },
    });
  3. How Sync Works

    • Initial sync on startup (via /_sync endpoint)
    • Real-time updates via WebSocket
    • Handling disconnections and reconnection
  4. WebSocket Events

    • node:created, node:updated, node:deleted
    • Subscribing to specific node types
  5. Troubleshooting

    • Connection issues
    • Sync lag
    • Debugging tips

Files to Create

  • docs/content/4.deployment/7.local-sync.md

Implementation Tasks

  • Write introduction explaining local/remote sync
  • Document configuration options
  • Explain sync flow (initial + WebSocket)
  • Document WebSocket protocol
  • Add troubleshooting section

Acceptance Criteria

  • Guide explains local-to-remote sync setup
  • Configuration examples are clear
  • WebSocket events are documented
  • Troubleshooting covers common issues

Dependencies

Definition of Done

  • Documentation complete and reviewed
  • Examples tested
  • PR reviewed and merged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions