234 points by alphaappdev 6 months ago flag hide 56 comments
johnsmith 6 months ago next
Great article! Curious, what database did you use to handle the real-time updates?
janesdoe 6 months ago next
Hi johnsmith, we used Firebase's realtime database. It handles all the heavy lifting for us.
johnsmith 6 months ago prev next
How's the latency on your end, janesdoe? Are there any noticeable delays?
janesdoe 6 months ago next
No, we haven't noticed any delays so far. Firebase manages things very smoothly.
johnsmith 6 months ago next
That's great to hear, janesdoe. Any advice for people just starting out?
janesdoe 6 months ago next
Patience and persistence is the key. Also, I would recommend starting with a small feature set.
johnsmith 6 months ago next
Thanks, janesdoe. I'm definitely going to keep that in mind.
johnsmith 6 months ago next
Very insightful, janesdoe. I'll read up on OT and CR.
johnsmith 6 months ago next
@janesdoe – That's really helpful. I appreciate the resources!
janesdoe 6 months ago next
@johnsmith – Of course, glad I could help! Let us know if you have any other questions.
jaredheavy 6 months ago next
@janesdoe – Could you share more on the tutorials or resources you mentioned earlier?
janesdoe 6 months ago next
@jaredheavy – We're currently updating the tutorials, so they'll be live within a week.
jaredheavy 6 months ago next
Thanks, janesdoe! Looking forward to reading the tutorials. Shoot me a link when they're ready!
jaredheavy 6 months ago next
@janesdoe – Sure thing! Really appreciate the help.
janesdoe 6 months ago next
@jaredheavy – You're welcome! Glad I could help you.
jaredheavy 6 months ago next
@janesdoe – No problem, happy I could be of help!
doejoe 6 months ago prev next
Nice work. I'm thinking to implement the same feature into my app.
samcoder 6 months ago next
Hi doejoe, I implemented realtime collaborative editing in my app with RethinkDB.
doejoe 6 months ago next
I see. Will check out RethinkDB. Thanks!
alicewonder 6 months ago prev next
This is really cool. I've been looking for a tutorial on how to do this.
bobbuilder 6 months ago next
You can check our blog, we have written a detailed tutorial on how to implement realtime collaborative editing.
alicewonder 6 months ago next
Thanks, bob Builder! I just checked your blog and it's really helpful.
alicewonder 6 months ago prev next
I see you used Socket.IO, how's the performance been?
bobbuilder 6 months ago next
It's been great. We have experienced minimal latency and smooth operation.
alicewonder 6 months ago next
Good to know. I'm excited to start working on this feature now. Thanks for sharing!
johnsmith 6 months ago next
@alicewonder – absolutely! We're excited to see what you build!
alicewonder 6 months ago next
@johnsmith thanks! I can't wait to share the progress with you all.
johnsmith 6 months ago next
@alicewonder – We'd love to see how it turns out!
ctyberdude 6 months ago prev next
I like your implementation of the realtime editing. Are there any permissions or user roles implemented?
teamawesome 6 months ago next
Yes, we implemented basic roles: owner, editor, and viewer. However, for simplicity, we focused more on sharing and collaboration.
ctyberdude 6 months ago next
I figured as much based on your example, worked out great! Good job.
ctyberdude 6 months ago next
Much appreciated. Keep up the good work, team!
imacode 6 months ago prev next
Interesting, could you elaborate on how you managed conflicts?
janesdoe 6 months ago next
We used a combination of OT (operational transformation) and conflict resolution algorithms.
charlessoft 6 months ago next
Do you have any open-source implementation of your libraries? I would like to take a look.
janesdoe 6 months ago next
@charlessoft – Unfortunately, we don't have one at the moment. But we are planning to make it open source soon.
mikewazowski 6 months ago prev next
Kudos to the team! How did you personally handle testing for this feature?
devpriya 6 months ago next
We used a combination of manual and automated tests, focusing on real-time collaboration use cases.
mikewazowski 6 months ago next
@devpriya – Thanks for sharing. Any specific frameworks you would recommend?
devpriya 6 months ago next
For manual testing, we used Jest and Enzyme. Automated tests were run using Cypress and TestCafe.
mikewazowski 6 months ago next
Perfect! I've heard great things about Cypress and Jest. Will give them a try.
leslieknobble 6 months ago prev next
Bravo! I'm curious, how did you manage auto-saving the content while collaborating?
jinnybug 6 months ago next
@leslieknobble – We saved the content on both client-side and server-side with a short interval.
leslieknobble 6 months ago next
Neat, I'll consider this approach for an app I'm building.
jinnybug 6 months ago next
Feel free to ask me anything else. Good luck with your app!
jinnybug 6 months ago next
@jaredheavy – Sure thing jaredheavy! I'll share the link once I get it.
jinnybug 6 months ago next
@jaredheavy – Sounds great!
gregdotcom 6 months ago prev next
Fantastic work! Are there any libraries/frameworks that make this easier to implement?
quinncode 6 months ago next
@gregdotcom – Yjs is one good option. Another would be ShareDB. They'll save you a load of work.
gregdotcom 6 months ago next
@quinncode – Thanks! Those were exactly the type of libraries I was looking for.