How To Build A Google Docs Clone With React, Socket.io, and MongoDB

  Рет қаралды 188,528

Web Dev Simplified

Web Dev Simplified

Күн бұрын

Hostinger: www.hostinger.com/webdevsimpl...
Use coupon WEBDEVSIMPLIFIED for 10% off an yearly plan.
Google docs revolutionized word documents with its collaborative features, but actually creating your own Google docs is not that hard. In this video I will show you how to create a complete Google Docs clone from scratch using ReactJS, Socket.io, MongoDB, and QuillJS.
📚 Materials/References:
GitHub Code: github.com/WebDevSimplified/g...
Learn React Today Course: courses.webdevsimplified.com/...
useEffect Video Tutorial: • Learn useEffect In 13 ...
useEffect Article: blog.webdevsimplified.com/202...
useRef Video Tutorial: • Learn useRef in 11 Min...
useRef Article: blog.webdevsimplified.com/202...
Box Model Video: • Learn CSS Box Model In...
Media Queries Video: • Learn CSS Media Query ...
MongoDB Install Video: • How To Install MongoDB...
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Introduction
01:23 - Project Overview
03:53 - Project Setup
05:36 - Setting Up Quill
11:25 - CSS Styles
20:36 - Server Setup
25:45 - Transmitting Changes To Clients
30:49 - Handling Multiple Documents
39:50 - Persisting Documents
#ReactJS #WDS #JavaScript

Пікірлер: 250
@zawadahmed9111
@zawadahmed9111 3 жыл бұрын
Now we can sell it to Google so that they can do their interviews in it
@berndeveloper
@berndeveloper 3 жыл бұрын
but doesn't invert a binary tree 😆
@frankorefice4115
@frankorefice4115 3 жыл бұрын
Funny how I needed this yesterday. Either way, I'm happy there are more videos on this.
@Jonathan_Henderson
@Jonathan_Henderson 3 жыл бұрын
You make creating these projects look so easy! One could only wish to create such an awesome and fluent tutorial
@greenie62
@greenie62 3 жыл бұрын
between your spotify's background refreshing, this background saving and a little useCallback thrown in there, good stuff man. Enjoying these React projects!
@sarvagya-sharma
@sarvagya-sharma 3 жыл бұрын
I saw your project upload on github and knew it was coming!
@mirkosedda3196
@mirkosedda3196 3 жыл бұрын
Crazy tutorial! Nice job Kyle!
@SivakD
@SivakD 3 жыл бұрын
I am doing my own little socket app and I mainly came for the explanation of implementing socket which starts at 23:07, but I definitely enjoyed the other parts. Thanks for the good content.
@sharpdotexe1660
@sharpdotexe1660 3 жыл бұрын
Kyle never disappoints, great video 👏
@gustavoshigueo
@gustavoshigueo 3 жыл бұрын
I know this really doesn't matter, but if you want an exact A4 paper size you should use these measuraments: width: 21cm; min-height: 29.7cm; Yes, cm is a CSS unit for centimeters
@sidheshwartiwari9834
@sidheshwartiwari9834 3 жыл бұрын
I needed to know this. I am actually coding a packing slip for an e-commerce business. Since they are printable, an A4 size would be great. Thanks!
@gustavoshigueo
@gustavoshigueo 3 жыл бұрын
@@sidheshwartiwari9834 you're welcome! Glad to know I helped :D
@rishabh1S
@rishabh1S 9 ай бұрын
Great info 👍🏻
@dragonburger5676
@dragonburger5676 3 жыл бұрын
Just incredible work man. Perfectly described and explained. Love this channel
@HelloPeter05
@HelloPeter05 Күн бұрын
This is the best channel about Web dev I've ever seen!
@aditya_01
@aditya_01 Жыл бұрын
You really did what your name is "Web dev simplified". Thanks a lot for such a great content.Keep posting .Thanks again 😁
@nicholaspreston9586
@nicholaspreston9586 2 жыл бұрын
Thanks for the Hostinger mention. I'll check it out!
@sethurk
@sethurk 3 жыл бұрын
This is actually a great css tutorials as well!
@msundar661
@msundar661 10 ай бұрын
Unbelievable build in 45 minutes! and very neat explanation. so cool video. Thank you so much bro ❤🍻
@ianterada6821
@ianterada6821 2 жыл бұрын
Really cool! Thanks for putting this together!
@yooos3
@yooos3 11 ай бұрын
I was so skeptical how is he gonna build something like that in just 46 minutes. But woah! This is amazing and even though I have experience in working with react and socket, still I learned so much! Great video!
@habeeb_a
@habeeb_a 10 ай бұрын
yeah me too
@strawberryjoker
@strawberryjoker 3 жыл бұрын
This was a fantastic tutorial! Thank you!
@DopeCode123
@DopeCode123 2 жыл бұрын
Bro you are just awesome. No comments just awesome. My first point of reference related to MERN or web itself. For me you are the "single source of concept" from the beginning. And I wish I reach your level of expertise very fast
@julian_pp
@julian_pp 3 жыл бұрын
Amazing! thank you! please do more short app tutorials
@shwanky
@shwanky 2 жыл бұрын
Great video. You should try figuring out the document sharing feature next!
@GavHern
@GavHern 3 жыл бұрын
I recommend you cache the document when you save it and then next time you save it, make sure changes have been made to the document before updating the database. That way you can eliminate unnecessary database writes and API calls.
@patcodingcodester9781
@patcodingcodester9781 3 жыл бұрын
So I implemented this pretty simply with just a let oldData and compared it to the data passed in the saved change function using JSON.stringify(oldData) === JSON.stringify(data) and it works great. But one issue I'm unsure of is what would happen if another browser window accessed the document within the two second window of saving. What would occur? Would it be better to just call this any time a change is made on the doc instead of setting an interval and caching? Wouldn't it be much more consistent that way? Or does this matter? I guess if someone else is accessing the document at that exact moment it is still an open socket so it would be seen by the new user?? I'm confused by this lol
@patcodingcodester9781
@patcodingcodester9781 3 жыл бұрын
Actually that was a potential issue. I did a quick test my self and saw it sometime did not catch all the data. It seems like a small issue but could be problematic with a lot of people. I decided to emit "save-document" right after I emit "send-changes". I kept it a separate emit for ease and to reuse save as a button incase someone doesn't trust the auto save. Either way this fixed the issue for me on a personal testing stand point. I'm sure this would still have errors somehow like with a lot of changes, but maybe ill look into a message queue or something if that's a possible issue
@TheLumiBros
@TheLumiBros 2 жыл бұрын
@@patcodingcodester9781 My guess a collision of some type which is why the caching was recommended.
@xavimb
@xavimb Жыл бұрын
I would rather have a throttled function whenever a user changes their content. This way you ensure that 1- DB writes only when changes are made 2- for each text change, you only do one write to the DB
@MiSt3300
@MiSt3300 3 жыл бұрын
wow dude what an awesome tutorial!
@pallavggupta
@pallavggupta Жыл бұрын
This channel is best simply for learning web stuff
@avneet12284
@avneet12284 3 жыл бұрын
Brilliant stuff ! I can imagine the amount of research to pull off something so good.
@rangabharath4253
@rangabharath4253 3 жыл бұрын
Awesome as always 👍😀
@nikitakrulikov
@nikitakrulikov 3 жыл бұрын
Your tutorial is really awesome and very helpful. Nowadays, typescript is very popular and if you make the video with typescript , it would be great.
@creativetech8471
@creativetech8471 3 жыл бұрын
I wanted to same but as mark down editor, Great Content
@RianY2K
@RianY2K 3 жыл бұрын
nice tutorial, thank you
@CS_parth
@CS_parth 11 ай бұрын
Bug : If you are getting double texteditors Fixation : When Strict Mode is on, React will run one extra development-only setup+cleanup cycle before the first real setup. This is a stress-test that ensures that your cleanup logic “mirrors” your setup logic and that it stops or undoes whatever the setup is doing. If this causes a problem, implement the cleanup function.{source: reactdocs}
@mukiibipeter07
@mukiibipeter07 2 жыл бұрын
I haven't watched this tutorial ye but brooooooo ... I'm excited.
@n3x404
@n3x404 3 жыл бұрын
Great idea, amazing really cool project 💪👌
@evans8245
@evans8245 3 жыл бұрын
Please, if you're reading this. Learn about operational transformations (OT). A set of algorithms for real-time collaboration. Y'all know sockets are expensive.
@FindYourWhyInLife
@FindYourWhyInLife 10 ай бұрын
great one bud!
@cristhianjoeljarquin8016
@cristhianjoeljarquin8016 2 жыл бұрын
😆 wow you are really amazing, you make the explication super easy
@buncakciku
@buncakciku 3 жыл бұрын
gg i watch every second...didn't notice the video was 47 min.....best code tutorial ever, easy to understand....good job
@konstantinreut2577
@konstantinreut2577 5 ай бұрын
Thank you for the greate tutorial Kyle! It would be wonderful if you could record a video about how to deploy full-stack app to repository. Because it's important to show projects to employer. Thanks in advance!
@akashmurugesh3509
@akashmurugesh3509 2 жыл бұрын
And I can't wait to know how u can do this... Exceptional kyle
@tsydi
@tsydi 3 жыл бұрын
Very useful, thanks
@user-rd5sd9mh8g
@user-rd5sd9mh8g Жыл бұрын
Ek number bhai
@BlueEyedSexyPants
@BlueEyedSexyPants 3 жыл бұрын
Now do the hard part that clients always want: Pagination.
@AbdulKhan-ul7th
@AbdulKhan-ul7th 2 жыл бұрын
any luck finding something with this?
@piusvictor8780
@piusvictor8780 3 жыл бұрын
Great Job 👏👏👏
@mistekfcio
@mistekfcio 3 жыл бұрын
That's so cool! Really informative video :)
@murunwascengy2762
@murunwascengy2762 3 жыл бұрын
🎉🎉🎉 thank you Kyle, how to create multiple pages using quill just like word-document???
@aman9267
@aman9267 3 жыл бұрын
💯👍👍 Yes! This is what I wanted!
@giwrgosiwannidis4684
@giwrgosiwannidis4684 3 жыл бұрын
Sooo helpfull great work
@alinet2007
@alinet2007 3 жыл бұрын
amazing tutorial time to make notion.so next
@trochymiak
@trochymiak 3 жыл бұрын
To było dobre :) Very nice thx !
@TralkNEW
@TralkNEW 3 жыл бұрын
Me like a week ago: hmm i wonder how to make a google docs clone This video: :) Thank you!
@austinmallar5430
@austinmallar5430 3 жыл бұрын
Awesome video! The client folder code didn't get committed to the repo properly btw.
@giantPangolin
@giantPangolin 2 жыл бұрын
Could you do a follow up video explaning how to proceed with the V6 react-router-dom?
@codewithhazem_
@codewithhazem_ 2 жыл бұрын
👇update of react-router-dom v6 👇 import {BrowserRouter as Router,Route,Routes,Navigate,} from "react-router-dom"; // Switch > Routes //Redirect > Navigate // component > element // no more exact path for '/'
@muhammadrezahaghiri
@muhammadrezahaghiri 2 жыл бұрын
It would be great if you show us how we can add authentication from another backend to this (e.g. a django or rails application).
@birotest6294
@birotest6294 3 жыл бұрын
I love your videos.
@adrianohermes
@adrianohermes Жыл бұрын
nice tutorial, how to create multiple pages? if we reach a word limit, we will jump to a new page instead of just increasing the textbox size
@navpreetsingh3007
@navpreetsingh3007 3 жыл бұрын
Hey plz make a video on how to handle multiple collection in database plz
@user-dy5vf3wz3p
@user-dy5vf3wz3p 9 ай бұрын
its dope man, does it has new page kinda thing in it, like google docs has, like if you exceding bottom of the page , then it automatically goes to next page ????
@slyrockyballboa
@slyrockyballboa 3 жыл бұрын
Very nice, what is main benefit from cloning google docs, spotify... I saw many videos like this, clone this, clone that...
@nosiphondlovu6751
@nosiphondlovu6751 2 жыл бұрын
Cel ung'shade, angeke ngik'phoxe 😍😜
@pankajsharma9801
@pankajsharma9801 3 жыл бұрын
This is perfect 💯👍👏
@acerik97
@acerik97 3 жыл бұрын
Maybe a newbie question but what is the proper way to store rich/formatted text like this to database (mysql)?
@snehalambatkar9910
@snehalambatkar9910 3 жыл бұрын
Will you make a tutorial on game development
@OleksandrDanylchenko2k
@OleksandrDanylchenko2k 3 жыл бұрын
Great trick with useCallback instead of useRef
@29namankumar29
@29namankumar29 3 жыл бұрын
Thanks
@shreyasrivastava5418
@shreyasrivastava5418 3 жыл бұрын
@web dev simplified, how do you build all of this so fast? It would've taken me months to come up with something like this
@89stoev
@89stoev 3 жыл бұрын
Super cool , however title is misleading. Google Docs have so much complex stuff like pages , headers , footers , page zones , columns . This is just Quill with save to DB
@thesubinsebastian
@thesubinsebastian 3 жыл бұрын
Brother could you please please do this in angular too, Would really love to do this project in angular🙂
@rosalyna_24
@rosalyna_24 3 жыл бұрын
hey can u make a video about signing a PDF using nodesignpdf module
@005_harshgupta7
@005_harshgupta7 Жыл бұрын
how can we make this multipage google docs project. For example if we hit a word limit we jump to a new page instead of just increasing size text box
@rlopez6636
@rlopez6636 3 жыл бұрын
Custom Google excel next pls
@paulmichaelpangan8710
@paulmichaelpangan8710 2 жыл бұрын
Hi Sir! Is it possible to open a word file then edit like what google docs does? Thank you in advance.
@anils1383
@anils1383 3 ай бұрын
HI, Thanks for this tutorial, i have question, like how to send the value from MS docx file text as default
@bradygerber6372
@bradygerber6372 3 жыл бұрын
Is there a way to set this up so that only you (the person running the doc) can make edits to one specific link, and when someone else sees it, they can't edit the page? Maybe something as simple as hiding the Quill Editor depending on who's viewing it?
@mattural20
@mattural20 2 жыл бұрын
This really is a great tutorial, almost a year later. Do know that a good bit has changed re: the "Handling Multiple Documents" chapter of the video…"react-router-dom" has upgraded to v.6 something and changed "Switch" to "Routes" and "Redirect" is now "Navigate", and you have to change the way react allows the jsx to be used.
@mhiro216
@mhiro216 2 жыл бұрын
Thank you for the excellent point. Regarding "you have to change the way react allows the jsx to be used.", can you tell me specifically how to modify the code?
@mhiro216
@mhiro216 2 жыл бұрын
Resolved! please forget about my previous question. Here is my code:
@abumohammad3136
@abumohammad3136 10 ай бұрын
yes need code bro can u help
@andrejvujic
@andrejvujic 3 жыл бұрын
21:39 Correct me if I'm wrong but I think that CORS stands for cross-origin resource sharing.
@laurenzrausche2387
@laurenzrausche2387 3 жыл бұрын
yeah i think so#
@Victor_Marius
@Victor_Marius 3 жыл бұрын
Is it ok to have socket.on("send-changes", ) inside socket.on("get-document", ) ? If it works like addEventListener probably it's a bad idea because it just appends a new listener of the same type on the same object to a new anonymous function and this can create bugs due to multiple unnecessary calls (I saw this kind of mistake in the video about the piano app as well). Usually any kind of event listener should be added once per tuple of (object, type, function) unless the callback function is not anonymous and is the same (probably stored in a more global context). Any way I think in this case you can get away by sending the documentId along side with the delta as one data object and you can acces them inside socket.on("send-changes", ) and take it outside of socket.on("get-document", ). And the same applies for the socket.on("save-document", ). Or...is socket (on the server) a different object for each client? Great video and cheers! This Quill library is good to know about it. Thanks
@seanmcelroy4074
@seanmcelroy4074 3 жыл бұрын
What if i wanted to deploy the server on something like AWS or Heroku, how would i know which port and location my client would need to connect to?
@ashokkumawat88
@ashokkumawat88 Жыл бұрын
I want to like it once again 😀
@shakirahsanromeo7863
@shakirahsanromeo7863 3 жыл бұрын
Nice. Now please create a Google Sheets clone
@ankitdubey9310
@ankitdubey9310 3 жыл бұрын
you are a god!
@Chris-qg6kc
@Chris-qg6kc 3 жыл бұрын
Nice!
@oa1197
@oa1197 3 жыл бұрын
Thank you so much! Are you planning on making an Angular course anytime soon?
@aguyoninternet9883
@aguyoninternet9883 3 жыл бұрын
Why use that shitty and unnecessarily large angular when you have it's dad React
@oa1197
@oa1197 3 жыл бұрын
@@aguyoninternet9883 I also prefer react but my uni wants us to use Angular this semester so I have to learn it :)
@aguyoninternet9883
@aguyoninternet9883 3 жыл бұрын
@@oa1197 oh, I see
@aguyoninternet9883
@aguyoninternet9883 3 жыл бұрын
@@oa1197 There are some more angular course on yt, you can learn from them, I guess Kyle is not close on doing it, how about angular course by traversy media
@ivss8927
@ivss8927 3 жыл бұрын
@@aguyoninternet9883 Traversy Media is the must go in many Crash Courses hehe, i recommend it to. In fact i was planing to learn php with him (you know, for the legacy stuff of business xd)
@tylertachiki5186
@tylertachiki5186 3 жыл бұрын
Web Dev Simplified in 5 years: Google Search Engine clone with the algorithm
@yashkhare7308
@yashkhare7308 2 жыл бұрын
Hey could you please tell what changes to be made so that it can be deployed on heroku as well
@AJF013
@AJF013 3 жыл бұрын
Perfect one 😉 Pls can u do Spotify Clone another time and Netflix clone too and mainly Amazon clone
@adityak1231
@adityak1231 3 жыл бұрын
@@Eloii_Xia Hey do you know any vid which shows how to use react with an MVC structure?
@ivss8927
@ivss8927 3 жыл бұрын
​@@adityak1231 My advice to you is search for explanations about the mvc and then go to a tutorial where they apply to it. Which videos? If there is a database (Mongo, postgress, mysql...) and they use it, and they do a folder called "controllers" they are using it.
@adityak1231
@adityak1231 3 жыл бұрын
@@ivss8927 Hey thanks. That comment was 1 month back and I've learnt a lot in that duration. I had a fully working website with a mongodb database at that point with an MVC architecture and I wanted to use React in it. I don't need it now because I'm comfortable with the full MERN stack now. Thanks again though.
@trueuchiha2042
@trueuchiha2042 2 жыл бұрын
@@adityak1231 do you do nextJs or u comfy with just React?
@adityak1231
@adityak1231 2 жыл бұрын
@@trueuchiha2042 Just React
@oussamasethoum2755
@oussamasethoum2755 3 жыл бұрын
aren't you the best ? yes you are
@marvinkatende5077
@marvinkatende5077 3 жыл бұрын
Hello, could you be having , or even upload some tutorials on connecting a UAV via cellular systems using socket.io, JSON API etc. If not, some recommendations would be truly appreciated.
@LukeWilliams91
@LukeWilliams91 2 жыл бұрын
this is truly concerning... 😂
@vrk4052
@vrk4052 3 жыл бұрын
Hello Kyle, I have a generic question. I have made a website which has a news section which needs to be updated weekly by a client. Would I create a backend with an Admin Login that leads to an Admin page which allows them to create 'news cards' that update the on the news section of the web page. Or I have to somehow attach my website to a CMS or re-create my website through a CMS , I'm really not sure what is generally done in this case? Thank you.
@vinayyadav-sb5hm
@vinayyadav-sb5hm 4 ай бұрын
i know react and started learning websockets and mongodb so can i follow this tutorial or is it for someone who is in intermediate level for websockets and mongodb
@iJuce
@iJuce 3 жыл бұрын
if only you uploaded this 2 years earlies...
@hbfl3x50
@hbfl3x50 6 ай бұрын
setQuill(q) -> results on an error because it repeatedly calls setState inside componentDidUpdate or componentDidMount. React throws an error to avoid loops
@mthaha2735
@mthaha2735 3 жыл бұрын
Would be useful if you could create the editor by your self. Looking forward to a video where you create a text editor with all standard features like text selection(changing it's calligraphy)
@ilin76bb
@ilin76bb 3 жыл бұрын
dong that is a pain in the arse and not nesecary since so many solutions out there justt take them and adjust it according to your needs is better then doing from scratch nooob
@mthaha2735
@mthaha2735 3 жыл бұрын
@@ilin76bb Dude you sound like some phony lazy arse dev who can't think and is totally dependant on others. Man if you are a serious dev then you would want to create the editor by yourselves, not because the self made is better in fact quill would be a better choice for production, but since this is a channel where he teaches js this will make your understand more deeper concepts thoroughly. Please refrain from calling noobs and all cause only a shortsighted person would do so
@ilin76bb
@ilin76bb 3 жыл бұрын
@@mthaha2735 sorry noob.
@shivanimehta4046
@shivanimehta4046 3 жыл бұрын
Just a beginner question. We have to create a MongoDB document and pass the DB uri to the mongoose.connect()? Am I right?
@lowvrgamer
@lowvrgamer 3 ай бұрын
I took you project from github but I can't run it what version of node are you using? How can I install the modules corectly?
@benlaw7843
@benlaw7843 2 жыл бұрын
Pagination with Header, Footer, Cover page ... Any tips on this ?
@hartyom
@hartyom 3 жыл бұрын
So much covered in less than an hour.
@Harsh-gq3ro
@Harsh-gq3ro 2 жыл бұрын
how to handle the server calls, don't you think making requests every 2s is quite costly, so how will we handle it?
@thienphongvu2452
@thienphongvu2452 2 жыл бұрын
Do you have any hint how to deploy the server with socket.io to AWS?
@amishadixit5157
@amishadixit5157 Жыл бұрын
Hii, there is a feature in quill's toolbar to add image with the text. If we'll add image, will it be saved with the text normally, we need to modify our database for such features right?? But I'm unable to understand how will we access an image from within the text area and store it in database and then render it at the same place from where it was picked, start, middle or end of text? I read articles for storing images as url, but I'm not getting how to exactly access and do that here in the editor?? CAN YOU PLEASE HELP WITH THAT?
@konstantinreut2577
@konstantinreut2577 5 ай бұрын
That is updated code due to new version of React.
@-leovinci
@-leovinci 3 жыл бұрын
Can we make it without any font-end/JS library?
Learn React PropTypes In 13 Minutes
13:11
Web Dev Simplified
Рет қаралды 74 М.
When someone reclines their seat ✈️
00:21
Adam W
Рет қаралды 27 МЛН
WebSockets in 100 Seconds & Beyond with Socket.io
8:31
Fireship
Рет қаралды 963 М.
1/2 - Google Docs Clone | React, Quill, Socket io & MongoDB
31:57
Code for Interview
Рет қаралды 14 М.
Learn Socket.io In 30 Minutes
27:27
Web Dev Simplified
Рет қаралды 475 М.
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 141 М.
Rich Text Editor With Javascript | Step By Step Javascript Project
49:03
Socket.io Introduction - How to Build a Chat App
21:38
Dave Gray
Рет қаралды 33 М.
10 Tailwind Classes I Wish I Knew Earlier
13:31
Web Dev Simplified
Рет қаралды 162 М.
How To Build A Better Spotify With React
58:17
Web Dev Simplified
Рет қаралды 330 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 182 М.
When someone reclines their seat ✈️
00:21
Adam W
Рет қаралды 27 МЛН