top | item 27408326

Show HN: Rustpad, a self-hosted online collaborative text editor

143 points| ekzhang | 4 years ago |github.com | reply

21 comments

order
[+] _9rq6|4 years ago|reply
I really like the architectural decisions made in the project. OperationalTransform library may need some work like testcases and add more powerful constructs. Is there any theory behind it? Maybe add a link to it.

I believe this project can become a popular opensource project. It is really fast.

[+] ekzhang|4 years ago|reply
Thanks! Operational transformation is the same technology that powers Google Docs. It's been studied in academia for real-time collaboration since the 1990s and has eventual consistency guarantees. See the Wikipedia article: https://en.wikipedia.org/wiki/Operational_transformation

The Rust operational-transform library was not written by me, but it's listed on crates.io by spebern, and it's worked wonderfully so far. It seems to be a very close port of ot.js (https://github.com/Operational-Transformation/ot.js). The text transformation algorithm isn't very complicated (<700 SLOC including tests), but there's probably room for optimization!

[+] jdellinger|4 years ago|reply
Looks nice and clean! Also feels very snappy in two tabs.

However, you're breaking the back button with your redirect to a unique room. Once in a room, pressing back will join a new room. History replace instead of push should be a better choice.

[+] ekzhang|4 years ago|reply
Thanks! And good catch, I'll fix that right away.
[+] messo|4 years ago|reply
Thanks for making this, I have been looking for a worthy replacement of Etherpad for a long time, that is easy to use and has the option to be self-hosted.
[+] ekzhang|4 years ago|reply
Glad you like it! Etherpad is a big inspiration for me, and I hope to read into the code someday. They have a more sophisticated OT algorithm for rich text.
[+] em-bee|4 years ago|reply
what do you see as the advantages of rustpad over etherpad?

can etherpad documents be exported, converted to rustpad?

[+] zeotroph|4 years ago|reply
Could end-to-end encryption be added (see cryptpad), or does operational transformation or some other design aspect require a central server?

What also comes to mind when editing source code is a non-browser participant which can actually run and test the code (or for other non-interactive backends, such as en external spellcheck).

[+] ekzhang|4 years ago|reply
Good question! I'm not aware of any end-to-end encryption scheme that commutes with OT, so probably can't do it as long as you have a central server doing transformations like Rustpad.

That said, if you use a sequence CRDT-based editor like Yjs, this avoids the central server problem entirely. Rustpad is a small branch-off of a longer-term project / product I've been working on which requires collaborative editing, so having a central server was part of the equation from the start.

[+] jayunit|4 years ago|reply
Very cool! Thanks for sharing. Was binding Monaco particularly challenging?

I’m curious what the larger project/product is, if you are able to share.

I’ve used ShareDB (from @josephg in this thread) for a collaborative coding project with Jupyter as the execution backend. I just geek out seeing OT/CRDT projects in the wild :)

[+] petespeed|4 years ago|reply
Really nice and lightweight!

Some feedback:

1. I was not able to change color when setting user name. (Was it some browser extension blocking it?)

2. I was not able to run your docker image on pi (arm). The error is: standard_init_linux.go:219: exec user process caused: exec format error

Works fine otherwise on other platforms.

[+] ekzhang|4 years ago|reply
I'm not sure why you weren't able to change color. It shouldn't be blocked by a browser extension; it's just a button.

Unfortunately the Docker image is built on an x86_64 platform.

[+] brundolf|4 years ago|reply
It's hard to tell from the readme; can you expose an entire project directory (with terminal perhaps?) for collaboration?
[+] executive|4 years ago|reply
Stuck at connecting to server on iOS Safari.
[+] ekzhang|4 years ago|reply
What version of iOS? It works for me on my iPhone 8 running iOS 14.4.2.
[+] luke2m|4 years ago|reply
6S running 14.5.1 works fine.
[+] alphabet9000|4 years ago|reply
nice, is there any way to disable the auto-suggest dropdown box when you're typing?