I spend quite a bit of time explaining things through this video however you'll notice that the total amount of code written is not a lot at all. This means that once you know how to do this, it will probably only take you 10-15 minutes to do! If you want jump ahead to the implementation you can go to 17:00 or use the other timestamps below. If you have any feedback let me know! 00:00 - Intro 00:15 - What we'll be building 04:28 - Nestjs installation 05:52 - Generated initial code overview 06:44 - Generating Users Module 08:44 - Adding Swagger 11:26 - TypeORM / Database sqlite config 13:31 - Create User entity 16:10 - CRUD Generator? 17:00 - nestjsx/crud 18:16 - Users Controller 20:07 - Users Service 23:20 - Implementation Complete! Demo 25:45 - Conclusion 26:06 - How to customize further 26:53 - Outro
Loved this framework CRUD. I was doing something similar as a side project 2 years back and just realized it's already there in market. Thanks for the video.
It really nice that nestjs already have CRUD and plus a auto generated documentation by Swagger!!! I used to create custom file in express. Thanks for this!
Great piece of work, mate! This certainly going to inspire me to learn more about NestJS. Quite a powerful and helpful framework for an experienced node API developer!
Thank you so much for your wonderful work. It is very helpful. I enjoy watching your video and really like the way you explain things - simple, clear and relaxed.
if you’re interested in doing similar recordings I would suggest starting with a usb mic like the blue yeti, which I use in my older videos. There are various ways you can record the screen as well as yourself, on Macs there is quicktime (free) and screenflow for example. On windows there is the game bar that can also record, and camtasia I believe is a popular paid one. Lots of different options. Hope that helps!
You didnt say about load balancing. At this time, I have nest js app like this and when many clients requests api, a lot database queries awaits created. It stacks node js and server stops responding.
That doesn’t sound like a load balancing problem, do you have multiple instances of your server? Anyways there are other solutions for load balancing, it’s outside the scope of this video
Thank for the content.... Your NestJS videos are really helping me. I am curious to know how you are getting that NPM Scripts tag at the left bottom using which you are running npm scripts.
thanks! That npm window is built-in to VS code im pretty sure. Maybe add this to your settings if you’re not seeing it: “npm.enableScriptExplorer”: true
Thanks for the amazing tutorial. Do you plan to make more content? If so, then can you please please create a series or big video on CRUD Operations and User Authentication using MEAN Stack but with NestJS instead of Express. Angular, Mongo, Nest and Nodejs, CRUD's with user authentication. Thanks again for the amazing video.
Hey bro, I'm getting error on the typeorm installation, do you know if this is a conflict with the M1 macs or something like that? I just cant do that, sadly
@@smren glad you got it working! There is also an incompatibility at the moment between @nest/typeorm, typeorm 0.3.x, they're still working to support that new release. So I'd use typeorm 0.2.x for now
At the moment, it doesn't seem like it. Sounded like they had intentions to do it, but never made the implementation. See: github.com/nestjsx/crud/issues/152
Nest uses Express under the hood by default, so technically anything you can do with Express you can do with Nest. That includes template rendering with handlebars, pug, etc. And yes you can have it “serve” up SPAs with react/angular/vue. However it’s core purpose as a framework revolves more around developing microservices. If you just need a basic static file server, probably better to use Express or others.
Good to know thanks! I’m not aware of anything similar, but honestly you can just use the nest cli to auto generate all the CRUD boilerplate for you, you’d just need to add the db queries
Yes, so if you’re heavily invested in using it your best bet is to not upgrade typeorm (or downgrade). Personally I think whatever is auto generated for you is not a ton of work to do yourself. It does save you some boilerplate, but in the long run I’ve found it to just get in the way once you need more customization. If having a client is the most important aspect, personally I’d rather use ts-rest and create a type-safe client which is auto generated from a contract that your API adheres to (I made a video about that if you’re interested)
@@mariusespejo thanks for the replies. I’m not really interested in ts-rest. I mean, if I typed everything in the entities and dtos , I just prefer to consume the swagger and autogenerate from that. The APIs I develop are for my apps and also for the clients that use my apps, so they can’t integrate however they want with their current apps. There’s a fork from crudx but it’s not as maintained as the original one. Right know in playing with api platform (which is built on top of Symfony), which right know I think is the fastest way to have a rest api up and running
Practically speaking I would just use something like the unsplash api for that lol I don’t know much about web scraping tbh, maybe I’ll give it a try sometime. You should go for it though, if you’re looking for a side project
🔥🔥🔥 Man You are underRated 😫😫 You saved me so much time...❤❤ I'll share your vidéo to all of my communities cause you deserve it !🙌🏿🙌🏿 💨 Thinking about it 🤔: Did you think about creating a Discord Server for your youtube community ?
I don’t think I have enough subscribers to build a community hahaha I do plan to make content consistently so maybe if one day it grows quite a bit more. Anyways I appreciate you sharing the video!
sorry I didn’t push this to a repo. If you need a written reference I highly recommend using the official nest docs as well as the crud package docs, they’re both extremely well documented
hey Nathaniel, I have another Nest Crash Course video on my channel which goes over the fundamentals. I would maybe recommend taking a look at the first, goes into much more detail
I use the command "yarn add --save @nestjs/sequelize" but when importing { SequelizeModule } from '@nestjs/sequelize'; error Cannot find module '@nestjs/sequelize' or its corresponding type declarations. I use "yarn add --save @nestjs/sequelize" again and it gives me the error "error Missing list of packages to add to your project."
Thank you for great tutorial material, maybe someone has problem with POST method within @PrimaryGeneratedColumn() ? this always return NULL, not generated number
yes as long as your existing schema in the db matches what you’re representing in the entity. For example it sounds to me like your primary key is not already an auto incrementing int, which is what @PrimaryGeneratedColumn does. You’d have to update the your database to match, and the proper way to do that is through a migration
Aint I glad I bumped into your video. You are the first person to teach me Nestjs in a way I actually understood. Thank you so much
Glad I could help!
I spend quite a bit of time explaining things through this video however you'll notice that the total amount of code written is not a lot at all. This means that once you know how to do this, it will probably only take you 10-15 minutes to do! If you want jump ahead to the implementation you can go to 17:00 or use the other timestamps below. If you have any feedback let me know!
00:00 - Intro
00:15 - What we'll be building
04:28 - Nestjs installation
05:52 - Generated initial code overview
06:44 - Generating Users Module
08:44 - Adding Swagger
11:26 - TypeORM / Database sqlite config
13:31 - Create User entity
16:10 - CRUD Generator?
17:00 - nestjsx/crud
18:16 - Users Controller
20:07 - Users Service
23:20 - Implementation Complete! Demo
25:45 - Conclusion
26:06 - How to customize further
26:53 - Outro
Loved this framework CRUD. I was doing something similar as a side project 2 years back and just realized it's already there in market. Thanks for the video.
Thanks for this intro, very helpful.
thanks for the feedback! glad it’s helpful
Great tutorial! Thanks for sharing it!
Glad it was helpful!
It really nice that nestjs already have CRUD and plus a auto generated documentation by Swagger!!! I used to create custom file in express. Thanks for this!
same, I had to go through the pain of writing specs manually with express haha never again
Great video brother.
Thanks Rick! 👊
This tutorial is great! Thank u so much!
Great piece of work, mate! This certainly going to inspire me to learn more about NestJS. Quite a powerful and helpful framework for an experienced node API developer!
thanks glad to hear! If you’re already doing some node work I definitely highly recommend giving Nest a shot!
Thank you for this amazing tutorial! SUBED!
I am the 250 subscriber!
haha yes!!
Thank you for saving me some hours of work man
no problem! glad it’s helpful
Really cool bro!
Thank you so much for your wonderful work. It is very helpful. I enjoy watching your video and really like the way you explain things - simple, clear and relaxed.
Thanks for stopping by to comment 🙂
Damn 🔥 Quality content. Keep it up man
hey Mark! thank you!
very helpful!
Thank you for your great work! Your videos are really useful.
Thank you!
Thank you so much, this is very useful
my hero of the day
real boss
Nice content. Thanks
Can we learn Nestia, the popular package for nestjs? there are no tutorials out there about it
what is the microphone you are using? name please? Also how do you capture yourself?
And many thanks for this nice little tutorial
if you’re interested in doing similar recordings I would suggest starting with a usb mic like the blue yeti, which I use in my older videos. There are various ways you can record the screen as well as yourself, on Macs there is quicktime (free) and screenflow for example. On windows there is the game bar that can also record, and camtasia I believe is a popular paid one. Lots of different options. Hope that helps!
You didnt say about load balancing. At this time, I have nest js app like this and when many clients requests api, a lot database queries awaits created. It stacks node js and server stops responding.
That doesn’t sound like a load balancing problem, do you have multiple instances of your server? Anyways there are other solutions for load balancing, it’s outside the scope of this video
Hey! can you tell how you add that cool effect in terminal, I am talking about fade particles effect, Thank you.
You are one of the best instructor.
I was using the hyper terminal here, it’s just one of the default plugins you can install
@@mariusespejo Thank you mate. Love the way you taught😃
Thanks, really helpful. Also could you do one with Microservices?
Thank for the content.... Your NestJS videos are really helping me. I am curious to know how you are getting that NPM Scripts tag at the left bottom using which you are running npm scripts.
thanks! That npm window is built-in to VS code im pretty sure.
Maybe add this to your settings if you’re not seeing it:
“npm.enableScriptExplorer”: true
@@mariusespejo Figured it out in the meanwhile. Thank you again.
All of the filtering, search, sort, etc... did you have to manually set any of that up?
No, did you watch the entire video? Pretty I sure I show exactly what minimal setup I had to do
Thank you Marius for great Video, maybe you can tell the best way to group Response data with nestjsx/crud ?
Do you have a tutorial on creating seed data for NestJS? I am trying to find a way to do it, that it is not specifically tied to TypeOrm.
I do have a video on typeorm which covers migrations which can also be used to seed data. Other ORMs have an actual seeding feature
Thanks for the amazing tutorial. Do you plan to make more content? If so, then can you please please create a series or big video on CRUD Operations and User Authentication using MEAN Stack but with NestJS instead of Express. Angular, Mongo, Nest and Nodejs, CRUD's with user authentication. Thanks again for the amazing video.
definitely making more fullstack content! thanks for the suggestion!
@@mariusespejo Thanks and ur most welcome, looking forward to it.
they is too much content on Mongo, do one with TypeORM like you did here but like a proper API with authentication and stuff
definitely!
just added a deeper dive on TypeORM if you're interested! ua-cam.com/video/sNosL578ECo/v-deo.html
Hey bro, I'm getting error on the typeorm installation, do you know if this is a conflict with the M1 macs or something like that? I just cant do that, sadly
nvm, I just tried using mysql2 and it worked for some reason ._.
@@smren glad you got it working! There is also an incompatibility at the moment between @nest/typeorm, typeorm 0.3.x, they're still working to support that new release. So I'd use typeorm 0.2.x for now
Thanks for the video. Can we use the nest/crud package for Mongo? or do you know any alternative package for the Mongo. Thanks, heaps.
At the moment, it doesn't seem like it. Sounded like they had intentions to do it, but never made the implementation. See: github.com/nestjsx/crud/issues/152
@@mariusespejo I see. Thank you.
Would you recommend using it as a SPA with any React Vue or Angular or use it with a template thanks.
Nest uses Express under the hood by default, so technically anything you can do with Express you can do with Nest. That includes template rendering with handlebars, pug, etc. And yes you can have it “serve” up SPAs with react/angular/vue. However it’s core purpose as a framework revolves more around developing microservices. If you just need a basic static file server, probably better to use Express or others.
This video was awesome! Can you please tell me what theme you use in vscode?
thank you! In this video I believe I was using night owl because the contrast looks good for recordings, but typically I would use One Monokai
nestjsx/crud has been without any update for years. It doesn't even work fine with typerom > 0.3. Any alternatives?
Good to know thanks! I’m not aware of anything similar, but honestly you can just use the nest cli to auto generate all the CRUD boilerplate for you, you’d just need to add the db queries
@@mariusespejo well, that package did that automatically and also provided a client to interact with it (with filtering and pagination)
Yes, so if you’re heavily invested in using it your best bet is to not upgrade typeorm (or downgrade). Personally I think whatever is auto generated for you is not a ton of work to do yourself. It does save you some boilerplate, but in the long run I’ve found it to just get in the way once you need more customization. If having a client is the most important aspect, personally I’d rather use ts-rest and create a type-safe client which is auto generated from a contract that your API adheres to (I made a video about that if you’re interested)
@@mariusespejo thanks for the replies. I’m not really interested in ts-rest. I mean, if I typed everything in the entities and dtos , I just prefer to consume the swagger and autogenerate from that. The APIs I develop are for my apps and also for the clients that use my apps, so they can’t integrate however they want with their current apps. There’s a fork from crudx but it’s not as maintained as the original one. Right know in playing with api platform (which is built on top of Symfony), which right know I think is the fastest way to have a rest api up and running
is there any Part 2 or something or is this "done"?
It’s not a series, just an intro to the package. Was there something specific you were looking for? The docs for that package are quite good
@@mariusespejo well some web scraping api like cat api that will generate random pics would be insne
Practically speaking I would just use something like the unsplash api for that lol I don’t know much about web scraping tbh, maybe I’ll give it a try sometime. You should go for it though, if you’re looking for a side project
🔥🔥🔥 Man You are underRated 😫😫 You saved me so much time...❤❤ I'll share your vidéo to all of my communities cause you deserve it !🙌🏿🙌🏿
💨 Thinking about it 🤔:
Did you think about creating a Discord Server for your youtube community ?
I don’t think I have enough subscribers to build a community hahaha I do plan to make content consistently so maybe if one day it grows quite a bit more. Anyways I appreciate you sharing the video!
@@mariusespejo Okay 😂 I will be waiting For That Man Hope it will be sooon 👍👍
This import completion is problematic, it's difficult to instatiate. Which extensions are you using for this?
Import intellisense is generally just typescript, it doesn’t require extensions
what's the theme you are using?
I believe night owl in this one
hello I can't run users module and controller, maybe anyone can help me?
When you are typing in your terminal, you get a cool effect. How do you did that? :D
people ask that often! haha I'm using hyper as my terminal for that, the effect is just one of the plugins. Take a look: hyper.is/
@@mariusespejo Thank you very much for the quick answer! :D
Thanks
its strange I followed everything step by step and on the swagger I get 500 response
Always check most recent docs, things change quickly
@@mariusespejo alright, thanks will give it a shot following the docs this time.
no metadata for user found
could you please share the source code link
sorry I didn’t push this to a repo. If you need a written reference I highly recommend using the official nest docs as well as the crud package docs, they’re both extremely well documented
what is really a service ?
hey Nathaniel, I have another Nest Crash Course video on my channel which goes over the fundamentals. I would maybe recommend taking a look at the first, goes into much more detail
@@mariusespejo okay, thanks. Please can you post the link
ua-cam.com/video/2n3xS89TJMI/v-deo.html
@@mariusespejo thank you
Nest JS transaction, maybe it's the good topic.
will consider it, thanks!
bye bye php and express hehe
Well still express under the hood by default 😅
@@mariusespejo haha yes, i just read the author, its based on express and socket io thats why could be realtime. cool
@@mariusespejo btw thanks for your tutorial. like it!
I use the command "yarn add --save @nestjs/sequelize" but when importing { SequelizeModule } from '@nestjs/sequelize';
error Cannot find module '@nestjs/sequelize' or its corresponding type declarations. I use "yarn add --save @nestjs/sequelize" again and it gives me the error "error Missing list of packages to add to your project."
I don’t think I used sequelize for this video? Might be better to ask this on in stackoverflow
Am I the only one having this issue? ts-loader 9.4.2 missing peer webpack@^5.0.0. Do I need this ts-loader if so should I install the webpack?
Did you use the Nest CLI to create your project? It should have come with webpack and installed it for you
@@mariusespejo yup. Maybe that’s could be related to pnpm?
@@mariusespejo also, wanted to say that you’re doing an incredible work, keep going !!
Thanks! Anyways Nest does use webpack when you run it in dev/watch mode so something is not right with your dependencies installation
@@mariusespejo lol weird I was able to run start:dev and everything was just fine
Thank you for great tutorial material, maybe someone has problem with POST method within @PrimaryGeneratedColumn() ? this always return NULL, not generated number
likely a problem with your datebase config, perhaps you never ran migrations?
@@mariusespejo Yes you are absolutely right, no migrations. Is it possible to make it work without migration with existing schema and data ?
yes as long as your existing schema in the db matches what you’re representing in the entity. For example it sounds to me like your primary key is not already an auto incrementing int, which is what @PrimaryGeneratedColumn does. You’d have to update the your database to match, and the proper way to do that is through a migration