rupl / bustashape

Collaborative, real-time artboards
https://bustashape.art
MIT License
5 stars 3 forks source link

Full offline functionality #107

Open rupl opened 6 years ago

rupl commented 6 years ago

Bustashape can already go offline and partially survive. The shapes you already have can be manipulated, and when your connection comes back, anyone else who joins will get your latest work during the normal sync event. There is a chance if you were the only one who lost a connection that your work will be overwritten when you receive the sync event, but one way or another when the server disappears and returns, everyone eventually converges into one shared state.

I saw a cool talk many months ago about moving an Express server into a Service Worker so that the SW can act as the server when it goes away. The fella released a library called express-service to help automate the process of creating "jumping javascript" as he called it ;)

Implementing this completely would mean that after visiting the URL once and installing SW, a person could create an infinite number of local bustashape rooms without ever needing our server.

Additionally, it would create more robustness when there are network hiccups, allowing people to create new shapes without a connection to bustashape.com — if they rejoin and a new person joins, the normal sync event will always work as it does now.

I'm assuming I won't get to 100% in one PR, so I'll break down how I see it happening over time: