Packages for integrating Feathers API and client applications with Automerge for offline capabilities and server to server synchronization:
@kalisio/feathers-automerge: A service implementation on top of the Automerge CRDT as well as a client for offline synchronization with afeathers-automerge-server. Read the full documentation here.@kalisio/feathers-automerge-server: Integrates an Automerge sync server into an existing Feathers server and synchronizes offline documents with clients and other servers. Read the full documentation here.
This repository contains an example for a Feathers API with full offline-first capabilities. It comes in several components:
Install all the dependencies in the monorepo with
git clone git@github.com:kalisio/offline-sync.git
cd offline-sync
yarn installWith Docker running, the development system can be started like this
yarn run devThen go to http://localhost:5173. The API server is running at http://localhost:3030.
To run another server to test server to server synchronization in a new terminal run:
yarn run s2sIt will be available at http://localhost:5050.
The goal of this project is to add full offline-first capabilities to a Feathers API.
In order to flexibly add offline capabilities we are proposing the following structure:
graph TD
FA[Feathers API/Database] -->|Events/Logs| SN[Snapshot Server]
SN <-->|Syncs| C1
C1[Client] -->|Creates Snapshot| SN
SN --> |Updates| FA
Several local-first synchronization options were evaluated, however, most rely on (Postgre)SQL or paid infrastructure.
- Soft delete
- Run hooks (keep separate snapshot of server "view" and client changes)