Build RESTful APIs with Node.js express and MySQL | Authentication with JWT | In one Video

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

ความคิดเห็น • 255

  • @TechnicalBabaji1
    @TechnicalBabaji1  4 ปีที่แล้ว +4

    Joi my WhatsApp group for query and help chat.whatsapp.com/GsuvlYqwHFT0E27pUikeY0

  • @anujupadhyay10
    @anujupadhyay10 4 ปีที่แล้ว +61

    i). 00:00 Introduction
    ii). 05:30 Start the server
    iii). 11:07 Connect to the database
    iv). 20:18 Secure the environment
    v). 21:36 Create API/service 'createUser'
    vi). 34:44 Create other services
    vii). 38:23 Define controllers for the services
    vii). 43:57 Define routers
    viii). 51:45 Create login API
    ix). 1:01:02 Middle-ware for token validation
    Thanks for the tutorial. Very informative!

  • @martinmtandi335
    @martinmtandi335 5 ปีที่แล้ว +27

    This is exactly what i am looking for. You sir, just saved my job. Thank you for making this tutorial. May you kindly make a playlist of how to write apis using Mqsl with Nodejs.

  • @instant-code
    @instant-code 4 ปีที่แล้ว +2

    great brooo...👌👌👌 1 week se dhundh raha tha finally i got you are best bro....

  • @caiogabriel4098
    @caiogabriel4098 2 ปีที่แล้ว

    Brazil here.
    Thanks for this stuff.

  • @anamikaahmed4887
    @anamikaahmed4887 2 ปีที่แล้ว

    Best video on this topic so far!

  • @SrinubabuRavilla
    @SrinubabuRavilla 2 ปีที่แล้ว +3

    You made my day! clear and neat explanation. Thank you.

  • @antonykithaka217
    @antonykithaka217 4 ปีที่แล้ว +3

    Hey this is the best tutorial I have seen so far, thanks

  • @bishop339
    @bishop339 2 หลายเดือนก่อน

    Great share my friend. 😁

  • @AfzaishNaveed
    @AfzaishNaveed 8 หลายเดือนก่อน

    very good tutorial point to point no time wasting thanks sir

  • @AshokPatel-gd9ec
    @AshokPatel-gd9ec ปีที่แล้ว

    This video is really too specific and much helpful for me, Thanks bro

  • @typesoffun
    @typesoffun 4 ปีที่แล้ว +2

    you are awesome brother.i have no word for you to thankyou.i cant explain my happiness..you did really good job..this is the thing which i want..like in professional way..thankyou man thankyou...please make more video in node js in professional way..

  • @timuryalta
    @timuryalta 4 ปีที่แล้ว +3

    Truly an amazing tutorial. So helpful omg

  • @Spmdiamond
    @Spmdiamond 2 ปีที่แล้ว

    Love you bro I have done with signup also❤️❤️

  • @muradsalameh5294
    @muradsalameh5294 2 ปีที่แล้ว +3

    Thank you so much! I thoroughly enjoyed this tutorial. Would you be able to make a tutorial on how to connect this to the frontend of the application?

  • @sandeepsethy8943
    @sandeepsethy8943 4 ปีที่แล้ว +1

    got to know so many small points which i missed in my project . Thanx bro

  • @phahladiramoja3845
    @phahladiramoja3845 ปีที่แล้ว

    Thank you sir. Please continue on!

  • @anilmittal2964
    @anilmittal2964 4 ปีที่แล้ว +3

    Very informative and practical. The explanation and sequence of tutorial is too good and easy to understand. Thanks

  • @rupeshjaisawar5314
    @rupeshjaisawar5314 3 ปีที่แล้ว

    Best and simple explanation make more videos like this

  • @maddynewera
    @maddynewera 3 ปีที่แล้ว

    wow.. Awesome tutorial bro... now i learned express and node. Thanks a lot.

  • @shreyashkarandikar
    @shreyashkarandikar 4 ปีที่แล้ว +1

    Thanks for the video now I will use these api in my android application

  • @hakimmakhtour1059
    @hakimmakhtour1059 4 ปีที่แล้ว +5

    Thanks a lot Bro, i'm a student and it was one of the bests tutorials i've ever seen ! Can you please do a tuto for how to use it with VueJS or ReactJS ?

  • @jehuzubiri
    @jehuzubiri 5 หลายเดือนก่อน

    This helps me a lot. Please create more video sir

  • @bhnienhuis
    @bhnienhuis 3 ปีที่แล้ว +3

    Thank you, great! This was what I needed to secure the backend for my Vue app 🙂

  • @manojparmar4905
    @manojparmar4905 4 ปีที่แล้ว

    Thanks Technical Babaji. It's really very well explained.

  • @dreamvallyhasan4807
    @dreamvallyhasan4807 2 ปีที่แล้ว

    You are just awesome..... Amazing tutorial..... Thanks from the bottom of my heart

  • @mallikatarannum9033
    @mallikatarannum9033 5 ปีที่แล้ว +1

    Thanks re.. Kaam aayega bohot ye. :)

  • @popov.artem1205
    @popov.artem1205 4 ปีที่แล้ว +2

    Excellent tutorial! Thanks for your spended time!

  • @suriyaprakash5609
    @suriyaprakash5609 3 ปีที่แล้ว +1

    great work bro

  • @nirajshrestha9606
    @nirajshrestha9606 4 ปีที่แล้ว +2

    The tutorial was very helpful, thank you so much

  • @cateusmdeepblue7824
    @cateusmdeepblue7824 4 ปีที่แล้ว +2

    Thank you. I am new to this and this cleared a lot of confusion. 👍

  • @sridhargn1559
    @sridhargn1559 4 ปีที่แล้ว

    Really Awesome. Your work so much Appreciated...

  • @fluttterdev1k
    @fluttterdev1k ปีที่แล้ว

    the best tutorial ,thanks a lot bro, just keep going to do useful tutorial like this .

  • @channuyatnur2230
    @channuyatnur2230 2 ปีที่แล้ว

    very clear explanation with step wise.

  • @teckieboomer
    @teckieboomer 3 ปีที่แล้ว +2

    Great video and just what I was looking for. One question though, fsevents appears to be one of the package dependencies but npm will not install that package as it only works for Mac OS. Do you know if a workaround or alternate package for Windows dev environments?

  • @laurentguillou7134
    @laurentguillou7134 4 ปีที่แล้ว +1

    Thanks a lot, I transform the API to connect a SQL Server database with succes.

  • @gilmcglory3748
    @gilmcglory3748 4 ปีที่แล้ว +3

    This is a great tutorial contain so much. I learned a lot that will be very useful for me. Thanks so much!

  • @TheCodingOdyssey
    @TheCodingOdyssey 4 ปีที่แล้ว +6

    This was really hepful mate! Okay? Fine!

  • @umeshanirmani
    @umeshanirmani 3 ปีที่แล้ว +1

    Excellent tutorial! Thank you

  • @ManeelxAkosAdor
    @ManeelxAkosAdor 4 ปีที่แล้ว +3

    Nice video, I learned a lot. I have a question, if you require a valid jsontoken to create a user, and you only provide this token only when you login, how do the users can sign up (create its user) in the first place? Thanks in advance.

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว +1

      Yes you have pointed out very good question. Let me tell you my friends I was trying to keep this video as simple as possible so everyone can atleast get basic idea how to make rest apis but in real use there will a lot of checkpoint and bypass condition

  • @christopher6752
    @christopher6752 4 ปีที่แล้ว +1

    This video is so awesome dude

  • @shivuvk1899
    @shivuvk1899 2 ปีที่แล้ว

    Thank you..Super explation and this video very helpful for me🤩😍

  • @saidosmanhussein2820
    @saidosmanhussein2820 ปีที่แล้ว

    Worth to watch. Thanks.

  • @jmowahid
    @jmowahid 4 ปีที่แล้ว +1

    Exactly what I needed. Thank you

  • @PURESOUL-qv8xm
    @PURESOUL-qv8xm 2 ปีที่แล้ว +1

    facing the issue in bcrypt,when i execute post "Error: data and salt arguments required    at hashSync" like error is showing...
    After change the key and value of header in postman also showing same error.

    • @krishnaupadhyay4265
      @krishnaupadhyay4265 ปีที่แล้ว

      this error occurs occurs in hashSync()
      check if body.password is getting undefined or null
      instead of this ---> body.password = hashSync(body.password, salt);
      write this --> if(body.password){
      body.password = hashSync(body.password, salt);
      }
      in updateUser, under user.controller.js file

  • @d-landjs
    @d-landjs 4 ปีที่แล้ว +1

    Thanks, awesome tutorial!!! It would be great if you created another video with good practices for creating restfull apis!

  • @alexandrudomente7222
    @alexandrudomente7222 3 ปีที่แล้ว

    Very nice tutorial !!!! good job

  • @MdSalman-kw8ng
    @MdSalman-kw8ng 3 ปีที่แล้ว +1

    *****NEED HELP*****
    at 25:00, everything works fine if I use string values in the insert statement instead of (?,?,?,?,?,?) and data array but when I insert the (?,?,?,?,?,?) and data array I get an error stating
    code: 'ER_BAD_NULL_ERROR',
    errno: 1048,
    sqlMessage: "Column 'firstName' cannot be null",
    sqlState: '23000',
    index: 0,
    sql: 'INSERT INTO users(firstName, lastName, gender, email, password, number) VALUES(NULL,NULL,NULL,NULL,NULL,NULL)'

  • @rishabhdubey6674
    @rishabhdubey6674 2 ปีที่แล้ว +1

    Hello sir,
    we good video to understand the whole process....Thank for it,
    but I get stuck in hashing part,
    when I am using comparesync it is returning false each time.

  • @onieltelies4953
    @onieltelies4953 3 ปีที่แล้ว

    Hi...thanks buddy...its so much helpful..😊😊

  • @Radhe17rohit
    @Radhe17rohit 4 ปีที่แล้ว +2

    Great tutorial. I have one question why use PATCH instead of PUT for update action ?

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว

      Anything you can use its upto you. There is no restriction

    • @Radhe17rohit
      @Radhe17rohit 4 ปีที่แล้ว

      @@TechnicalBabaji1 Thanks & if i am integrating this API with react frontend then how to send the token from there ?

  • @parampatel7506
    @parampatel7506 2 ปีที่แล้ว

    Perfect explanation

  • @codetoanbug2053
    @codetoanbug2053 4 ปีที่แล้ว +1

    thanks for sharing. good video!

  • @mayankrajput2102
    @mayankrajput2102 4 ปีที่แล้ว

    Thanks, well done my friend

  • @AD-Zain
    @AD-Zain 4 ปีที่แล้ว +2

    Thanks for nice video. But the problem Sql and NodeJs is, how to handle one-many-table without repeating the data like [{id:1, images:[image1, image3, ...]}]

  • @md.rakibuddinrana3765
    @md.rakibuddinrana3765 3 ปีที่แล้ว

    thanks for this awesome tutorial bro

  • @sujataadam
    @sujataadam 2 ปีที่แล้ว

    hi, I am facing one problem, when i am using "getUsers" , I am getting "res.json is not a function" error, why this happens, please help me.

  • @sandy359sandy
    @sandy359sandy 3 ปีที่แล้ว

    Great topic 👍

  • @testnameone806
    @testnameone806 2 ปีที่แล้ว +1

    I am finding the patch/ update user service result is not an array, so results[0] returns undefined, simple returning results seems to work. Same with deleteUser

    • @TechnicalBabaji1
      @TechnicalBabaji1  2 ปีที่แล้ว

      May be they have updated the library 📚

  • @facundoorlando4942
    @facundoorlando4942 3 ปีที่แล้ว +2

    Hi, thank you for this awesome walktrough!
    I've a question... When I submit my form in react, the server show me 'Error: data and salt arguments required
    ' ...
    How could I solved this problem? Sending the JSON from postman, it works well...

    • @sanjyotvelip6462
      @sanjyotvelip6462 2 ปีที่แล้ว

      Even I'm getting the same error.how to solve this?

    • @mrays2729
      @mrays2729 ปีที่แล้ว

      @@sanjyotvelip6462 while updating i am gettingsame error

  • @laurentguillou7134
    @laurentguillou7134 4 ปีที่แล้ว

    Hello, when I have a database error (Violation of UNIQUE KEY constraint for exemple), the API crash with the Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client. Do you know why?

  • @hafizadeel493
    @hafizadeel493 4 ปีที่แล้ว

    Thanks, this tutorial help me a lot

  • @leroyjeslyn6570
    @leroyjeslyn6570 2 ปีที่แล้ว +4

    To anyone who might need it
    If you get an error on post func - creating user
    Try changing the postman body type form text to JSON

  • @imtiger92
    @imtiger92 3 ปีที่แล้ว +2

    Exsume Babaji, can I ask you an example on making multiple queries? Because in my example I need to insert some rows in an other table in order to keep the consistency of the foreign key. Thank you in advace, your videos are very great.

  • @goncaloribeiro808
    @goncaloribeiro808 3 ปีที่แล้ว +2

    Could you, please, explain the "null" first parameter of the callback functions on the services files? Thanks

    • @TechnicalBabaji1
      @TechnicalBabaji1  3 ปีที่แล้ว

      First parameter is reserved for errors if its null means no error we could check second parameter which is reserved for results

  • @mirandamon2533
    @mirandamon2533 4 ปีที่แล้ว +2

    greate video :D one question please... Should I put conectionLimit parameter on pool configuration? What happens if I do not put this parameter? Thanks for your attention :D

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว +1

      If you will not provide it will take default value which is 10

    • @mirandamon2533
      @mirandamon2533 4 ปีที่แล้ว

      Technical Babaji if I put my project on production, 5000 limit conection number is good or is it so expensive?

  • @UtsavBaral007
    @UtsavBaral007 4 ปีที่แล้ว +1

    I don't get it, How can you login without adding an user? The user first needs to register then login, isn't it? How am I supposed to login if I am not registered?! passing bearer token while registering doesn't make any sense.

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว +1

      You are right. I was just trying to show the concept. In normal scenario add user will be signup or registration there we will not add token validation

  • @phalsopha5239
    @phalsopha5239 4 ปีที่แล้ว +1

    Thank you very much sir .

  • @narebinhaa
    @narebinhaa 2 ปีที่แล้ว

    Thank you!! Very helpfull!

  • @wenkwonk1383
    @wenkwonk1383 6 หลายเดือนก่อน

    Is this code still working to the current version of the dependencies?

  • @aakashsharma7653
    @aakashsharma7653 ปีที่แล้ว

    please add your video also like trending now, else i have sleeped few times in this video

  • @shyiramberejoseph9406
    @shyiramberejoseph9406 4 ปีที่แล้ว

    You did well! thank so much

  • @indanasandeep2066
    @indanasandeep2066 3 ปีที่แล้ว

    got this error TypeError: Assignment to constant variable. and this due to reassignment of const variable token but in your case how did you handle

  • @Snehanomics
    @Snehanomics 2 ปีที่แล้ว

    you installed node js beforehand?

  • @LORDFARQUAADIUS
    @LORDFARQUAADIUS 3 ปีที่แล้ว

    Thanks for the code!

  • @umairamjadbutt9752
    @umairamjadbutt9752 4 ปีที่แล้ว +1

    I am not getting any response in my postman however data is being posted my database...Any specific reason for this ? not getting any response in my postman

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว

      I can't say what is the root cause because anything you will miss then request will continue without any response. Please debug the api

  • @sanjaibalajinallasivam3291
    @sanjaibalajinallasivam3291 2 ปีที่แล้ว

    thanks, This video help me a lot. and also I have one doubt, What is the code for POST and GET .help me with this , if I run the URL in chrome it shows CANNOT GET /.

    • @okan85100
      @okan85100 ปีที่แล้ว

      Just add slash before /api/users

  • @soumithnalli5169
    @soumithnalli5169 4 ปีที่แล้ว +1

    Thank you so much sir

  • @salvatorecasalino2253
    @salvatorecasalino2253 3 ปีที่แล้ว

    You can make a video for building this API on server? Heroku or somethings

  • @primerevan8403
    @primerevan8403 4 ปีที่แล้ว

    Are we using nodejs orm here?? If not I would watch I want to run raw queries inside from nodejs and want that. If you have any resources related to that pls help

  • @md.mahadiulhasan2003
    @md.mahadiulhasan2003 3 ปีที่แล้ว

    Could you, please, explain this err? Error: data and salt arguments required. Gives the err When I try to post the first user?

  • @TidelxD
    @TidelxD 2 ปีที่แล้ว

    Thanks you so mush very usefull

  • @forsmtp5139
    @forsmtp5139 3 ปีที่แล้ว

    insert post user succes on db but i didnt received the callback? any idea?

  • @nxnnan8019
    @nxnnan8019 4 ปีที่แล้ว +1

    Thank you for this video,So I want to know how to create logout

  • @Spmdiamond
    @Spmdiamond 2 ปีที่แล้ว

    Hii i am facing error 1:00:05 after solving not working

  • @匿名-x5m
    @匿名-x5m 2 ปีที่แล้ว +2

    This is a very good tutorial! Can you please also do the same tutorial again but with Postgresql instead of MySQL (including Vue js if possible)?

  • @mishenthakshana3407
    @mishenthakshana3407 ปีที่แล้ว

    Thankyou sir. But where the JWT token stored?

  • @krishsns1
    @krishsns1 4 ปีที่แล้ว +1

    Hi, Great tutorial, what if i want to update only one or two columns.

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว

      We use fieldName and fieldValue and we create dynamic query so we can pass any field and their value.. it will update to specific field

  • @StarDigital79
    @StarDigital79 5 ปีที่แล้ว +1

    Thanks for sharing

  • @زكرياالراوي-ل1ص
    @زكرياالراوي-ل1ص 5 หลายเดือนก่อน

    Why you don't use prisma?

  • @sathithyayogi99
    @sathithyayogi99 4 ปีที่แล้ว

    wow super video

  • @parthsingh2794
    @parthsingh2794 4 ปีที่แล้ว

    Thank You so much. I have learned a lot in this video.

  • @aumradia5397
    @aumradia5397 2 ปีที่แล้ว

    I am using mysql workbench and every thing is going alright but i am not able to conect to database...........?
    can any one pleasehelp me?

  • @poojapoojitha9114
    @poojapoojitha9114 ปีที่แล้ว

    why didn't you use sequelize??

  • @ericmwangi9547
    @ericmwangi9547 4 ปีที่แล้ว +1

    I used postgres in my case. my jsontoken not showing .It say invalid email or password even though my email and password is exactly the same. My password data type is character varying : 255 length

    • @TechnicalBabaji1
      @TechnicalBabaji1  4 ปีที่แล้ว

      I need to your code then only I can say that

    • @ericmwangi9547
      @ericmwangi9547 4 ปีที่แล้ว

      @@TechnicalBabaji1 here is a link to the code: github.com/ricomwas/node-project

    • @ericmwangi9547
      @ericmwangi9547 4 ปีที่แล้ว

      I was able to figure it out, I added the rows[0] on the callBack results.

  • @pranav3406
    @pranav3406 8 หลายเดือนก่อน

    why i m getting error of (data and salt arguments required )

  • @joaquinpolonuer4491
    @joaquinpolonuer4491 4 ปีที่แล้ว +1

    Thank you so much

  • @vikramkumar-jy9tz
    @vikramkumar-jy9tz 3 ปีที่แล้ว +1

    Tutorial is awesome,buti get the error while testing the post method ERROR: data and salt argument required. Pls guide to solve this

  • @ManishSankari
    @ManishSankari 3 ปีที่แล้ว

    Thanks but when I post or get it says...
    "success": 0,
    "message": "Access Denied! Unauthorized User"

  • @gauravmazumdar9965
    @gauravmazumdar9965 4 ปีที่แล้ว

    I am getting socket hang up error in postman.. no idea how to fix this