subethaedit / SubEthaEdit

General purpose plain text editor for macOS. Widely known for its live collaboration feature.
https://subethaedit.net
MIT License
1.37k stars 112 forks source link

Web Interface for collaboration #18

Open monkeydom opened 5 years ago

monkeydom commented 5 years ago

While a free and open source SubEthaEdit now really removes the entry barrier to do live ad hoc collaboration with your peers, it would be great if SubEthaEdit could also sever a web app on demand so anybody could join and follow a document without having to have a mac.

E.g. think EtherPad served from the SubEthaEdit app on demand so you truly collaborate with anyone at any time. Current web technologies have advanced enough that this is a very viable option to have a great web app running and talking to SubEthaEdit.

dwt commented 5 years ago

I love this Idea. Having the ability to easily host your own instance of EtherPad by just starting a Mac App would be awesome!

I have looked into the current crop of Open Source Implementations of collaborative text editors, and it seems that they tend to use a CRDT data type to synchronize text editing between clients.

What type of protocol is SubEthaEdit using? My understanding is that it was developed before we understood how to formalize CRDT data types and is therefore (still?) using Operational Transforms based algorithms? Is there documentation besides the code that details the protocol / datatypes SEE is using for this?

Would be lovely to find out there is a standard protocol that is already supported by an open source software. :)

monkeydom commented 5 years ago

You can dig around in the pre 3.0 releases to find out some more artefacts of documentation that should still be valuable (both for the protocol and for the transforms). There is #20 to track creating this documentation again.

Essentially SubEthaEdit is just attaching operational transform rules for the basic selection and replace text operations, all found in the Source/Operation folder in the xcode project.

Yes, SubEthaEdit was done before CRDTs were popular. And personally, I prefer the transforms from a point of view that you don't get those tombstones you'll have to manage, e.g. for the ad hoc collaboration it accumulating way less of non-data-data. But there is more pro/cons around this. For now I only lifted up the existing implementation to build and run again, this should not be seen as a technology endorsement at this point in time.

There is a lot out there, so I'm happy to take pointers. Also with HTTP2 streaming being almost as capable as BEEP it might be worth investigating switching to it for various reasons.

From an architectural perspective I think it would be best to allow for other collaboration protocols to interop with the app if possible and the other protocols are defined enough.

dwt commented 5 years ago

Some working open source implementations can be seen here:

The question would be how to interface with such a system?

One way would be for SEE to start such a server in a background-process and log in to it as a client for webshared text-files. To implement this, a transmogrified for the Operational Transforms to the crdt operations and some web socket programming would be required.

Sounds a bit hackisch, but on the other hand, something that would at least be relative straightforward.

Do you have ideas of other ways to attack this issue?

monkeydom commented 5 years ago

Yeah - some sort of adaptation layer, that would translate between those worlds. I guess it would be best to prototype something and then go from there. I think it would be best to put those concrete ideas into separate github issues and explore. This one was really meant to actually have SubEthaEdit serve a fully functional web interface in the local network and if port mapping is up also to the outside world.