4 ms·
Show HN: Rustpad, a self-hosted online collaborative text editor
- re 5y agoFYI, https://rustpad.io https://rustpad.io breaks the back button by updating the URL hash to a new document every time I try to go back. Use location.replace() https://developer.mozilla.org/en-US/docs/Web/API/Location/replace https://developer.mozilla.org/en-US/docs/Web/API/Location/re... or history.replaceState() https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState https://developer.mozilla.org/en-US/docs/Web/API/History/rep... to avoid that, instead of assigning to window.location.hash.
- jdellinger 5y agoLooks 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 5y agoThanks! And good catch, I'll fix that right away.
- sreeramb93 5y agoI 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 5y agoThanks! 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 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 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!
- zingplex 5y agoCongratulations on shipping, what you have is very slick. Quick question, not trying to start a flame war just genuinely curious. Why did you pick OT over other approaches to realtime collaborative editing such as CRDTs?
- josephg 5y agoI'm not the author but I've written a lot of OT code. OT works great when you have a centralised server. Its fast and simple. I (and others) are working on it but there aren't many production quality, fast CRDT implementations in rust and other languages yet.
- ekzhang 5y agoI'm also curious about CRDTs, but after making this project, I agree that OT seems to "just work" performance-wise and are super simple.
- executive 5y agoStuck at connecting to server on iOS Safari.
- messo 5y agoThanks 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 5y agoGlad 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 5y agowhat do you see as the advantages of rustpad over etherpad? can etherpad documents be exported, converted to rustpad?
- zeotroph 5y agoCould 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 5y agoGood 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.
- deleted 5y ago[deleted]
- petespeed 5y agoReally 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 5y agoI'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.
- alphabet9000 5y agonice, is there any way to disable the auto-suggest dropdown box when you're typing?
- brundolf 5y agoIt's hard to tell from the readme; can you expose an entire project directory (with terminal perhaps?) for collaboration?
- jayunit 5y agoVery 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 :)