Тёмный

The Complete Guide To Building A REST API With Node, Express, TypeScript & MongoDB + Authentication 

Code With Antonio
Подписаться 355 тыс.
Просмотров 271 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 343   
@off-samuelGYZ
@off-samuelGYZ 2 месяца назад
3:02 The "moduleResolution: node" was deprecated, so instead using "node" it's helpful use "NodeNext" or leave without definition. Awesome tutorial, you helped me a lot!
@JoSh-yu6jt
@JoSh-yu6jt Месяц назад
Did everything work for you? I'm getting a 400 Bad Request in postman when I'm trying to register a new user. 🤔
@_indrahan
@_indrahan Месяц назад
@@JoSh-yu6jt Make sure you send your request (through postman) in JSON format.
@bryancano1146
@bryancano1146 7 дней назад
I've typed NodeNext on both
@oladapodaniel6372
@oladapodaniel6372 8 месяцев назад
I just completed this video, I can say confidently that it's an outstanding video, it has skyrocketed my knowledge in node, and my ability to create REST API, structure my directories correctly, and lots more. Thank you so much Antonio🙏
@AliAliOxenFree
@AliAliOxenFree Год назад
This is an outstanding video. Most of my work has been with Nestjs and postgres, but this gave me a clear perspective on a different approach to handle the same REST endpoints. earned yourself a loyal sub!
@codewithantonio
@codewithantonio Год назад
Glad it was helpful!
@springerbarry7723
@springerbarry7723 Год назад
As a front end developer, I finally finish This REST API tutorial in a week. Great Great! Thank you very much! I will conquer all your courses One at a time! Really having fun coding with you Antonio!
@codewithantonio
@codewithantonio Год назад
Thank you for watching the tutorial!
@vladyslavfereira6931
@vladyslavfereira6931 6 месяцев назад
@@codewithantonio hello Antonio! BIG THANKS for thios video, but i have a question. why are you using http here, when u can just put app.listen and server is going to work? im not blaming, jsut cant get it
@vadimbondarenko7416
@vadimbondarenko7416 9 месяцев назад
Man, your videos are treasure. RU-vid should have added respect button. Thank you!
@codewithantonio
@codewithantonio 9 месяцев назад
Glad you like them!
@vidazarei3951
@vidazarei3951 5 месяцев назад
I want to show my appreciation for your useful video,I highly recommend to every person who is looking for do complete CRUD with Node,this video is so handy and you can get whatever you need for your REST API.
@kalombograce2677
@kalombograce2677 Год назад
best tutorial on API ts. clean and straight forward no bs. Thanks a lot.
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@irumidisara9547
@irumidisara9547 6 месяцев назад
Hi Antonio. I found your channel recently and completed coding the REST API. I learnt alot and amused with the way you explain & code all the stuff. I hadn't found a channel like yours before. However It's all super clean❤ You deserve more followers than you have rn. Keep up the great work🤍🥂 Lots of love from Sri Lanka🇱🇰
@bongjames2222
@bongjames2222 Год назад
Wow~~ This is the course I was looking for. I wanted to see a lecture made with node typescript thank you. I should have seen this lecture sooner. I used google translator.
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@canra245
@canra245 2 месяца назад
finally no error, thank you
@kwasiezor1630
@kwasiezor1630 Год назад
Great video. It's just clean, easy to understand and straightforward. Thanks and keep it up 👍
@codewithantonio
@codewithantonio Год назад
Thank you a lot, glad it helped you!
@kwasiezor1630
@kwasiezor1630 Год назад
For the next videos, Can you please Add mongodb all relationships such as one to one, one to many and many to many. It's a topic in which I have lot interest. Thanks
@codewithantonio
@codewithantonio Год назад
Thank you so much for the suggestion! I will make sure to put it on my list
@RebaiMoez
@RebaiMoez Год назад
MongoDb is no sql database so basically there’s no relation between collections
@trackntrail2869
@trackntrail2869 Год назад
@@RebaiMoez There can be relations between collections in document DBs. While it is advisable to denormalize, there are certainly scenarios where you would query a collection by FK.
@gibsonsgibson1513
@gibsonsgibson1513 Год назад
​@@RebaiMoezactually it is possible to create relationships.
@ebenezersiaw935
@ebenezersiaw935 Год назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-StrwQFdxudQ.htmlsi=gJsfvd_ndHo_i5DU
@SurajBhanMundotiya-e2j
@SurajBhanMundotiya-e2j Год назад
Very clean and crisp video Antonio, that's what a good dev and guide should do, gonna watch more content and learn from your channel.
@codewithantonio
@codewithantonio Год назад
Much appreciated!
@jousufjacob8251
@jousufjacob8251 Месяц назад
You are a pro man.
@WagnerDueñas
@WagnerDueñas 5 месяцев назад
Your tutorial has been the most useful for me!
@q5850
@q5850 11 месяцев назад
perfect, I love this channel. Thanks to god, I discovered this channel
@codewithantonio
@codewithantonio 11 месяцев назад
So happy to hear that!
@theovdhd
@theovdhd Год назад
Good tutorial but it might be more helpful to also mention what certain parts of the code are doing and why they're there. At one point, a line is added that is "extremely important" or else the code will not work. It would be nice to get some explanation about why that is exactly.
@codewithantonio
@codewithantonio Год назад
I full agree, this was my first video and I didn't really know what I was doing, thank you for the feedback!
@anonymous_basics
@anonymous_basics 9 месяцев назад
i also felt same.
@4dev346
@4dev346 Год назад
I was able to run the findByIdAndUpdate even though it was not included at the video. Thanks for a very clear and smooth tutorial.
@codewithantonio
@codewithantonio Год назад
Glad it helped!
@siddharthprithvisingh
@siddharthprithvisingh 26 дней назад
great video. very helpful. thanks
@rainyuuu
@rainyuuu Год назад
Thank you for this video!! I am a backend noob and this guide helped me a lot! So glad that I came across your video.
@codewithantonio
@codewithantonio Год назад
Glad to hear it!
@codingintelugu8820
@codingintelugu8820 8 месяцев назад
Great Video Antonio. One quick thing for others, you don't need body parser as separate package with latest express (>v4), express inbuilts it
@codewithantonio
@codewithantonio 8 месяцев назад
Thanks for the info!
@volodymyrmatselyukh8808
@volodymyrmatselyukh8808 Год назад
Pretty interesting stuff. I was looking for Graph QL but landed on this video and couldn't quit) A great video for baking a boilerplate for future projects. Thanks.
@off-samuelGYZ
@off-samuelGYZ 2 месяца назад
I've had having some trouble getting my code to run properly. My main two issues were with user login and checking if an email already exists in the database. My solution was to import the 'User Model' into my controller file and use the findOne method. That little fix did the trick. I'm a junior software developer, so don't get mad at me, seniors software enginnering! lol!
@angaragg.3165
@angaragg.3165 5 месяцев назад
This is a great video. You did a good job.
@raiyanthedeveloper
@raiyanthedeveloper Год назад
Thanks a lot for explaining so quickly. Wating for your vidoes. Love from Bangladesh.
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@gaminghta333
@gaminghta333 Год назад
Great video - I love this video about nodejs typescript
@codewithantonio
@codewithantonio Год назад
Thank you a lot!
@Liam-vn1fp
@Liam-vn1fp Год назад
Thanks for this USEFUL REST API GUIDE
@codewithantonio
@codewithantonio Год назад
You are most welcome
@attaullahsiddiqui3931
@attaullahsiddiqui3931 10 месяцев назад
Very good. Waiting for more videos like these for Angular, Node(advanced), Flutter
@markus_dev_cwb
@markus_dev_cwb Год назад
Amazing API video. Very easy to understand and clean code to learn! Thanks Man!
@codewithantonio
@codewithantonio Год назад
Glad it was helpful!
@chetanrana7778
@chetanrana7778 Год назад
Excellent Tutorial
@codewithantonio
@codewithantonio Год назад
Glad you liked it
@amanmalik781
@amanmalik781 Год назад
Thank You so much, really needed this
@codewithantonio
@codewithantonio Год назад
Glad it helped!
@JamesVannordstrand
@JamesVannordstrand Год назад
I love your stuff. Keep up the great work. You're an amazing teacher and these simple tutorials are awesome.
@gherardivictor
@gherardivictor 6 месяцев назад
So helpful Antonio, you're so great. but remember that now body parser is deprecated
@MatiasNovillo1
@MatiasNovillo1 9 месяцев назад
EXCELLENTE sir! Thanks!
@arpan157
@arpan157 Год назад
Personally, I would not suggest it for beginners; there is little to no explanation and it might be quite daunting for those of you who are just getting started.
@L.K.82
@L.K.82 Год назад
Very true. Thought exactly the same.
@Abu_Rayhan
@Abu_Rayhan 10 месяцев назад
I thought the same
@riyayadav8468
@riyayadav8468 10 месяцев назад
I'm beginner but I understand pretty well I like it ❤
@omkarambure9779
@omkarambure9779 9 месяцев назад
@arpan157 do you know any other good videos on express js?
@Badis-n2u
@Badis-n2u 9 месяцев назад
But which is better ? This or the simple express.js
@mennatallakhougha8614
@mennatallakhougha8614 9 месяцев назад
Very simple and easy to follow along thank you amazing video
@codewithantonio
@codewithantonio 9 месяцев назад
Glad it was helpful!
@ryanzhouff
@ryanzhouff 10 месяцев назад
Thanks for sharing this great video.Learned a lot.
@codewithantonio
@codewithantonio 10 месяцев назад
Glad it was helpful!
@mohammadaminreihani5704
@mohammadaminreihani5704 4 месяца назад
Such an amazing tutorial. Thank you Antonio! 😍👋
@bartoszgauszka7021
@bartoszgauszka7021 Год назад
thanks for this tutorial, it made me a lot easier to setup TS with express and use it 😃😃
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@gopikrishnag41
@gopikrishnag41 Год назад
Very straight forward and easy to understand, thx
@codewithantonio
@codewithantonio Год назад
Glad you like it
@GabrielAlves-ci3zr
@GabrielAlves-ci3zr Год назад
Great video! i was struggling with back-end and this really cleared my mind. What would you recommend when it comes to testing? A video focused on TDD with typescript would be great :)
@codewithantonio
@codewithantonio Год назад
Happy you liked the video! I will perhaps make a more in-depth tutorial about testing in the future
@leavs
@leavs Год назад
@@codewithantonio
@ekerekeprecious5571
@ekerekeprecious5571 Год назад
Anticipating this @@codewithantonio
@swastikpatro6436
@swastikpatro6436 9 месяцев назад
Hey Antonio, a video on TDD will be highly appreciated🙏❤
@muditkhanna8164
@muditkhanna8164 6 месяцев назад
great content with easy explanation.
@codewithantonio
@codewithantonio 6 месяцев назад
Glad you think so!
@razibulhossen9680
@razibulhossen9680 Год назад
Amazing wait for next video
@codewithantonio
@codewithantonio Год назад
Thank you a lot! New video is coming soon!
@ValdirCastaldelliJr
@ValdirCastaldelliJr 7 месяцев назад
Hello Antonio, really nice video. i loved
@codewithantonio
@codewithantonio 7 месяцев назад
Glad you enjoyed it
@irvanmaulana1302
@irvanmaulana1302 11 месяцев назад
omg I learned a lot from this video, thanks a lot!
@codewithantonio
@codewithantonio 11 месяцев назад
Glad it was helpful!
@alimezghani9239
@alimezghani9239 Год назад
Mate this is awesome
@codewithantonio
@codewithantonio Год назад
Thank you so much!
@victorsmilyborgesalmonte8418
Very cool the way you handle the router!! You got a like and a follow!
@stefanocons
@stefanocons Год назад
Loved this tutorial! Thanks a lot man!
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@hanifbahari6606
@hanifbahari6606 Год назад
amazing, easy to follow and pleasant to listen.
@codewithantonio
@codewithantonio Год назад
Thank you very much :)
@sarfrazshah5158
@sarfrazshah5158 4 месяца назад
Excellent explanation!
@codewithantonio
@codewithantonio 4 месяца назад
Thank you!
@sarfrazshah5158
@sarfrazshah5158 4 месяца назад
@@codewithantonio Oh! can you please tell me what VS Code theme you use? I just loved it....
@codewithantonio
@codewithantonio 4 месяца назад
@@sarfrazshah5158 Monokai Pro!
@sarfrazshah5158
@sarfrazshah5158 4 месяца назад
@@codewithantonio Thank you Sir!
@K.Huynh.
@K.Huynh. 6 месяцев назад
thank you for sharing!
@codewithantonio
@codewithantonio 6 месяцев назад
My pleasure!
@aswarthanarayanareddyb176
@aswarthanarayanareddyb176 11 месяцев назад
Great Tutorial, thanks for nice tutorial 💌
@codewithantonio
@codewithantonio 11 месяцев назад
You're welcome 😊
@naathan4455
@naathan4455 Год назад
You saved my life. Thanks
@codewithantonio
@codewithantonio Год назад
Happy I helped!
@ImamNurArifinHA
@ImamNurArifinHA Год назад
Great video,, you explained it clearly,, i have subscribed
@codewithantonio
@codewithantonio Год назад
Thank you a lot!
@CliveStewart-bq3od
@CliveStewart-bq3od Год назад
Would really want to see a guide to building a REST API with TypeScript + MYSQL(Larvel) + Authentication
@oscarwanga4453
@oscarwanga4453 Год назад
amazing work really helped me a lot. Thank you
@codewithantonio
@codewithantonio Год назад
Glad to hear that!
@vincenzoriwu2998
@vincenzoriwu2998 Год назад
Thank you, very useful using ts
@codewithantonio
@codewithantonio Год назад
Glad it was helpful!
@xuanthangle8207
@xuanthangle8207 Год назад
Your content is good, keep create more content about nodejs with TS but in the real life, it will be great
@codewithantonio
@codewithantonio Год назад
Thank you!
@Salah-YT
@Salah-YT Год назад
thank u so much
@codewithantonio
@codewithantonio Год назад
Happy to help
@SUNYBOI
@SUNYBOI 7 месяцев назад
If someone asks me why you are using typescript as the same api can be built using javascript only. Then what should I reply technically? @Antonio
@thequang9234
@thequang9234 Год назад
Do more backend tutorials !!
@codewithantonio
@codewithantonio Год назад
Will do in the future! Thank you for watching!
@RwandaBruno
@RwandaBruno 5 месяцев назад
Thanks very much ❤❤❤
@peapuffer3514
@peapuffer3514 Год назад
And just like that I completed the tutorial successfully. Thanks for the video
@codewithantonio
@codewithantonio Год назад
Glad it helped
@Noritoshi-r8m
@Noritoshi-r8m Год назад
Great stuff! Many thx
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@adamt4110
@adamt4110 9 месяцев назад
create user returns 200. GOOD job!
@hacksbsb
@hacksbsb Год назад
Wow this tutorial really saves me cause I have a interview about it. If you have time, could you please do a MEAN/MERN based on this tutorial?
@skbhati199
@skbhati199 Год назад
excellent video I need videos for socials login🥰🥰
@codewithantonio
@codewithantonio Год назад
Thank you! If you are interested in NextJS, I have a couple of tutorials which do social login there
@roebienarnaiz
@roebienarnaiz Год назад
Great Video!
@codewithantonio
@codewithantonio Год назад
Thank you!
@thecodereviewer
@thecodereviewer 10 месяцев назад
Great great job! 😊
@awesomeguy6427
@awesomeguy6427 Год назад
Can u please more videos on express Node backend and production deployment.
@codewithantonio
@codewithantonio Год назад
Thanks for the suggestion! I will look into it!
@L.K.82
@L.K.82 Год назад
At around minute 32 I get errors: user.authentication.salt, .password and .sessionToken are "possibly undefined". I checked my users.ts file and it seems to be exactly the same as yours. What do I have to do in order to make this error disappear?
@JonnyCage77
@JonnyCage77 8 месяцев назад
One way woudl be to add an explicit guard check like so: if (!user || !user.authentication || !user.authentication.salt) { return res.sendStatus(400); }
@SanjayNG125
@SanjayNG125 6 месяцев назад
​@@JonnyCage77i can't even save please help me...
@SanjayNG125
@SanjayNG125 6 месяцев назад
Bro did u fixed it if s how...??
@mauricioferreyra4378
@mauricioferreyra4378 2 месяца назад
thank you so much
@bouabahmed3525
@bouabahmed3525 Год назад
Great video, thanks a lot
@codewithantonio
@codewithantonio Год назад
Thank you!
@vitorrubenich3821
@vitorrubenich3821 3 месяца назад
Thanks!
@akshaysrivastava4304
@akshaysrivastava4304 9 месяцев назад
Hi there ! I would like to address a bug which I encountered while following this tutorial. If anyone is getting the following error in their app: Error: Cannot find module 'helpers' Require stack:.... Then you need to fix your imports from this - import { authentication, random } from "helpers"; to this import { authentication, random } from "../helpers"; For these '../' I spend a lot of time debugging. Thanks for the tutorial Antonio.
@igmtink
@igmtink 6 месяцев назад
sir antonio can you make a masterclass for this, like "next-auth" like having a logic to implementing "email verification, password reset, otp, oauth provider, role base"
@shueiyang6431
@shueiyang6431 Год назад
Nice tutorial for this in typescript, for unknown reason the post is deleted, so i write again, haven't go throught it but just notice you still use bodyparser, since 4.0 express have already integrated it, so you don't need anymore and you can replace the middleware with express.json() :)
@abenezermaru6276
@abenezermaru6276 Год назад
i watch your videos they well put together with advanced development practice but can you do a more in depth explanation tutorial for some us are not following at some instance
@everbliss7955
@everbliss7955 Год назад
Tutorial is great! Thanks alot. Just some thing to note, I find that you sometimes just say WHAT you are doing but you don't explain WHY.
@codewithantonio
@codewithantonio Год назад
Thanks for the tip!
@rima-t
@rima-t Год назад
Do we need the "mongoose.Promise = Promise;" line? and what does it do? thank you very much
@jorgerenteral
@jorgerenteral Год назад
Awesome man, new follower, and if you create a paid course, I'm in for buying it 🤘🏽
@codewithantonio
@codewithantonio Год назад
Very happy you like my tutorial! :)
@AndreSpecht
@AndreSpecht Год назад
Amazing video. Could you show us how to deploy it properly? Like on Netlify. Also, are u planning a React course in the near future? Thnaks
@barcalover016
@barcalover016 10 месяцев назад
you cannot deploy server side applications like this API to netlify, unless you deploy it as serverless function. although you can easily deploy it to render. but render doesn't allow your server to run all the time it shuts down after 15s from last call, and it takes too long to restart and send back response when you call it again after 15 min. better alternative is vercel but you have to configure some files to be able to deploy an api to it.
@bayandamabuza6587
@bayandamabuza6587 Год назад
I'm stuck on "user.authentication possibly 'undefined' " it shows an error
@gcma1999
@gcma1999 Год назад
Make sure your "tsconfig.json" filename is spelled correctly.
@IngPedroAraujo
@IngPedroAraujo Год назад
Thanks for sharing your knowledge.. I've got an error on the tsconfig.ts file the property "moduleResolution": "node",
@jasonterry9343
@jasonterry9343 8 месяцев назад
^ The only one of these comments actually following along. His TS Config is broken....
@frontend_ko
@frontend_ko Год назад
very nice video, thanks
@codewithantonio
@codewithantonio Год назад
Glad you liked it!
@mahedihassanshawon4821
@mahedihassanshawon4821 Год назад
thanks!
@pedroaviladressler310
@pedroaviladressler310 11 месяцев назад
do you have any recomendations on where do I learn the basics os authentication and password encrypting?
@feitan8745
@feitan8745 Год назад
The thing about storing salts is a very old concept that was discarded, it discouraged, unless something has changed and i don't know, you just don't need to save it.
@codewithantonio
@codewithantonio Год назад
Thank you for pointing this out! I will take a look at my decisions in this video and see how it can be improved, I actually did not use salt as you said in my Netflix and Twitter tutorial, so you're probably right :)
@spalk125
@spalk125 Год назад
Hello Antonio and thank you for the great content. I have watched until 33:41 (end of authentication) and I have some questions. 1) Isn't it better to use bcrypt instead of crypto for hashed passwords? 2) Isn't it better to use a .env file to save your passwords instead of using them directly in code? 3) Isn't it safer to use jwt instead of this session token? 4) Shouldn't the cookie and the token have expiration dates? 5) Like this is the authentication safe enough to use against common hacking attacks?
@caedencode
@caedencode Год назад
It is better, Its safer and JWT Is better and cookies do have expiration dates.
@JoSh-yu6jt
@JoSh-yu6jt Месяц назад
Anyone else having problems with postman? I followed everything to the t, but when it comes to postman for the first time (27:45) to register a new user, I am getting a "404 Bad Request". In Postman I am choosing "POST" with the exact same route as in the video. What am I missing? 🤔
@iiNinjaGuy
@iiNinjaGuy 21 день назад
I found the error for me to be with the controllers/authentication.ts file. The if statement to check the parameters was checking if they were true instead of false and returning an error.
@go_forward140
@go_forward140 Год назад
thank you
@codewithantonio
@codewithantonio Год назад
You're welcome
@mehdifassifihri5951
@mehdifassifihri5951 Год назад
Really good content i really like the way you code bro !! can you do a tutorial about jwt token ?
@codewithantonio
@codewithantonio Год назад
Thank you! In the future i will probably have more tutorials like that and with jwt token for sure
@angr7
@angr7 Год назад
Hi, Antonio! thx for a nice tutor! As a cpp backend dev (no experience in web) I'm wondering, why not use OpenApi notation for API declaration and sever creation?
@MariemMili
@MariemMili Год назад
thanks good job😃
@codewithantonio
@codewithantonio Год назад
Glad you like it!
@MariemMili
@MariemMili Год назад
​@@codewithantonio hi i'm wondering why when i change the name ANTONIO with another name it gives me Bad Request
@MariemMili
@MariemMili Год назад
I changed it in all the places where it has occurred
@rohitcpathare
@rohitcpathare Год назад
This is great! In the future can you also make a video using MongoDB with GraphQL?
@aminurmudanasution5813
@aminurmudanasution5813 4 месяца назад
Hi Antonio, what an amazing video can you spill the extension/plugin of your terminal, so i can get suggestion of command like in 6:55? Thanks!!
@adarshrathi8265
@adarshrathi8265 Год назад
i confuse only where you teach about owner , and tell about delete feature, because it not delete, so how I delete
@juanantoniovivaldy
@juanantoniovivaldy Год назад
what is the differences between httpServer.listen() and app.listen(), the first is using http modules, and express framework?
@h3nggg
@h3nggg Месяц назад
I have a problem with the Users, I can't get the response back with Get, Delete and Update. Any solution to check?
@marcelooliveira1541
@marcelooliveira1541 Год назад
why use MongoDB for users? isn't it better to use a relational DB like PostgreeSQL with prisma so users can have relations?
Далее
Build restful API with PostgreSQL and Express
39:26
Просмотров 99 тыс.
Express JS with TypeScript - Setup, Examples, Testing
1:20:13
Как он понял?
00:13
Просмотров 108 тыс.
CRUD API Tutorial - Node, Express, MongoDB
1:33:14
Просмотров 248 тыс.
Why aren't you using Fastify? Or Koa? Or NestJS?
9:58
Learn Node.js & Express with Project in 2 Hours
1:42:53
Просмотров 546 тыс.
NestJs Course for Beginners - Create a REST API
3:42:09
Create a Todo CRUD API in Node.js (Express & MongoDB)
31:43
Как он понял?
00:13
Просмотров 108 тыс.