Skip to main content

Todo List with Git-like Sync

Learn how to build an offline-first todo application using kSync’s Git-like synchronization, enabling seamless collaboration across devices even when offline.

Overview

This example demonstrates:
  • Git-like pull/push synchronization
  • Offline-first architecture
  • Conflict resolution for concurrent edits
  • Multi-device support
  • CRDT integration for conflict-free updates
  • Local persistence with automatic sync

Todo Store Setup

stores/todoStore.ts

Todo Service Layer

services/todoService.ts

React Components

components/TodoApp.tsx
components/TodoList.tsx
components/SyncStatus.tsx

Offline Support

utils/offlineManager.ts

Features Demonstrated

This todo application showcases:
  1. Git-like Sync: Pull/push model similar to Git version control
  2. Offline-First: Works completely offline with local storage
  3. Conflict Resolution: Handles concurrent edits from multiple devices
  4. Real-time Updates: Changes sync automatically when online
  5. Bulk Operations: Efficient handling of multiple todos
  6. Search & Filtering: Query todos by various criteria
  7. Statistics: Track completion rates and productivity
  8. Persistence: Local file storage with automatic backup

Running the Example

  1. Install dependencies:
  1. Run locally:
  1. Set up sync server (optional):
  1. Test offline behavior:
    • Disconnect network
    • Create/edit todos
    • Reconnect network
    • Watch automatic sync

Advanced Features

Custom Conflict Resolution

Collaborative Features

This example demonstrates how kSync enables robust offline-first applications with seamless synchronization and conflict resolution.