linonetwo / pants-control

Count on how many pants are left, scheduling a laundry.
3 stars 1 forks source link

Collaborative editing #7

Open linonetwo opened 6 years ago

linonetwo commented 6 years ago

Maybe we could make something likes https://github.com/automerge/hypermerge/, which use https://docs.datproject.org/hypercore as storage layer(which could be replaced by IPFS) and use https://github.com/automerge/automerge as CRDT.

linonetwo commented 6 years ago

IPFS(with AES crypto) <- IPNS <2- automerge <1- slate

  1. Changes in slate debounce in 5 seconds or so, and Value are serialized into JSON, use automerge convert it to CRDT.
  2. use pubsub to sync between peers and save content to IPFS with IPNS.
linonetwo commented 6 years ago

We can just regard server as a normal peer if we are using socket or ipfs to send operations in a p2p way.

So you can share a file with others, and you own this file, actual saving will only be performed by you.

If there is a file belongs to an organization, you should pay for us to host a server, and that server actually holds the files and to perform file saving.

Others just can send operations to the peer that is a server.

linonetwo commented 6 years ago

Seems there is no need to use automerge, just https://github.com/aravindballa/teamup/blob/master/web/src/components/SocketEditor.js#L34