MERN Stack Full Tutorial | User authentication, JWT, Node.js, MongoDB, React and more

Поділитися
Вставка
  • Опубліковано 3 жов 2024

КОМЕНТАРІ • 242

  • @codedamn
    @codedamn  3 роки тому +15

    Learn Complete MERN Stack Web Development on codedamn: cdm.sh/fullstack

    • @skulldot5495
      @skulldot5495 3 роки тому +2

      Sir you don't think that we should avoid using mongoose and use mongodb driver's ???

    • @neeshsamsi
      @neeshsamsi 3 роки тому

      What vsc theme is that?

  • @davibentim6080
    @davibentim6080 2 роки тому +47

    Awesome tutorial.
    Fair warning as a beginner, it took me much longer than the 49 mins of the video to be able to code along and get everything working. There's a lot of things that were deprecated in newer versions of React and took some digging and googling to figure things out, but in the end, that made the learning better.
    Also, if you just clone the repo he provided, you won't be able to follow along as well since the final code is much different than the beginning. Better to code along to understand his thought process.
    Thanks for the video, Mehul

    • @sbc498
      @sbc498 2 роки тому

      can you please provide the new code bro?

    • @Krimson5pride
      @Krimson5pride Рік тому +1

      True, although compared to other channels, I was able to keep up with this video quite easily.

  • @yagami-light
    @yagami-light 2 роки тому +48

    for those who are following this now, useHistory is no longer a part of react-router-dom, instead make use of useNavigate() hook such as navigate("/login", { replace: true })

  • @alastairtooth6252
    @alastairtooth6252 2 роки тому +99

    Love the video mate. Just a note though that the React-Dom-Router process you listed has since been updated in their V6. You need to add a 'Routes 'bracket around the 'Route' (as well as adding 'Routes' to your import), then swap out your 'component' for 'element', and wrap Login and Register in a self-closing tag (i.e. component={Login} becomes element={})

    • @alastairtooth6252
      @alastairtooth6252 2 роки тому +10

      Further to this - useHistory is deprecated, and replaced with useNavigate 😀

    • @reddinagaravikumar1402
      @reddinagaravikumar1402 2 роки тому +1

      I just blindly did that thing and got error, later reinstalled old version

    • @alastairtooth6252
      @alastairtooth6252 2 роки тому +1

      Yeah the easier is to follow and to stick with v5, but thought i'd post in case anyone needs to use v6 for other reasons

    • @dash7519
      @dash7519 2 роки тому

      @@alastairtooth6252 then you have learned nothing and just copy pasting...

    • @dash7519
      @dash7519 2 роки тому

      @@reddinagaravikumar1402 then you are just imposter between programmers

  • @Ayush_kumar123
    @Ayush_kumar123 2 роки тому +4

    This was a great tutorial. You have explained how things will work in production as well as development in a very easy manner.

  • @ailany
    @ailany 2 роки тому +1

    this is the most to-the-point video on this subject I have yet found. thank you!

  • @A_Saban
    @A_Saban 2 роки тому +2

    I mean it when I say, you don't know how much you have help me. I have been struggling to get this right and thanks to you I finally got it

  • @gunjanrajtiwari1435
    @gunjanrajtiwari1435 3 роки тому +8

    Cleared so much of my confusion from this video. Mainly the development vs production part in many things like server, cors etc. Great video Mehul.

  • @helloworldxd1931
    @helloworldxd1931 3 роки тому +2

    waiting for more MERN projects
    Thank You very much!!

  • @adibpathan41833
    @adibpathan41833 Рік тому

    i have never seen this type of video on youtube. Thank you so much sir 💗

  • @AlekVila
    @AlekVila 3 роки тому +6

    I learned so much here. Thank you!

  • @abhilashpoojary3812
    @abhilashpoojary3812 Рік тому +1

    man your content is awesome and command on the language is cool i didnt skipped a beat till i finished 👌👌

  • @contentshark5122
    @contentshark5122 2 роки тому

    Owo you are just 22 years old and doing amazing things...hats off

  • @henriquealarcon7389
    @henriquealarcon7389 2 роки тому +4

    You are so good at teaching! Thanks for the tips, helped a lot!!

    • @alanmoreno6330
      @alanmoreno6330 2 роки тому +1

      I hear the MEN stack is your favorite, is that true?

  • @ridl27
    @ridl27 3 роки тому +6

    Mehul, please! Docker and all CI/CD stuff in the part 2! it would be fantastic! big please here :D
    and yep, thank you!

  • @ojestutorials8387
    @ojestutorials8387 Рік тому +1

    Amazing video! Nice teaching! Good job👍

  • @Chad-ms4ym
    @Chad-ms4ym 2 роки тому +2

    Brilliant explanations. Brilliant video structure. Excellent video overall. Subscribed!

  • @sebastiankoziel8055
    @sebastiankoziel8055 2 роки тому +1

    Great stuff man. Helped me a lot. But at the end it is very chaotic like you were going against the time :) Beside that it is awesome. Everything i neeeded in one place.

  • @kalyanking1080
    @kalyanking1080 3 роки тому +1

    bhai saab itna kuch ek video me op bhai

  • @robinmahato
    @robinmahato 3 роки тому +1

    @codedamn such a gem, for learner like me. Thanks for all your efforts.

  • @rondotexe
    @rondotexe 2 роки тому

    7 minutes in but loving this video so far!

  • @Sonu-tg6tg
    @Sonu-tg6tg 3 роки тому +4

    want this type of MERN projects

  • @Raj-iz9uz
    @Raj-iz9uz 3 роки тому

    Right now liked & shared this video.. currently learning javascript so in future I'll work on this 😊 thanks 🙏🏻

  • @thekannadacoder8134
    @thekannadacoder8134 Рік тому

    Bro❤❤❤thanks It’s an ultimate course …🥺🥺🥺 I don’t know how to thank you brother

  • @tora3492
    @tora3492 3 роки тому +1

    thumbnail is dope ♥️♥️

  • @bhavyagada6027
    @bhavyagada6027 2 роки тому +3

    Hey Mehul, can you make the video on how to deploy mern stack applications?
    I am facing some issues each time I try and takes hours to figure out so a proper guidance would help.

  • @lakshmikesarwani1278
    @lakshmikesarwani1278 2 роки тому +1

    Best video which I needed 🙏

  • @rainprahlad
    @rainprahlad 3 роки тому

    Hitesh Sir alternative is here !, Great Work .

  • @mikayilgacek
    @mikayilgacek Рік тому +4

    If you're watching that tutorial a few months after that video do yourself a favour and do not follow it.
    Or at least try to install the node dependencies used in that video. If you're using newer versions a lot of stuff won't work.
    I wasted a lot of time trying to fix NPM issues.

  • @MrWarriyo
    @MrWarriyo 2 роки тому +1

    Thanks buddy! this helps a lot.

  • @thirdyraza7878
    @thirdyraza7878 2 роки тому +3

    hey, i would like to know your extensions, especially in predicting the next lines. THANK YOU FOR THIS VIDEO, IT HELPED ME A LOT FOR OUR CAPSTONE PROJECT

  • @ayushchugh1797
    @ayushchugh1797 3 роки тому

    I watched tons of videos for auth this is the best one

  • @leranCoding
    @leranCoding 3 роки тому

    I am excited to watch part 2

  • @wojciechjarosz420
    @wojciechjarosz420 3 роки тому

    Very nice tut, good explanation!

  • @VijayKumar-pd7vv
    @VijayKumar-pd7vv 3 роки тому

    Damn I'm flattered , thanks for the tutorial

  • @HadiRazal
    @HadiRazal Рік тому +1

    thank you so much 😍

  • @pavankumar-gp9zx
    @pavankumar-gp9zx 3 роки тому

    addicted to your video's

  • @ckiv1992
    @ckiv1992 Рік тому

    Giant help!!!Thank you soooo much

  • @DeepakVishwakarma-li8wq
    @DeepakVishwakarma-li8wq 3 роки тому +1

    Hey! Express is pretty smart. They can automatically select (application/json)

  • @mehr8248
    @mehr8248 2 роки тому

    Thanks a lot for the great tutorial! ❤

  • @devendradangare440
    @devendradangare440 Рік тому +2

    Strange. Installing jsonwebtoken on server side was fine. But in order to use it on the dashboard page which is in the client side. cd client and npm i jsonwebtoken is giving me tons of error about crypto and stream!!!!!!!!!!!!!!!!!!!!!!!!!!! THEN USE in client u can remove it and install
    >npm i jwt-decode
    its work to me

  • @saleh.a1994
    @saleh.a1994 2 роки тому

    you make it so easy thank you so much :)

  • @junior2441
    @junior2441 Рік тому

    Awesome tutorial!!

  • @jackielegs7436
    @jackielegs7436 Рік тому +7

    When you start implementing jwt, if you get the 'BREAKING CHANGE' error in regards to webpack 5 then do the following.
    npm i jwt-decode
    **instead of importing jwt from 'jsonwebtoken'**
    import jwt from "jwt-decode";

    • @zohebahmad9633
      @zohebahmad9633 Рік тому

      but i then get error jwt.sign is not recognized

  • @pastuh
    @pastuh 3 роки тому +1

    I think most peoples struggle to launch production app.
    Confusing which server to choose, need to think about server limits and when to switch to cloud services for images and so on..

  • @saudkhan1080
    @saudkhan1080 2 роки тому +7

    i can't use 'import jwt from 'jsonwebtoken' due to a webpack v5 issue. Pleaseee helpppp ?

    • @FreeLeaks
      @FreeLeaks 2 роки тому +3

      First do 'npm i jwt-decode'.
      After installing jwt-decode, go to the Dashboard file and change the import statement to 'import jwt_decode from "jwt-decode"'
      Then in the useEffect statement change jwt.decode to jwt_decode.

    • @JD-hq1kn
      @JD-hq1kn 2 роки тому +2

      @@FreeLeaks You saved me from a heart attack... Thanks man.

  • @khanfaysal993
    @khanfaysal993 Рік тому

    awesome thinking process

  • @leocode128
    @leocode128 2 роки тому +1

    Hi sir , a big fan of how to teach, please continue using vs code as the coding ground , its much more easy to use and understand all small bits and pieces than codedamn playground

    • @codedamn
      @codedamn  2 роки тому

      What is something you find fundamentally difficult with playgrounds right now? Trying to improve the experience there too

  • @newborn7850
    @newborn7850 2 роки тому +1

    Q1 How to deploy it on free cloud / host for testing. Q2. How can admin upload files so that users can access them . Rest your teaching is valuable Thanku

  • @muftaudeenjimoh9678
    @muftaudeenjimoh9678 2 роки тому

    Amazing video btw 👌

  • @wdymidgaf
    @wdymidgaf Рік тому

    Gem of a tutorial!

  • @soulninjadev
    @soulninjadev 3 роки тому

    NEEDED THIS 🤝🤝🙏

  • @saajidhnawwar8505
    @saajidhnawwar8505 2 роки тому +2

    can you do the logout function too

  • @soulninjadev
    @soulninjadev 3 роки тому

    shldve probably used typescript but yeah great video! thanks

  • @omkargavhane921
    @omkargavhane921 2 роки тому

    Great tutorial 👍👏

  • @ShubhamPatil-rr4on
    @ShubhamPatil-rr4on 2 роки тому

    I love your content ❤️

  • @kirito6374
    @kirito6374 2 роки тому +3

    u cannot just import jsonwebtoken inside react
    after webpack 5. its give polyfill error

  • @shlomiyahbes4882
    @shlomiyahbes4882 Рік тому

    Thank you ! great vide !~

  • @jannikstach3494
    @jannikstach3494 Рік тому

    Thanks, super tutorial

  • @Sonu-tg6tg
    @Sonu-tg6tg 3 роки тому

    Thanks for such awesome videos, always waiting for your new videos, will be glad to get t-shirt giveaway

  • @DEV_XO
    @DEV_XO 3 роки тому +8

    Still worthy to build a mern app isntead of a nextjs app? I used to love mern, until I discovered next, what do u think about it?
    Nice videos also!

    • @kaushikrishi01
      @kaushikrishi01 3 роки тому

      hey, can you simplify what you found good in next

    • @DEV_XO
      @DEV_XO 3 роки тому

      @@kaushikrishi01 nothing much, the fact that you can deploy your project anytime with 1 click. Im a mern lover, but we have to choose productivity from time to time.
      And ofc, the SEO, the SEO my friend.

    • @chetan9533
      @chetan9533 3 роки тому

      @@DEV_XO I haven't explored nextjs yet. Does nextjs somehow remove the need to connect your app to a mongodb + express back-end? Or is it like a mern stack app only with nextJS used instead of reactJS?

    • @mitejmadan8672
      @mitejmadan8672 3 роки тому +1

      @@chetan9533 In next js you don't need to create two seperate app like the node server and react server. It is a mixture of both. There are actually multiple ways in which you can connect to db in next js. It depends on the size of data. You can check out the course on next js from codedamn. There are many great resources available on yt also.

    • @chetan9533
      @chetan9533 3 роки тому

      @@mitejmadan8672 ohhhh ok thanks.

  • @vaalarivan_p
    @vaalarivan_p 2 роки тому +1

    im getting the following error:
    Uncaught ReferenceError: process is not defined in node_modules/jsonwebtoken/lib/psSupported.js. please help me resolve this error, ive searched over an hour

  • @jasonperschcoding2474
    @jasonperschcoding2474 2 роки тому +5

    Great tutorial! That helped me alot. Just one note: I did some queries with mongosh in parallel and it seems to have problems with the collection name 'user-data' (doing an db.user-data.find() produced an error message). After renaming the collection to (e.g.) 'users', problem was gone.

    • @codedamn
      @codedamn  2 роки тому +6

      Yes, that’s because you had a dash in collection name. In that case write it like this: db['user-data'].find... and it would work

    • @jasonperschcoding2474
      @jasonperschcoding2474 2 роки тому +4

      @@codedamn Ah.... thank you! Didn't know this solution yet.

  • @nacerkraa9549
    @nacerkraa9549 Рік тому

    Thank you so much!

  • @עידןאמברמוביץ
    @עידןאמברמוביץ Рік тому +1

    Am I the only one who has problem with the line "import jwt from 'jsonwebtoken'" in the client side in the dashborad file? if anyone had this problem and was able to solve it, please let me know how!

  • @karanamkarthik356
    @karanamkarthik356 2 роки тому

    amazing tutorial

  • @developer_hadi
    @developer_hadi Рік тому +1

    Bro please, make a video on how to don't let any url to send requests to my api, using cors, I mean that I want only a specific urls to send requests with specific methods to my api, and also do the front end because I could implement the server but with the front end there's an error i don't know how to do the headers thing

  • @anonytribe
    @anonytribe Рік тому +1

    Vscode theme u'r using??

  • @ramziosta
    @ramziosta 2 роки тому +2

    @15:22 I am still getting an empty object {}, I can see the data in payload in network tab in browser, and If i send a request using POSTMAN it logs it in the console and to the database

    • @ayushjalan5964
      @ayushjalan5964 5 місяців тому

      Same error bro. did you find any solution to it?

  • @tejass817
    @tejass817 2 роки тому

    Great Content

  • @wallstudios962
    @wallstudios962 Рік тому +1

    Nice video! But I get this error when using jwt in frontend: Module not found: Error: Can't resolve 'crypto' in '/home/miguelangel/dev/computerscienceia/screenser/client/node_modules/jsonwebtoken'

    • @NerdRishu
      @NerdRishu Рік тому +1

      Hey I am have same issue did you find any solution to it

  • @dustinjohnson5500
    @dustinjohnson5500 2 роки тому +1

    How do you use localStorage? I think I initially was following another person when attempting to work on my project and he had created a localStorage.js file in a util folder inside his client directory. So just curious as to how you are actually making use of it

  • @arvindshelke8889
    @arvindshelke8889 3 роки тому

    Great tutorial so far....👌👌
    btw is it fine to skip semicolons
    or is it a bad impression ?

  • @dwivedi6037
    @dwivedi6037 2 роки тому

    Sir your communication skills really amazing I'm big fan of your voice and communication ♥️♥️
    Where are you from

  • @maniksi2855
    @maniksi2855 2 роки тому

    i am impressed.

  • @HaifengZhu-pn3uq
    @HaifengZhu-pn3uq 5 місяців тому

    hi, is MERN good for quick development?

  • @venkatmani7167
    @venkatmani7167 3 роки тому

    @codedamn Great Video and Effort behind this.
    Get some sleep dude.

  • @sunilshah300
    @sunilshah300 2 роки тому

    very helpful.

  • @leonardohurovich3381
    @leonardohurovich3381 2 роки тому +2

    Module not found: Error: Can't resolve 'jsonwebtoken'
    Do you have any idea how to solve this error? It happened when I was halfway through the authentication part

    • @roshangeorge97
      @roshangeorge97 2 роки тому

      it seems there was some syntax changes in jwt, view their latest documentation

  • @shashanksingh5690
    @shashanksingh5690 3 роки тому

    Yeay 🔥🔥🔥🔥

  • @keshavgarg7381
    @keshavgarg7381 2 роки тому

    Which theme and font you are using. Please 🙏 tell me bhaiya!!!

  • @codencamp
    @codencamp 2 роки тому +1

    if you get this error message Error message "error:0308010C:digital envelope routines::unsupported", try writing this line on your start script: "start": "react-scripts --openssl-legacy-provider start".
    if you get this error "'React' must be in scope when using JSX" try writing this to your imports:
    import React, { Component being use goes here } from 'react';

  • @sachinrawat4815
    @sachinrawat4815 2 роки тому +1

    But how to expire token on user logout?

  • @sourabhmahato5618
    @sourabhmahato5618 3 роки тому

    this is gem

  • @aid.shorts
    @aid.shorts 3 роки тому

    Who love MERN 👊

  • @rashidmachingal
    @rashidmachingal 2 роки тому

    Thank You

  • @JorgeBlancoPhotography
    @JorgeBlancoPhotography 3 роки тому +2

    would be nice if you used mysql, more usable in the real world

  • @osamaayub405
    @osamaayub405 5 місяців тому

    can you make a video on google authentication in mernstack

  • @dhruvsharma2399
    @dhruvsharma2399 3 роки тому +1

    Its better to show the final app in the intro of the video,

  • @Orionzmx1723
    @Orionzmx1723 2 роки тому +13

    Hi you can't use 'import jwt from 'jsonwebtoken' on the frontend due to a webpack v5 issue. Does anyone know how to solve this?

  • @xboy2374
    @xboy2374 2 місяці тому

    why you not use refresh token

  • @gamegem574
    @gamegem574 2 роки тому +1

    VM34:1 Uncaught (in promise) SyntaxError: Unexpected token '

    • @sarfarazpycoder7870
      @sarfarazpycoder7870 Рік тому

      I have solved that, what I did is I remove /api/register i just put only /register

    • @zohebahmad9633
      @zohebahmad9633 Рік тому

      @@sarfarazpycoder7870 i faced this issue specifically for the /api/quote fetch call found in Dashboard.js

  • @akshayboddhul
    @akshayboddhul 3 роки тому

    Which theme is this and share extension list... awesome theme I think is it dark one pro???

  • @365Pancakes
    @365Pancakes 2 роки тому +1

    What is the purpose of the quote functionality (for example, see 48:45)? Also, anyone figured out how to implement the logout feature?

    • @garbjorn1757
      @garbjorn1757 2 роки тому +2

      1. Its just populating the data for the user. A function like posting in facebook.
      2. jwt.sign({ id }, process.env.JWT_SECRET, {
      expiresIn: maxAge
      }); // create jwt with expiration. maxAge is in seconds
      to log out the user, create a function that sets the expiration to 1 second

  • @rajan-u6b
    @rajan-u6b 3 роки тому

    instead of using mongoose or monk, Why no one prefer mongodb driver?

  • @sarfarazpycoder7870
    @sarfarazpycoder7870 Рік тому

    I have tried so much but req.body is giving undefined every time 15-16 min

  • @AsilKhalifa
    @AsilKhalifa 2 місяці тому

    tahnks

  • @mdakramkhan166
    @mdakramkhan166 5 місяців тому

    What about logout flow?

  • @khizrshaikh9902
    @khizrshaikh9902 3 роки тому

    It's awesome

  • @Avoid0
    @Avoid0 3 роки тому

    Wow🔥