Show HN: Firepad, an open source collaborative text editor
firepad.io
firepad.io
Again awesome app!!
I just tweaked it (again) so that we remove focus from CodeMirror when you scroll the page, so this should be taken care of.
Sorry about that!
Additionally, a lot of the OT code is based on ot.js[1], a fantastic open source OT implementation by Tim Baumann. He has a node.js backend as well as Haskell and Python. Of course then you have to run the server code somewhere and figure out how to persist the documents, etc. :-) Definitely worth checking out though.
I realize those are not mutually exclusive options.
setInterval(function () {firepad.codeMirror_.setValue('foo'); }, 0);Haha, just kidding! Moved everything into a closure. Thanks for suggesting it.
(I.e. it's client-side, you can't prevent people from doing whatever they want.)
Obviously you can't be stopped from editing the contents of the editing area, so if it works by simply checking for your updates to the editor then you can't stop it.
In non-demo scenarios, you'd have authentication and security rules set up to prevent this sort of abuse / trolling / etc.
The main reason I bothered adding the closure was so people wouldn't copy/paste the code snippet from the HN post and have it work. :-)
Mozilla and no doubt many others can easily deploy it on their servers:
Firepad is fully client-side code, so there's no server software for you to set up.
The other big reason you might use Firepad is to get all of the other goodies that Firebase provides, like the automatic scaling, Forge debugger, declarative security, etc.
If you want to try it without other people messing with it. Click the "Private Firepad" link in the upper right corner.
And yes, I'm quite sure private pads might be of use in certain situations.
You can try it at https://dl.dropbox.com/u/8554242/live-status.html
We've had people build everything from emergency response simulations synchronized across multiple devices to iOS apps for grandparents to read books with their grandkids over long distances.
Firebase is great any time you need real-time updates, collaboration, or you just want to get something up and running without having to spin up your own servers.
Unfortunately I'm currently stuck working for the big corporation, and we have so many meetings reviewing documents, etc over fairly large teleconferences across the world-- so not face to face meetings. Currently, usually only one person drives the edits in MS Word and screenshares with the group via a WebEx or LiveMeeting... if there could be some sort integration with MS Word so multiple people could edit at the same time and view the same thing, there would be no need for the LiveMeeting/WebEx screenshare and the collaboration would be much more seamless. Would remind me of a SubEthaEdit mashed with MS Word.
Regardless, well done.
(You can see how my bold line of text was interrupted by someone else.)
People are certainly allowed to write over each other (e.g click in the middle of your sentence and write something). If that's not what happened, let me know!
As for similar projects that are already more HTML-friendly, maybe check out Etherpad[1]? It has HTML import / export, though I haven't tested it out.
You could (if you like pain) use firepad with hundreds of users and it shouldn't be an issue. The actual messages being sent around are small.
I tweaked the page to not auto-focus the editor. Thanks!
Atlassian[1] and Action.io have already built stuff with it.
1. https://marketplace.atlassian.com/plugins/com.atlassian.stas...
https://news.ycombinator.com/item?id=5519094
> All of the OT work happens client-side, so it's certainly
> possible to adapt it to other backends.The main thing that is difficult about building something similar to Firepad would be building the scalable distributed backend: there are no open source projects that I know of that provide that functionality. That is the value add of Firepad: the open source code is just some glue that you can find from other projects (including Etherpad, which is open source with both rich text and OT).
The thing that actually makes this interesting is the proprietary scalable synchronization backend from Firebase. That is interesting, no denial from me on that front: except for some issues with trusting the clients (pointed out in my other comment), this seems like a great and simple way for developers to rapidly get access to this collaborative text editing functionality for their applications. The open source parts, though, are not what is compelling.
To take some concrete examples: ShareJS is a strong implementation of OT (the guy is one of the people who had worked on Wave), but the backend they provide is less-than-stellar, based on fairly centralized storage into a small handful of backends, and no real attempt at supporting scalable front-end server endpoints (so, you have to have everyone connect to a single machine to act as the single-threaded mediator). Etherpad-lite is based on a similar architecture; you can shard these solutions on the document, but it just doesn't hold up in the same way Firebase does vertically.
Looking at this then from an alternative direction: one can imagine just taking the FirebaseAdapter from Firepad and wiring it into the backend of ShareJS. This isn't much work, and would probably be more useful than Firepad's current stack that is tied to the text editor: in addition to being able to use any of a number of text editors people have wired over ShareJS, ShareJS also supports arbitrary JSON document OT, allowing you to build systems that are closer in functionality to Wave (where people were using OT on the program state of things like chess games).
And we'd love to see integrations with ShareJS as well as other editors besides CodeMirror.