iagobruno / device-auto-sync-with-service-worker

A simple demo of how to automatically sync data across multiple devices for offline usage, using web technologies.

Home Page:https://glitch.com/edit/#!/iagobruno-device-auto-sync-with-service-worker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

device-auto-sync-with-service-worker

A simple demo of how to automatically sync data across multiple devices for offline usage, using web technologies.
Inspired by Google Sync.

remix this

Goals

  • Allow user to use the web app on multiple devices and make changes even offline.
  • Sync local changes with server when reconnect.
  • Ensure all user devices always have the most up-to-date data.

Flowchart

flowchart.png

Installation

git clone https://github.com/iagobruno/device-auto-sync-with-service-worker.git
cd device-auto-sync-with-service-worker
yarn install
node server.js

Improvement Ideas

For when you are making your own implementation.

  • Use a debounced function on the server to avoid sending too many syncs to the user's device.
  • Use a queue plugin to not reach the rate limit of push service.
  • Handle content conflicts.

Related Contents

License

MIT License.

About

A simple demo of how to automatically sync data across multiple devices for offline usage, using web technologies.

https://glitch.com/edit/#!/iagobruno-device-auto-sync-with-service-worker


Languages

Language:JavaScript 87.1%Language:HTML 6.8%Language:CSS 6.1%