How to resolve version issues when multiple users are concurrently editing the same doc?
https://github.com/firebase/firepad
might be a good place to start
As Cliff Rowley mentioned, you question is far too vague but I'll try to provide some input as far as I can help.
You can use Codemirror (https://github.com/codemirror/CodeMirror) for defining the editor since it's one of the most popular in-browser code editor which is used by Codepen.
For realtime apps, you can make use Socket.io (http://socket.io/).
For storing data, you can use realtime services like PubNub (http://www.pubnub.com/) or Firebase (http://firebase.com/).
If you want to resolve the concurrency, you can have a look at Google docs and try to emulate how they solve that problem.
Hope this helps :)
Unfortunately your question is far too vague and the problem domain far too specific to even begin compiling a helpful response. If you have specific questions I have no doubt they'll be answered, but what you're asking for here is essentially a project's worth of design and research, which is your job ;-)
Patrik Lindström
working with DevOps technologies with powershell and dotnet
If you are in a hurry - what about using MeteorJS? There is a discussion here about it and the problem they had with merge. Like stackoverflow.com/questions/11956021/etherpad-sty… I Quote: > "So I looked into it some more, the algorithm used in Etherpad is known as Operational Transformation:
The solution is Operational Transformation (OT). If you haven’t heard of it, OT is a class of algorithms that do multi-site realtime concurrency. OT is like realtime git. It works with any amount of lag (from zero to an extended holiday). It lets users make live, concurrent edits with low bandwidth. OT gives you eventual consistency between multiple users without retries, without errors and without any data being overwritten."
Here is an example in beta state https://github.com/arist0tl3/tales4us Here I found an other meteorjs example : http://documents.meteor.com/ Here seems to be a more pro version https://angel.co/madeye