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

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 259

  • @zawadahmed9111
    @zawadahmed9111 3 года назад +189

    Now we can sell it to Google so that they can do their interviews in it

    • @berndeveloper
      @berndeveloper 3 года назад +6

      but doesn't invert a binary tree 😆

  • @gustavoshigueo
    @gustavoshigueo 3 года назад +55

    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 года назад +8

      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 года назад +4

      @@sidheshwartiwari9834 you're welcome! Glad to know I helped :D

    • @rishabh1S
      @rishabh1S Год назад +1

      Great info 👍🏻

  • @GavHern
    @GavHern 3 года назад +101

    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 года назад +5

      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 года назад +6

      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 года назад +1

      @@patcodingcodester9781 My guess a collision of some type which is why the caching was recommended.

    • @xavimb
      @xavimb 2 года назад +1

      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

  • @CS_parth
    @CS_parth Год назад +5

    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}

  • @yooos3
    @yooos3 Год назад +10

    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!

  • @Jonathan_Henderson
    @Jonathan_Henderson 3 года назад +32

    You make creating these projects look so easy! One could only wish to create such an awesome and fluent tutorial

  • @evans8245
    @evans8245 3 года назад +8

    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.

  • @frankorefice4115
    @frankorefice4115 3 года назад +20

    Funny how I needed this yesterday. Either way, I'm happy there are more videos on this.

  • @SivakD
    @SivakD 3 года назад +4

    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.

  • @sarvagya-sharma
    @sarvagya-sharma 3 года назад +11

    I saw your project upload on github and knew it was coming!

  • @greenie62
    @greenie62 3 года назад +2

    between your spotify's background refreshing, this background saving and a little useCallback thrown in there, good stuff man. Enjoying these React projects!

  • @89stoev
    @89stoev 3 года назад +1

    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

  • @hello-peters
    @hello-peters 5 месяцев назад

    This is the best channel about Web dev I've ever seen!

  • @MohamedAshraf-ur1jp
    @MohamedAshraf-ur1jp 5 месяцев назад

    great video! I would love it if you made a video implementing this with an OT or CRDT library for synchronization.

  • @mattural20
    @mattural20 2 года назад +4

    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 года назад +1

      Resolved! please forget about my previous question.
      Here is my code:

    • @abumohammad3136
      @abumohammad3136 Год назад

      yes need code bro can u help

  • @sharpdotexe1660
    @sharpdotexe1660 3 года назад +8

    Kyle never disappoints, great video 👏

  • @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

  • @aditya_01
    @aditya_01 2 года назад +1

    You really did what your name is "Web dev simplified". Thanks a lot for such a great content.Keep posting .Thanks again 😁

  • @sethurk
    @sethurk 3 года назад +3

    This is actually a great css tutorials as well!

  • @giantPangolin
    @giantPangolin 2 года назад +2

    Could you do a follow up video explaning how to proceed with the V6 react-router-dom?

    • @codewithhazem
      @codewithhazem 2 года назад +3

      👇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 '/'

  • @pallavggupta
    @pallavggupta 2 года назад

    This channel is best simply for learning web stuff

  • @nicholaspreston9586
    @nicholaspreston9586 2 года назад

    Thanks for the Hostinger mention. I'll check it out!

  • @dragonburger5676
    @dragonburger5676 3 года назад +5

    Just incredible work man. Perfectly described and explained.
    Love this channel

  • @Ribhav.Singla
    @Ribhav.Singla Месяц назад +1

    worth watching!

  • @avneet12284
    @avneet12284 3 года назад +3

    Brilliant stuff ! I can imagine the amount of research to pull off something so good.

  • @konstantinreut2577
    @konstantinreut2577 11 месяцев назад +2

    That is updated code due to new version of React.

  • @konstantinreut2577
    @konstantinreut2577 11 месяцев назад

    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!

  • @mthaha2735
    @mthaha2735 3 года назад +8

    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 года назад +4

      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 года назад +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 года назад +2

      @@mthaha2735 sorry noob.

  • @mirkosedda3196
    @mirkosedda3196 3 года назад +1

    Crazy tutorial! Nice job Kyle!

  • @msundar661
    @msundar661 Год назад

    Unbelievable build in 45 minutes! and very neat explanation. so cool video. Thank you so much bro ❤🍻

  • @akashmurugesh3509
    @akashmurugesh3509 3 года назад

    And I can't wait to know how u can do this... Exceptional kyle

  • @mukiibipeter07
    @mukiibipeter07 3 года назад

    I haven't watched this tutorial ye but brooooooo ...
    I'm excited.

  • @AJF013
    @AJF013 3 года назад +6

    Perfect one 😉
    Pls can u do Spotify Clone another time and Netflix clone too and mainly Amazon clone

    • @adityak1231
      @adityak1231 3 года назад +2

      @@losing_interest_in_everything 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 года назад +1

      @@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 3 года назад

      @@adityak1231 do you do nextJs or u comfy with just React?

    • @adityak1231
      @adityak1231 3 года назад +1

      @@trueuchiha2042 Just React

  • @adrianohermes
    @adrianohermes Год назад +2

    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

  • @andrejvujic
    @andrejvujic 3 года назад +2

    21:39 Correct me if I'm wrong but I think that CORS stands for cross-origin resource sharing.

  • @alinet2007
    @alinet2007 3 года назад +1

    amazing tutorial time to make notion.so next

  • @TralkNEW
    @TralkNEW 3 года назад +5

    Me like a week ago: hmm i wonder how to make a google docs clone
    This video: :)
    Thank you!

  • @iJuce
    @iJuce 3 года назад +9

    if only you uploaded this 2 years earlies...

  • @creativetech8471
    @creativetech8471 3 года назад

    I wanted to same but as mark down editor, Great Content

  • @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.

  • @005_harshgupta7
    @005_harshgupta7 Год назад +1

    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

  • @autorevolutionHQ
    @autorevolutionHQ 2 месяца назад

    Can you make a tutorial on how to add pages that google docs or word has?

  • @buncakciku
    @buncakciku 3 года назад +1

    gg i watch every second...didn't notice the video was 47 min.....best code tutorial ever, easy to understand....good job

  • @MiSt3300
    @MiSt3300 3 года назад +2

    wow dude what an awesome tutorial!

  • @julian_pp
    @julian_pp 3 года назад

    Amazing! thank you! please do more short app tutorials

  • @thesubinsebastian
    @thesubinsebastian 3 года назад +3

    Brother could you please please do this in angular too, Would really love to do this project in angular🙂

  • @konstantinreut2577
    @konstantinreut2577 11 месяцев назад +2

  • @OleksandrDanylchenko2k
    @OleksandrDanylchenko2k 3 года назад

    Great trick with useCallback instead of useRef

  • @RahulSingh-b1t8u
    @RahulSingh-b1t8u Год назад

    Ek number bhai

  • @nosiphondlovu6751
    @nosiphondlovu6751 2 года назад

    Cel ung'shade, angeke ngik'phoxe 😍😜

  • @ratul1125
    @ratul1125 3 года назад

    Hostinger is the the Best

  • @ianterada6821
    @ianterada6821 3 года назад

    Really cool! Thanks for putting this together!

  • @strawberryjoker
    @strawberryjoker 3 года назад

    This was a fantastic tutorial! Thank you!

  • @cristhianjoeljarquin8016
    @cristhianjoeljarquin8016 2 года назад +1

    😆 wow you are really amazing, you make the explication super easy

  • @rlopez6636
    @rlopez6636 3 года назад

    Custom Google excel next pls

  • @nikhilchakravarthy1610
    @nikhilchakravarthy1610 Год назад +1

    how to deploy this

  • @navpreetsingh3007
    @navpreetsingh3007 3 года назад

    Hey plz make a video on how to handle multiple collection in database plz

  • @oussamasethoum2755
    @oussamasethoum2755 3 года назад

    aren't you the best ? yes you are

  • @priyaraj4735
    @priyaraj4735 3 года назад +2

    Can someone tell me how to deploy this project??

  • @anshumanrana8018
    @anshumanrana8018 3 года назад +1

    How can we deploy it???

  • @tylertachiki5186
    @tylertachiki5186 3 года назад +1

    Web Dev Simplified in 5 years: Google Search Engine clone with the algorithm

  • @rangabharath4253
    @rangabharath4253 3 года назад

    Awesome as always 👍😀

  • @FindYourWhyInLife
    @FindYourWhyInLife Год назад

    great one bud!

  • @Victor_Marius
    @Victor_Marius 3 года назад +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

  • @MiserableDuck95
    @MiserableDuck95 3 года назад +1

    Awesome video! The client folder code didn't get committed to the repo properly btw.

  • @aman9267
    @aman9267 3 года назад +1

    💯👍👍 Yes! This is what I wanted!

  • @murunwascengy2762
    @murunwascengy2762 3 года назад +1

    🎉🎉🎉 thank you Kyle, how to create multiple pages using quill just like word-document???

  • @RianY2K
    @RianY2K 3 года назад +1

    nice tutorial, thank you

  • @n3x404
    @n3x404 3 года назад

    Great idea, amazing really cool project 💪👌

  • @shakirahsanromeo7863
    @shakirahsanromeo7863 3 года назад

    Nice. Now please create a Google Sheets clone

  • @piusvictor8780
    @piusvictor8780 3 года назад

    Great Job 👏👏👏

  • @slyrockyballboa
    @slyrockyballboa 3 года назад

    Very nice, what is main benefit from cloning google docs, spotify...
    I saw many videos like this, clone this, clone that...

  • @seanmcelroy4074
    @seanmcelroy4074 3 года назад +1

    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?

  • @muhammadrezahaghiri
    @muhammadrezahaghiri 3 года назад +1

    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).

  • @29namankumar29
    @29namankumar29 3 года назад

    Thanks

  • @lowvrgamer
    @lowvrgamer 9 месяцев назад +1

    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?

  • @tsydi
    @tsydi 3 года назад

    Very useful, thanks

  • @lokeshnegi5051
    @lokeshnegi5051 2 года назад +1

    I don't know why the loading is not going from my sheet I've event tried copy pasting your code but still facing same issue.

  • @paulmichaelpangan8710
    @paulmichaelpangan8710 3 года назад +1

    Hi Sir! Is it possible to open a word file then edit like what google docs does? Thank you in advance.

  • @anils1383
    @anils1383 8 месяцев назад

    HI, Thanks for this tutorial, i have question, like how to send the value from MS docx file text as default

  • @abhaytiwari6411
    @abhaytiwari6411 3 года назад

    One video On How to build Netflix in React js

  • @hbfl3x50
    @hbfl3x50 Год назад

    setQuill(q) -> results on an error because it repeatedly calls setState inside componentDidUpdate or componentDidMount. React throws an error to avoid loops

  • @_IT_SanketBanerjee
    @_IT_SanketBanerjee 7 месяцев назад

    PLEASE MAKE DEPLOYMENT !!

  • @acerik97
    @acerik97 3 года назад +1

    Maybe a newbie question but what is the proper way to store rich/formatted text like this to database (mysql)?

  • @ashokkumawat88
    @ashokkumawat88 Год назад

    I want to like it once again 😀

  • @trochymiak
    @trochymiak 3 года назад

    To było dobre :) Very nice thx !

  • @hartyom
    @hartyom 3 года назад

    So much covered in less than an hour.

  • @giwrgosiwannidis4684
    @giwrgosiwannidis4684 3 года назад

    Sooo helpfull
    great work

  • @snehalambatkar9910
    @snehalambatkar9910 3 года назад +1

    Will you make a tutorial on game development

  • @ankitdubey9310
    @ankitdubey9310 3 года назад

    you are a god!

  • @cinemaismywife
    @cinemaismywife Месяц назад

    how do you handle multiple pages?

  • @oa1197
    @oa1197 3 года назад +1

    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 года назад +1

      @@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 года назад +1

      @@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)

  • @pankajsharma9801
    @pankajsharma9801 3 года назад

    This is perfect 💯👍👏

  • @birotest6294
    @birotest6294 3 года назад

    I love your videos.

  • @rosalyna_24
    @rosalyna_24 3 года назад

    hey can u make a video about signing a PDF using nodesignpdf module

  • @rishabkumar9578
    @rishabkumar9578 3 года назад +1

    Next How to create your own Chrome

  • @shubhamdodiya-s2s
    @shubhamdodiya-s2s Год назад

    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 ????

  • @muaazosaid1418
    @muaazosaid1418 Год назад

    How to add table support in this editor?

  • @zhmenia
    @zhmenia 3 года назад

    Just build the Firebase already))

  • @mistekfcio
    @mistekfcio 3 года назад +1

    That's so cool! Really informative video :)