title
NestJS Crash Course
description
In this video we will explore the Nest JS Node.js framework which allows you to build fast and scalable server-side apps and APIs.
Sponsor: DevMountain Bootcamp
https://goo.gl/6q0dEa
Code:
https://github.com/bradtraversy/nestjs_rest_api
💖 Become a Patron: Show support & get perks!
http://www.patreon.com/traversymedia
Nest JS Docs:
https://docs.nestjs.com
Website & Udemy Courses
http://www.traversymedia.com
Follow Traversy Media:
https://www.facebook.com/traversymedia
https://www.twitter.com/traversymedia
https://www.instagram.com/traversymedia
detail
{'title': 'NestJS Crash Course', 'heatmap': [{'end': 1625.972, 'start': 1510.033, 'weight': 0.872}, {'end': 3597.382, 'start': 3561.455, 'weight': 1}], 'summary': 'The nestjs crash course covers creating a rest api using nest.js with mongodb and mongoose, including installing nest cli, setting up api methods, creating services, modules, and interfaces, utilizing mongoose and mongodb, and building crud operations.', 'chapters': [{'end': 130.96, 'segs': [{'end': 112.876, 'src': 'embed', 'start': 44.024, 'weight': 0, 'content': [{'end': 52.611, 'text': "and we're also going to hook up a mongodb database and we're going to use mongoose, which interacts really well with nest.js.", 'start': 44.024, 'duration': 8.587}, {'end': 60.798, 'text': 'so nest is a, as you can see, a progressive node.js framework for building efficient, reliable and scalable server-side applications.', 'start': 52.611, 'duration': 8.187}, {'end': 63.339, 'text': 'So basically, it sits on top of Express.', 'start': 61.298, 'duration': 2.041}, {'end': 67.361, 'text': 'Express is a very, very minimalistic framework, which is great by itself.', 'start': 63.419, 'duration': 3.942}, {'end': 69.962, 'text': "However, it doesn't give you much structure.", 'start': 67.721, 'duration': 2.241}, {'end': 75.425, 'text': 'So Nest is a framework to use if you want to have a lot of structure on your back end.', 'start': 70.383, 'duration': 5.042}, {'end': 81.188, 'text': "The syntax, the structure, it's very similar to Angular, which is a front end framework.", 'start': 76.366, 'duration': 4.822}, {'end': 88.995, 'text': 'So, it uses TypeScript, it uses services, it uses dependency injection in the same way that Angular does.', 'start': 81.668, 'duration': 7.327}, {'end': 95.701, 'text': 'It uses modules, controllers, you can generate controllers on the fly using the command line interface.', 'start': 89.055, 'duration': 6.646}, {'end': 101.346, 'text': "So, it's really powerful and, like I said, just gives you a lot of structure to your server side.", 'start': 95.781, 'duration': 5.565}, {'end': 103.728, 'text': "So we're going to build a REST API.", 'start': 102.046, 'duration': 1.682}, {'end': 106.37, 'text': "We're going to use Postman to make our request.", 'start': 103.748, 'duration': 2.622}, {'end': 108.812, 'text': "So if you're going to follow along, you want to download that.", 'start': 106.41, 'duration': 2.402}, {'end': 112.876, 'text': "We'll be using MongoDB Atlas for our database.", 'start': 109.593, 'duration': 3.283}], 'summary': 'Using nest.js with mongodb to build a structured and powerful rest api for scalable server-side applications, with similarities to angular.', 'duration': 68.852, 'max_score': 44.024, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb444024.jpg'}], 'start': 7.059, 'title': 'Nest js crash course', 'summary': 'Introduces nest.js, a progressive node.js framework for building efficient, reliable, and scalable server-side applications, and demonstrates how to create a rest api using mongodb and mongoose.', 'chapters': [{'end': 130.96, 'start': 7.059, 'title': 'Nest js crash course', 'summary': 'Introduces nest.js, a progressive node.js framework for building efficient, reliable, and scalable server-side applications, and demonstrates how to create a rest api using mongodb and mongoose.', 'duration': 123.901, 'highlights': ['Nest.js is a progressive Node.js framework for building efficient, reliable, and scalable server-side applications. Nest.js is described as a progressive Node.js framework that provides efficiency, reliability, and scalability for server-side applications.', "Nest.js provides a lot of structure on the back end, using TypeScript, services, dependency injection, modules, and controllers, similar to Angular's syntax and structure. Nest.js offers a structured approach for the back end, utilizing TypeScript, services, dependency injection, modules, and controllers, similar to the syntax and structure of Angular.", 'The tutorial demonstrates building a REST API and using MongoDB Atlas for the database, with a connection string obtained from the created cluster. The tutorial walks through the process of building a REST API and utilizing MongoDB Atlas for the database, with a specific focus on obtaining the connection string from the created cluster.']}], 'duration': 123.901, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb47059.jpg', 'highlights': ['Nest.js is a progressive Node.js framework for building efficient, reliable, and scalable server-side applications.', "Nest.js provides a lot of structure on the back end, using TypeScript, services, dependency injection, modules, and controllers, similar to Angular's syntax and structure.", 'The tutorial demonstrates building a REST API and using MongoDB Atlas for the database, with a connection string obtained from the created cluster.']}, {'end': 482.404, 'segs': [{'end': 159.268, 'src': 'embed', 'start': 131.48, 'weight': 0, 'content': [{'end': 137.122, 'text': 'What we need to do first is install the CLI globally so that we can generate a project.', 'start': 131.48, 'duration': 5.642}, {'end': 144.464, 'text': 'And with that CLI, we can we can generate controllers and providers or services, stuff like that.', 'start': 137.522, 'duration': 6.942}, {'end': 147.265, 'text': "So let's go to a terminal here.", 'start': 144.964, 'duration': 2.301}, {'end': 151.366, 'text': 'And, of course, you have to have Node.js installed, which gives you npm.', 'start': 147.945, 'duration': 3.421}, {'end': 155.047, 'text': "And we're going to say npm install dash g.", 'start': 151.846, 'duration': 3.201}, {'end': 159.268, 'text': "And then it's going to be at nest js slash cli.", 'start': 155.047, 'duration': 4.221}], 'summary': 'Install nestjs cli globally using npm for project generation and management.', 'duration': 27.788, 'max_score': 131.48, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4131480.jpg'}, {'end': 232.183, 'src': 'embed', 'start': 203.545, 'weight': 3, 'content': [{'end': 211.97, 'text': "All right, so let's go ahead and cd into Nest REST API, and I'm just going to go ahead and open up VS Code.", 'start': 203.545, 'duration': 8.425}, {'end': 215.657, 'text': "All right, so let's take a look.", 'start': 214.116, 'duration': 1.541}, {'end': 217.517, 'text': "Let's close that up.", 'start': 216.497, 'duration': 1.02}, {'end': 219.358, 'text': "Let's take a look over here at the files.", 'start': 217.617, 'duration': 1.741}, {'end': 224.5, 'text': 'If we look at our package.json, you can see that this is a pretty big file.', 'start': 219.798, 'duration': 4.702}, {'end': 232.183, 'text': 'As far as dependencies, we have some of the core framework dependencies like NestJS Common, NestJS Core.', 'start': 224.58, 'duration': 7.603}], 'summary': 'Navigating to nest rest api directory, examining large package.json with dependencies like nestjs common, nestjs core.', 'duration': 28.638, 'max_score': 203.545, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4203545.jpg'}, {'end': 417.066, 'src': 'embed', 'start': 389.312, 'weight': 4, 'content': [{'end': 391.774, 'text': "So I'm going to open up my terminal.", 'start': 389.312, 'duration': 2.462}, {'end': 402.34, 'text': "I'm going to use the VSCode integrated terminal and I'm going to run nest G for generate controller and I want a controller called items.", 'start': 391.794, 'duration': 10.546}, {'end': 407.944, 'text': "OK, so we're just dealing with items which will have a name, a description and a quantity.", 'start': 403.001, 'duration': 4.943}, {'end': 413.285, 'text': 'Now, if we look in the source folder, it created a folder for us called items,', 'start': 408.704, 'duration': 4.581}, {'end': 417.066, 'text': 'and anything that we create now that has to do with items is going to go in this folder.', 'start': 413.285, 'duration': 3.781}], 'summary': "Using vscode terminal, generated 'items' controller for name, description, and quantity.", 'duration': 27.754, 'max_score': 389.312, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4389312.jpg'}, {'end': 482.404, 'src': 'embed', 'start': 455.425, 'weight': 5, 'content': [{'end': 462.151, 'text': "However, it's not going to constantly watch the server, and it won't update our changes.", 'start': 455.425, 'duration': 6.726}, {'end': 473.179, 'text': 'So what we want to do is run npm run start colon dev, and that will use nodemon to constantly watch the server and update it.', 'start': 462.411, 'duration': 10.768}, {'end': 479.042, 'text': 'Now, if I go to Postman, I can make a get request to HTTP.', 'start': 474.42, 'duration': 4.622}, {'end': 482.404, 'text': "I could do this in the browser as well because it's a get request.", 'start': 479.703, 'duration': 2.701}], 'summary': "Using 'npm run start:dev' with nodemon enables constant server monitoring and updating, allowing for easy http get requests.", 'duration': 26.979, 'max_score': 455.425, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4455425.jpg'}], 'start': 131.48, 'title': 'Installing and setting up nest rest api', 'summary': "Covers installing nest cli globally and generating a project with node.js and npm, using 'nest new' to create a project named 'nest rest api', and setting up a nest rest api project with npm, exploring package.json file dependencies, scripts, configuration files, creating controllers and services, using decorators in typescript, and running the server using nodemon and making a get request.", 'chapters': [{'end': 179.993, 'start': 131.48, 'title': 'Installing nest cli for project generation', 'summary': "Explains the process of installing the nest cli globally to generate a project and its components, requiring node.js and npm; the cli is then used to create a new project, with the example using 'nest new' to create a project named 'nest rest api'.", 'duration': 48.513, 'highlights': ['The CLI is installed globally to generate a project and its components, requiring Node.js and npm.', "The command 'npm install -g @nestjs/cli' is used to install the Nest CLI globally.", "The CLI can be used to create a new project, demonstrated with the command 'nest new '."]}, {'end': 482.404, 'start': 180.013, 'title': 'Setting up nest rest api', 'summary': 'Covers setting up a nest rest api project using npm, exploring the package.json file dependencies, scripts, and configuration files, creating controllers and services, and using decorators in typescript, along with running the server using nodemon and making a get request.', 'duration': 302.391, 'highlights': ['Exploring package.json dependencies and scripts The package.json file includes core framework dependencies like NestJS Common, NestJS Core, platform express, and dev dependencies such as types for Express Jest, NodeMon, and prettier.', "Creating controllers and services for items By generating a controller called items using the command 'nest G', a folder for items is created in the source folder, with a controller file that imports the controller from NestJS common, and uses decorators for metadata.", "Running the server using nodemon The server can be run using the command 'npm run start:dev', which utilizes nodemon to constantly watch the server and update it.", "Making a get request to the server A get request can be made to the server using Postman or the browser, as it's a get request to an HTTP endpoint."]}], 'duration': 350.924, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4131480.jpg', 'highlights': ['The CLI is installed globally to generate a project and its components, requiring Node.js and npm.', "The command 'npm install -g @nestjs/cli' is used to install the Nest CLI globally.", "The CLI can be used to create a new project, demonstrated with the command 'nest new '.", 'Exploring package.json dependencies and scripts The package.json file includes core framework dependencies like NestJS Common, NestJS Core, platform express, and dev dependencies such as types for Express Jest, NodeMon, and prettier.', "Creating controllers and services for items By generating a controller called items using the command 'nest G', a folder for items is created in the source folder, with a controller file that imports the controller from NestJS common, and uses decorators for metadata.", "Running the server using nodemon The server can be run using the command 'npm run start:dev', which utilizes nodemon to constantly watch the server and update it.", "Making a get request to the server A get request can be made to the server using Postman or the browser, as it's a get request to an HTTP endpoint."]}, {'end': 1482.572, 'segs': [{'end': 539.13, 'src': 'embed', 'start': 506.44, 'weight': 0, 'content': [{'end': 508.021, 'text': "It'll just know automatically.", 'start': 506.44, 'duration': 1.581}, {'end': 516.289, 'text': 'So if I go into my class here, actually, first thing I want to do is I want to import from NestJS common get.', 'start': 508.162, 'duration': 8.127}, {'end': 522.919, 'text': "And then I'm going to create a get decorator by doing at get parentheses.", 'start': 517.857, 'duration': 5.062}, {'end': 531.884, 'text': "And then right under that I want to create a function which I'm going to call findAll because that's what I want this to do is find all items.", 'start': 523.539, 'duration': 8.345}, {'end': 539.13, 'text': "And for now I'm going to return a string that says get all items.", 'start': 532.604, 'duration': 6.526}], 'summary': "Using nestjs to create a 'get' decorator to find all items in a class.", 'duration': 32.69, 'max_score': 506.44, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4506440.jpg'}, {'end': 618.928, 'src': 'embed', 'start': 581.165, 'weight': 10, 'content': [{'end': 587.33, 'text': 'So now if we go back to postman and I send again, we get this get all items.', 'start': 581.165, 'duration': 6.165}, {'end': 591.174, 'text': "OK, so we didn't have to manually create this endpoint.", 'start': 587.35, 'duration': 3.824}, {'end': 591.854, 'text': 'It just knows.', 'start': 591.194, 'duration': 0.66}, {'end': 597.818, 'text': "now let's say we want to handle a post request to create a new item.", 'start': 592.595, 'duration': 5.223}, {'end': 601.379, 'text': 'so what we could do is up here.', 'start': 597.818, 'duration': 3.561}, {'end': 604.301, 'text': "we could bring in post while we're at it.", 'start': 601.379, 'duration': 2.922}, {'end': 618.928, 'text': "let's just bring in put and delete as well and we'll go down here and let's do at post and underneath that let's create a function called create.", 'start': 604.301, 'duration': 14.627}], 'summary': 'Using postman, we can easily handle get, post, put, and delete requests for creating and managing items.', 'duration': 37.763, 'max_score': 581.165, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4581165.jpg'}, {'end': 701.785, 'src': 'embed', 'start': 674.725, 'weight': 3, 'content': [{'end': 684.872, 'text': 'And if we go to the documentation here we go to controllers and see I am just going to search for DTO right here.', 'start': 674.725, 'duration': 10.147}, {'end': 686.253, 'text': 'So request payloads.', 'start': 684.972, 'duration': 1.281}, {'end': 692.078, 'text': 'So if you use TypeScript, we need to determine the data data transfer object schema.', 'start': 687.474, 'duration': 4.604}, {'end': 696.701, 'text': 'So DTO is an object that defines how the data will be sent over the network.', 'start': 692.558, 'duration': 4.143}, {'end': 699.263, 'text': 'So we need to create a detail like this.', 'start': 697.221, 'duration': 2.042}, {'end': 701.785, 'text': "It's a class with some fields.", 'start': 699.283, 'duration': 2.502}], 'summary': 'Dto defines data transfer object schema for typescript controllers.', 'duration': 27.06, 'max_score': 674.725, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4674725.jpg'}, {'end': 835.328, 'src': 'embed', 'start': 806.909, 'weight': 9, 'content': [{'end': 814.194, 'text': "So down in our create we're going to want to add into the parentheses right here.", 'start': 806.909, 'duration': 7.285}, {'end': 818.056, 'text': "We're going to want to use the body decorator which we actually have to bring in.", 'start': 814.434, 'duration': 3.622}, {'end': 823.676, 'text': 'OK so just like in express you would do request stop body to get your fields.', 'start': 819.332, 'duration': 4.344}, {'end': 826.899, 'text': "That's basically what we're doing here.", 'start': 824.557, 'duration': 2.342}, {'end': 835.328, 'text': "We're going to use this at body decorator and we want to put in the create, whatever we want to call this,", 'start': 826.96, 'duration': 8.368}], 'summary': 'In the create function, add the body decorator to get fields like in express.', 'duration': 28.419, 'max_score': 806.909, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4806909.jpg'}, {'end': 989.216, 'src': 'embed', 'start': 966.491, 'weight': 2, 'content': [{'end': 976.573, 'text': "you'll do something like app, app dot gets, you'll have your route and then you'll have a function and you'll have this request response.", 'start': 966.491, 'duration': 10.082}, {'end': 986.515, 'text': "OK, so you may be wondering, how do we get this these objects? So it's not really the nest JS way to do this, but you can't you can do it.", 'start': 976.593, 'duration': 9.922}, {'end': 989.216, 'text': "So I'm going to show you that real quick.", 'start': 986.535, 'duration': 2.681}], 'summary': 'Introduction to handling requests and responses in nest js.', 'duration': 22.725, 'max_score': 966.491, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4966491.jpg'}, {'end': 1148.148, 'src': 'embed', 'start': 1118.903, 'weight': 5, 'content': [{'end': 1122.406, 'text': 'OK, so if I go back and send, we get get all items again.', 'start': 1118.903, 'duration': 3.503}, {'end': 1129.112, 'text': "Now I'm just returning strings for now because ultimately we're going to want to call methods from a service.", 'start': 1122.426, 'duration': 6.686}, {'end': 1134.517, 'text': "That's where we want to do everything that has to do with our database, all that stuff that's going to happen in a service.", 'start': 1129.252, 'duration': 5.265}, {'end': 1138.321, 'text': "So right now I'm just showing you how to structure a controller.", 'start': 1135.078, 'duration': 3.243}, {'end': 1142.825, 'text': "This stuff, what we're doing inside these functions is going to ultimately change.", 'start': 1139.101, 'duration': 3.724}, {'end': 1148.148, 'text': "All right, so let's move on to getting URL params.", 'start': 1144.306, 'duration': 3.842}], 'summary': 'Demonstrating controller structure for future service integration.', 'duration': 29.245, 'max_score': 1118.903, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41118903.jpg'}, {'end': 1228.055, 'src': 'embed', 'start': 1203.171, 'weight': 6, 'content': [{'end': 1209.952, 'text': "Postman, I'm just going to grab that URL, make a get request to items slash 100 or one will do 1000.", 'start': 1203.171, 'duration': 6.781}, {'end': 1210.812, 'text': "That's fine.", 'start': 1209.952, 'duration': 0.86}, {'end': 1213.853, 'text': 'And send and we get item 1000.', 'start': 1211.372, 'duration': 2.481}, {'end': 1221.494, 'text': "So whatever I pass in right here, 44, that's going to show up right here because we were accessing it with this param.", 'start': 1213.853, 'duration': 7.641}, {'end': 1222.454, 'text': 'All right.', 'start': 1221.514, 'duration': 0.94}, {'end': 1228.055, 'text': 'Now we could bring in the, you know, the request object and we could say request dot params.', 'start': 1222.614, 'duration': 5.441}], 'summary': 'Using postman to make a get request to items/1000 and accessing parameters using request object.', 'duration': 24.884, 'max_score': 1203.171, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41203171.jpg'}, {'end': 1337.881, 'src': 'embed', 'start': 1297.011, 'weight': 7, 'content': [{'end': 1301.055, 'text': "We'll say actually I'm going to just just do it like this.", 'start': 1297.011, 'duration': 4.044}, {'end': 1302.796, 'text': "We'll do param I.D.", 'start': 1301.115, 'duration': 1.681}, {'end': 1306.139, 'text': 'but we need to pass in I.D.', 'start': 1303.697, 'duration': 2.442}, {'end': 1309.202, 'text': "OK and then I'll just go ahead and return.", 'start': 1306.159, 'duration': 3.043}, {'end': 1315.94, 'text': 'delete id.', 'start': 1312.577, 'duration': 3.363}, {'end': 1318.542, 'text': "and let's just say right here we're returning a string.", 'start': 1315.94, 'duration': 2.602}, {'end': 1322.585, 'text': "okay, we'll try that out.", 'start': 1318.542, 'duration': 4.043}, {'end': 1333.339, 'text': 'so if we make a delete request to item slash 44, we get delete 44..', 'start': 1322.585, 'duration': 10.754}, {'end': 1335.2, 'text': 'Okay, so last one is the update.', 'start': 1333.339, 'duration': 1.861}, {'end': 1337.881, 'text': "So let's do at put.", 'start': 1335.4, 'duration': 2.481}], 'summary': 'Developed functions for delete and update with parameter id, returning a string.', 'duration': 40.87, 'max_score': 1297.011, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41297011.jpg'}, {'end': 1482.572, 'src': 'embed', 'start': 1451.322, 'weight': 8, 'content': [{'end': 1457.069, 'text': "actually, so this right here, let's paste that in, we'll do item two.", 'start': 1451.322, 'duration': 5.747}, {'end': 1464.759, 'text': 'So this would essentially update the data.', 'start': 1462.617, 'duration': 2.142}, {'end': 1469.702, 'text': "But let's send and we get item 44.", 'start': 1465.559, 'duration': 4.143}, {'end': 1470.683, 'text': "That's because it's a get.", 'start': 1469.702, 'duration': 0.981}, {'end': 1472.544, 'text': 'We want to do a put.', 'start': 1470.703, 'duration': 1.841}, {'end': 1474.366, 'text': 'There we go.', 'start': 1473.945, 'duration': 0.421}, {'end': 1477.768, 'text': 'So update 44 and then we get name item two.', 'start': 1474.486, 'duration': 3.282}, {'end': 1482.572, 'text': "So we're able to access the data we send along with the parameter.", 'start': 1478.169, 'duration': 4.403}], 'summary': 'Updating data to item 44 using put method, then accessing it by name item two.', 'duration': 31.25, 'max_score': 1451.322, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41451322.jpg'}], 'start': 482.764, 'title': 'Nestjs functionality and api methods', 'summary': "Covers setting up endpoints in nestjs to create functionality with items, utilizing decorators and the common 'get' module, as well as creating api methods such as get, post, put, and delete, with a focus on typescript basics, controller structure, and testing the api endpoints using postman.", 'chapters': [{'end': 531.884, 'start': 482.764, 'title': 'Nestjs functionality with items', 'summary': "Discusses setting up endpoints in nestjs to create functionality with items, utilizing decorators and the common 'get' module to retrieve all items from the endpoint.", 'duration': 49.12, 'highlights': ['The chapter emphasizes the importance of setting up functionality with items in NestJS by creating endpoints and using decorators to retrieve all items from the endpoint.', "The speaker explains the process of setting up endpoints and creating functionality with items in NestJS using decorators and the common 'get' module.", "The chapter provides a detailed example of using decorators and the common 'get' module in NestJS to set up an endpoint for retrieving all items."]}, {'end': 768.107, 'start': 532.604, 'title': 'Nestjs typescript basics', 'summary': 'Introduces basic nestjs concepts such as defining endpoints, handling different http request methods, and creating data transfer objects in typescript, ultimately demonstrating the automatic endpoint creation and error handling features.', 'duration': 235.503, 'highlights': ['The chapter introduces basic NestJS concepts such as defining endpoints, handling different HTTP request methods Introduces basic concepts of defining endpoints and handling various HTTP request methods.', 'Demonstrates automatic endpoint creation and error handling features Shows the automatic endpoint creation and error handling features, such as the linting error when types do not match and the automatic creation of endpoints based on specified methods.', 'Creating data transfer objects in TypeScript Explains the creation of data transfer objects (DTOs) in TypeScript for defining the data schema sent over the network.']}, {'end': 1138.321, 'start': 768.607, 'title': 'Nestjs controller structure', 'summary': 'Discusses setting up a nestjs controller, importing and using decorators like @body, accessing request and response objects, and the structure of a controller for handling requests and sending responses, with a focus on the nestjs way of doing things.', 'duration': 369.714, 'highlights': ['The chapter discusses setting up a NestJS controller, importing and using decorators like @Body, accessing request and response objects, and the structure of a controller for handling requests and sending responses, with a focus on the NestJS way of doing things.', 'The @Body decorator is used to extract data sent in the request body, allowing access to fields such as name, description, and quantity from the sent data.', "Example of accessing the request and response objects within a function is shown, using @Req and @Res decorators to access request URL and send a response, similar to how it's done in regular Express.", 'The chapter also emphasizes the NestJS way of structuring a controller, where the ultimate goal is to call methods from a service to handle database-related operations.']}, {'end': 1482.572, 'start': 1139.101, 'title': 'Nestjs api methods', 'summary': 'Covers creating api methods in nestjs, including implementing get, post, put, and delete methods, utilizing decorators like @param and @body, and testing the api endpoints using postman.', 'duration': 343.471, 'highlights': ['Implementing GET method for retrieving items by ID The chapter demonstrates implementing a GET method to retrieve items by ID, allowing for dynamic parameter access and successful retrieval of specific item data using Postman.', 'Implementing DELETE method for removing items by ID The chapter illustrates the implementation of a DELETE method to remove items by ID, showcasing the successful deletion of a specific item using Postman.', 'Implementing PUT method for updating items by ID The chapter explains the implementation of a PUT method to update items by ID, enabling the modification of item data and successful update testing using Postman.', 'Utilizing decorators like @Param and @Body for dynamic parameter and data access The chapter emphasizes the use of decorators such as @Param and @Body to enable dynamic parameter and data access, contributing to the functionality and flexibility of the implemented API methods.', 'Utilizing Postman for testing API endpoints The chapter showcases the utilization of Postman for testing the API endpoints, allowing for the successful testing of implemented methods such as GET, DELETE, and PUT.']}], 'duration': 999.808, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb4482764.jpg', 'highlights': ['The chapter emphasizes the importance of setting up functionality with items in NestJS by creating endpoints and using decorators to retrieve all items from the endpoint.', "The chapter provides a detailed example of using decorators and the common 'get' module in NestJS to set up an endpoint for retrieving all items.", 'The chapter introduces basic NestJS concepts such as defining endpoints, handling different HTTP request methods Introduces basic concepts of defining endpoints and handling various HTTP request methods.', 'Creating data transfer objects in TypeScript Explains the creation of data transfer objects (DTOs) in TypeScript for defining the data schema sent over the network.', 'The chapter discusses setting up a NestJS controller, importing and using decorators like @Body, accessing request and response objects, and the structure of a controller for handling requests and sending responses, with a focus on the NestJS way of doing things.', 'The chapter also emphasizes the NestJS way of structuring a controller, where the ultimate goal is to call methods from a service to handle database-related operations.', 'Implementing GET method for retrieving items by ID The chapter demonstrates implementing a GET method to retrieve items by ID, allowing for dynamic parameter access and successful retrieval of specific item data using Postman.', 'Implementing DELETE method for removing items by ID The chapter illustrates the implementation of a DELETE method to remove items by ID, showcasing the successful deletion of a specific item using Postman.', 'Implementing PUT method for updating items by ID The chapter explains the implementation of a PUT method to update items by ID, enabling the modification of item data and successful update testing using Postman.', 'Utilizing decorators like @Param and @Body for dynamic parameter and data access The chapter emphasizes the use of decorators such as @Param and @Body to enable dynamic parameter and data access, contributing to the functionality and flexibility of the implemented API methods.', 'Utilizing Postman for testing API endpoints The chapter showcases the utilization of Postman for testing the API endpoints, allowing for the successful testing of implemented methods such as GET, DELETE, and PUT.']}, {'end': 2165.75, 'segs': [{'end': 1625.972, 'src': 'heatmap', 'start': 1510.033, 'weight': 0.872, 'content': [{'end': 1527.154, 'text': "so i'm going to do nest g service and let's say item items and All right now, if we look over on the side here we have an items.service.ts file.", 'start': 1510.033, 'duration': 17.121}, {'end': 1530.595, 'text': "And by default, it's just going to bring an injectable.", 'start': 1528.114, 'duration': 2.481}, {'end': 1538.537, 'text': 'What this does is it allows us to inject this as a dependency into a constructor.', 'start': 1531.295, 'duration': 7.242}, {'end': 1545.638, 'text': "All right, now inside this item service, we're going to have a bunch of functions that we're going to call from the controller.", 'start': 1539.357, 'duration': 6.281}, {'end': 1549.099, 'text': 'But before I do that, I also want to create a module.', 'start': 1546.218, 'duration': 2.881}, {'end': 1551.881, 'text': 'I want everything to be wrapped up in a module.', 'start': 1549.659, 'duration': 2.222}, {'end': 1559.829, 'text': "So inside the items folder, I'm going to create a new file called items dot module dot TS.", 'start': 1552.021, 'duration': 7.808}, {'end': 1566.014, 'text': 'And this is going to be set up very similar to the app dot module.', 'start': 1561.41, 'duration': 4.604}, {'end': 1568.537, 'text': "So I'm actually going to just copy that.", 'start': 1566.075, 'duration': 2.462}, {'end': 1575.917, 'text': "So we'll copy that and we'll go to our items module and paste that in.", 'start': 1570.834, 'duration': 5.083}, {'end': 1580.259, 'text': "Now, all we need is we don't need the app service or controller.", 'start': 1576.237, 'duration': 4.022}, {'end': 1590.325, 'text': 'We just need the items controller, which is going to be in the same folder and then the service, which is in the same folder.', 'start': 1580.379, 'duration': 9.946}, {'end': 1595.568, 'text': 'And we can get rid of this and get rid of this.', 'start': 1591.266, 'duration': 4.302}, {'end': 1597.049, 'text': "OK, and we'll call this.", 'start': 1595.588, 'duration': 1.461}, {'end': 1600.034, 'text': 'items module.', 'start': 1599.073, 'duration': 0.961}, {'end': 1602.816, 'text': 'So now everything is encapsulated in this module.', 'start': 1600.054, 'duration': 2.762}, {'end': 1607.058, 'text': 'So close that up.', 'start': 1604.997, 'duration': 2.061}, {'end': 1609.68, 'text': "Let's start on our service.", 'start': 1608.379, 'duration': 1.301}, {'end': 1617.806, 'text': "OK, so for our service, we're going to ultimately work with data from MongoDB.", 'start': 1609.7, 'duration': 8.106}, {'end': 1625.972, 'text': "But for now, I'm just going to have hard coded data just to kind of Get you guys to to understand how this works now.", 'start': 1617.866, 'duration': 8.106}], 'summary': 'Creating a nestjs module with an item service and module, encapsulating functions and dependencies, working with hard-coded data.', 'duration': 115.939, 'max_score': 1510.033, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41510033.jpg'}, {'end': 1566.014, 'src': 'embed', 'start': 1539.357, 'weight': 0, 'content': [{'end': 1545.638, 'text': "All right, now inside this item service, we're going to have a bunch of functions that we're going to call from the controller.", 'start': 1539.357, 'duration': 6.281}, {'end': 1549.099, 'text': 'But before I do that, I also want to create a module.', 'start': 1546.218, 'duration': 2.881}, {'end': 1551.881, 'text': 'I want everything to be wrapped up in a module.', 'start': 1549.659, 'duration': 2.222}, {'end': 1559.829, 'text': "So inside the items folder, I'm going to create a new file called items dot module dot TS.", 'start': 1552.021, 'duration': 7.808}, {'end': 1566.014, 'text': 'And this is going to be set up very similar to the app dot module.', 'start': 1561.41, 'duration': 4.604}], 'summary': 'Creating a module with functions for item service in typescript.', 'duration': 26.657, 'max_score': 1539.357, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41539357.jpg'}, {'end': 1674.41, 'src': 'embed', 'start': 1633.318, 'weight': 1, 'content': [{'end': 1638.162, 'text': "But we're going to use, use the interface within the service.", 'start': 1633.318, 'duration': 4.844}, {'end': 1653.842, 'text': "so let's create a new folder inside items And we're going to call this interfaces And inside this interfaces we're going to create a file.", 'start': 1638.162, 'duration': 15.68}, {'end': 1662.225, 'text': "Let's call this item.interface.ts.", 'start': 1656.363, 'duration': 5.862}, {'end': 1665.866, 'text': 'And this is just a TypeScript interface.', 'start': 1664.146, 'duration': 1.72}, {'end': 1668.708, 'text': "If you've worked with Angular, you've probably worked with these before.", 'start': 1665.926, 'duration': 2.782}, {'end': 1674.41, 'text': "We're going to say export interface item.", 'start': 1668.728, 'duration': 5.682}], 'summary': "Creating a typescript interface for an item within a new 'interfaces' folder.", 'duration': 41.092, 'max_score': 1633.318, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41633318.jpg'}, {'end': 1763.331, 'src': 'embed', 'start': 1733.366, 'weight': 2, 'content': [{'end': 1739.479, 'text': "So inside of our service here, like I said, I'm just going to deal with hard coded data for the moment.", 'start': 1733.366, 'duration': 6.113}, {'end': 1743.948, 'text': "So I'm going to say that this is a private property read only.", 'start': 1740.02, 'duration': 3.928}, {'end': 1751.066, 'text': 'Items call it items and the type is going to be the interface of item now.', 'start': 1745.304, 'duration': 5.762}, {'end': 1753.587, 'text': "It's an array, so I'm going to put brackets here.", 'start': 1751.146, 'duration': 2.441}, {'end': 1763.331, 'text': "Okay, we're going to set it to an array and let's say this first one We'll give it an ID.", 'start': 1753.587, 'duration': 9.744}], 'summary': "Setting private property 'items' as array of 'item' interface", 'duration': 29.965, 'max_score': 1733.366, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41733366.jpg'}, {'end': 1890.275, 'src': 'embed', 'start': 1857.958, 'weight': 3, 'content': [{'end': 1860.139, 'text': "Let's create find all.", 'start': 1857.958, 'duration': 2.181}, {'end': 1864.683, 'text': 'And what I want this to return is an item.', 'start': 1862.296, 'duration': 2.387}, {'end': 1866.549, 'text': 'We created the interface of item.', 'start': 1865.044, 'duration': 1.505}, {'end': 1867.21, 'text': 'We brought it in.', 'start': 1866.569, 'duration': 0.641}, {'end': 1870.319, 'text': "I'm going to say this find all has to return an item.", 'start': 1867.231, 'duration': 3.088}, {'end': 1874.57, 'text': "and I'm sorry, an array of items.", 'start': 1872.189, 'duration': 2.381}, {'end': 1879.131, 'text': "So I'm gonna return this.items.", 'start': 1875.17, 'duration': 3.961}, {'end': 1884.253, 'text': 'Okay, I can access this right here with this.items.', 'start': 1879.151, 'duration': 5.102}, {'end': 1890.275, 'text': "I can use this because we're inside of a class and this is a property of that class.", 'start': 1884.753, 'duration': 5.522}], 'summary': 'Create find all to return an array of items.', 'duration': 32.317, 'max_score': 1857.958, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41857958.jpg'}, {'end': 1946.681, 'src': 'embed', 'start': 1919.39, 'weight': 4, 'content': [{'end': 1923.652, 'text': 'i also want to bring in the interface or the item type.', 'start': 1919.39, 'duration': 4.262}, {'end': 1928.954, 'text': "so we'll bring in item from dot slash interfaces.", 'start': 1923.652, 'duration': 5.302}, {'end': 1930.635, 'text': 'slash item dot interface.', 'start': 1928.954, 'duration': 1.681}, {'end': 1937.793, 'text': 'Now, before I can actually use the service, I have to inject it as a dependency.', 'start': 1931.567, 'duration': 6.226}, {'end': 1941.596, 'text': 'And this works pretty much exactly like it does in Angular.', 'start': 1937.853, 'duration': 3.743}, {'end': 1946.681, 'text': "So within the class right here, I'm going to add a constructor.", 'start': 1942.177, 'duration': 4.504}], 'summary': 'Inject item interface as dependency for service.', 'duration': 27.291, 'max_score': 1919.39, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41919390.jpg'}, {'end': 2083.934, 'src': 'embed', 'start': 2054.327, 'weight': 5, 'content': [{'end': 2060.132, 'text': "We're not dealing with a database yet, so I'm going to go ahead and return this.items,", 'start': 2054.327, 'duration': 5.805}, {'end': 2067.661, 'text': "so I can access the items with this.items and I'm going to use find, which is a high-order array method.", 'start': 2060.132, 'duration': 7.529}, {'end': 2072.465, 'text': 'that takes in an arrow function.', 'start': 2068.261, 'duration': 4.204}, {'end': 2081.132, 'text': "So we'll say for each item, we want the one where the item.id is equal to the ID that's passed in.", 'start': 2072.585, 'duration': 8.547}, {'end': 2083.934, 'text': 'And this will get an ID passed in.', 'start': 2081.152, 'duration': 2.782}], 'summary': 'Using high-order array method find to access items by id.', 'duration': 29.607, 'max_score': 2054.327, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42054327.jpg'}], 'start': 1484.096, 'title': 'Creating nestjs service, module, and item interface', 'summary': 'Focuses on creating nestjs service and module for mongodb data, defining an interface with optional fields, and creating item interface, hard coding data, defining find all and find one functions, resulting in an array of items and a single item by id.', 'chapters': [{'end': 1700.583, 'start': 1484.096, 'title': 'Creating nestjs service and module', 'summary': 'Focuses on creating a nestjs service and module for handling data from mongodb, including generating a service, creating a module, and defining an interface for items with optional fields.', 'duration': 216.487, 'highlights': ["A new NestJS service for handling database operations is generated using 'nest g service' command.", 'A module is created to encapsulate the service and controller, similar to the app module.', "An interface 'item.interface.ts' is defined to specify the fields of an item, including optional ID, name, and description."]}, {'end': 2165.75, 'start': 1700.783, 'title': 'Creating item interface and services', 'summary': 'Explains how to create an item interface, hard code data, define a find all function, inject service as a dependency, and create a find one function to return items, resulting in an array of items, and a single item by id.', 'duration': 464.967, 'highlights': ["Creating a hard-coded array of items with defined properties like ID, name, and quantity. The speaker creates a hard-coded array of items with defined properties like ID, name, and quantity, setting the first item's quantity to 100 and the second item's quantity to 50.", "Defining a find all function to return an array of items. The speaker defines a find all function to return an array of items from the service, demonstrating the usage of 'this.items' and 'this.findAll' within the class.", 'Injecting the service as a dependency using a constructor. The speaker injects the service as a dependency using a constructor, allowing access to the service and its methods within the controller.', "Creating a find one function to return a single item by its ID. The speaker creates a find one function to return a single item by its ID, utilizing the 'find' method and passing the ID parameter to access the desired item."]}], 'duration': 681.654, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb41484096.jpg', 'highlights': ['A module is created to encapsulate the service and controller, similar to the app module.', "An interface 'item.interface.ts' is defined to specify the fields of an item, including optional ID, name, and description.", 'Creating a hard-coded array of items with defined properties like ID, name, and quantity.', 'Defining a find all function to return an array of items.', 'Injecting the service as a dependency using a constructor.', 'Creating a find one function to return a single item by its ID.']}, {'end': 3059.097, 'segs': [{'end': 2289.283, 'src': 'embed', 'start': 2251.644, 'weight': 0, 'content': [{'end': 2254.726, 'text': "I'm actually going to click on this next link right here, which is Mongo.", 'start': 2251.644, 'duration': 3.082}, {'end': 2258.348, 'text': 'OK, and this will basically tell us everything that we need to do.', 'start': 2255.366, 'duration': 2.982}, {'end': 2264.289, 'text': 'So we need to install NestJS slash Mongoose as well as Mongoose.', 'start': 2259.188, 'duration': 5.101}, {'end': 2266.91, 'text': "So let's go ahead and do that real quick.", 'start': 2264.75, 'duration': 2.16}, {'end': 2270.151, 'text': "So we'll do NPM install.", 'start': 2267.51, 'duration': 2.641}, {'end': 2276.753, 'text': "It's going to be at NestJS slash Mongoose and then Mongoose.", 'start': 2270.371, 'duration': 6.382}, {'end': 2289.283, 'text': 'And then once we get that installed, what we have to do is add the Mongoose module to the root application module.', 'start': 2280.141, 'duration': 9.142}], 'summary': 'Installing nestjs/mongoose and mongoose using npm for root application module.', 'duration': 37.639, 'max_score': 2251.644, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42251644.jpg'}, {'end': 2554.945, 'src': 'embed', 'start': 2527.377, 'weight': 5, 'content': [{'end': 2531.478, 'text': 'OK, so now you can see unable to connect to the database and it just keeps retrying.', 'start': 2527.377, 'duration': 4.101}, {'end': 2534.659, 'text': "So put that back and save and now we're all set.", 'start': 2532.058, 'duration': 2.601}, {'end': 2542.021, 'text': 'So you can see how easy it is to implement Mongoose and MongoDB, which is one of the reasons I really like this framework.', 'start': 2535.039, 'duration': 6.982}, {'end': 2547.342, 'text': "It's not so, you know, manual as it is with just regular express.", 'start': 2543.001, 'duration': 4.341}, {'end': 2551.223, 'text': 'All right, so we have our Mongoose module.', 'start': 2548.382, 'duration': 2.841}, {'end': 2554.945, 'text': 'We can close up app.module.ts.', 'start': 2552.204, 'duration': 2.741}], 'summary': 'Implementing mongoose and mongodb in the framework for easier database connection and management.', 'duration': 27.568, 'max_score': 2527.377, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42527377.jpg'}, {'end': 2690.321, 'src': 'embed', 'start': 2620.556, 'weight': 1, 'content': [{'end': 2630.736, 'text': "And then we're going to export, let's say const item schema, set it to new Mongoose dot schema.", 'start': 2620.556, 'duration': 10.18}, {'end': 2639.94, 'text': 'and pass in here an object with our field.', 'start': 2635.118, 'duration': 4.822}, {'end': 2654.387, 'text': 'So we want name should be string quantity number and description string.', 'start': 2640, 'duration': 14.387}, {'end': 2657.348, 'text': "So very simple schema and we'll save that.", 'start': 2654.427, 'duration': 2.921}, {'end': 2660.927, 'text': "All right, so we'll close that up.", 'start': 2659.605, 'duration': 1.322}, {'end': 2675.876, 'text': "Next thing we want to do, just to show you in the documentation, So inside our module, so our items module, we're going to want to do this.", 'start': 2661.868, 'duration': 14.008}, {'end': 2679.618, 'text': 'So bring in Mongoose module and add it to imports.', 'start': 2675.936, 'duration': 3.682}, {'end': 2686.16, 'text': 'And we just want to call this for feature method and pass in an array with the name and then the schema name.', 'start': 2680.098, 'duration': 6.062}, {'end': 2687.98, 'text': 'We also want to bring in the schema.', 'start': 2686.66, 'duration': 1.32}, {'end': 2690.321, 'text': "So let's go to our items module.", 'start': 2688.42, 'duration': 1.901}], 'summary': 'Creating a mongoose schema for item with name, quantity, and description fields, then importing it into the items module.', 'duration': 69.765, 'max_score': 2620.556, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42620556.jpg'}, {'end': 2823.967, 'src': 'embed', 'start': 2791.345, 'weight': 2, 'content': [{'end': 2800.631, 'text': 'yeah, so now in our service we can bring in um, our inject model model from mongoose,', 'start': 2791.345, 'duration': 9.286}, {'end': 2806.075, 'text': 'and then we can inject that as a dependency and we can then use mongoose.', 'start': 2800.631, 'duration': 5.444}, {'end': 2818.143, 'text': "so let's go back to our service and we can clear out, uh, this whole, just this hard-coded property right here, i can just completely get rid of that.", 'start': 2806.075, 'duration': 12.068}, {'end': 2823.967, 'text': "And then up here, let's bring in, let's say import.", 'start': 2819.423, 'duration': 4.544}], 'summary': 'Inject mongoose model as a dependency in service', 'duration': 32.622, 'max_score': 2791.345, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42791345.jpg'}, {'end': 2925.333, 'src': 'embed', 'start': 2893.045, 'weight': 3, 'content': [{'end': 2900.107, 'text': "OK, so within this find all here, we're going to call that we're going to call dot fine now.", 'start': 2893.045, 'duration': 7.062}, {'end': 2902.368, 'text': 'Mongoose returns a promise.', 'start': 2900.347, 'duration': 2.021}, {'end': 2906.052, 'text': 'And I want to use a sink await just to keep this neat.', 'start': 2903.229, 'duration': 2.823}, {'end': 2909.396, 'text': "So we're going to mark this as a sink.", 'start': 2906.853, 'duration': 2.543}, {'end': 2923.051, 'text': "And down here, instead of returning this dot items, which no longer exist, we're going to say return await this dot item model dot find.", 'start': 2910.497, 'duration': 12.554}, {'end': 2925.333, 'text': 'Okay, now this returns a promise.', 'start': 2923.672, 'duration': 1.661}], 'summary': 'Using mongoose to find and return items as a promise', 'duration': 32.288, 'max_score': 2893.045, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42893045.jpg'}], 'start': 2165.79, 'title': 'Using mongoose and mongodb in nestjs', 'summary': 'Covers implementing mongodb and mongoose in nestjs, including installing necessary modules, setting up uri string, and verifying the connection. it also explores setting up a mongoose schema and configuring it within a nestjs module, with details on defining schema fields, importing mongoose modules, and utilizing mongoose methods.', 'chapters': [{'end': 2551.223, 'start': 2165.79, 'title': 'Implementing mongoose and mongodb in nestjs', 'summary': 'Discusses implementing mongodb and mongoose in nestjs, including installing the necessary modules, setting up the uri string, and verifying the connection, emphasizing the ease of implementation and the benefits over regular express.', 'duration': 385.433, 'highlights': ['The chapter discusses implementing MongoDB and Mongoose in NestJS. Implementing MongoDB and Mongoose, using NestJS framework.', 'Installing the necessary modules, setting up the URI string, and verifying the connection. Installing NestJS/Mongoose and Mongoose, setting up URI string, verifying connection.', 'Emphasizing the ease of implementation and the benefits over regular express. Highlighting the ease of implementation and benefits over regular express.']}, {'end': 3059.097, 'start': 2552.204, 'title': 'Setting up mongoose schema and nestjs module', 'summary': 'Discusses setting up a mongoose schema and configuring it within a nestjs module, including defining schema fields, importing mongoose modules, configuring for feature method in items module, injecting models in the service, using mongoose methods like find and create, and marking methods as async.', 'duration': 506.893, 'highlights': ['Defining Mongoose schema fields for name, quantity, and description The schema includes fields for name, quantity, and description.', 'Configuring for feature method in items module Configuring the for feature method in the items module with the schema name and the imported item schema.', 'Injecting models in the service and using Mongoose methods like find and create Injecting models in the service, allowing the use of Mongoose methods like find, create, and find one.', 'Marking methods as async and using async/await for handling promises Marking methods as async and using async/await to handle promises for neat code execution.']}], 'duration': 893.307, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb42165790.jpg', 'highlights': ['Installing NestJS/Mongoose and Mongoose, setting up URI string, verifying connection.', 'The schema includes fields for name, quantity, and description.', 'Injecting models in the service, allowing the use of Mongoose methods like find, create, and find one.', 'Marking methods as async and using async/await to handle promises for neat code execution.', 'Implementing MongoDB and Mongoose, using NestJS framework.', 'Highlighting the ease of implementation and benefits over regular express.', 'Configuring the for feature method in the items module with the schema name and the imported item schema.']}, {'end': 3599.084, 'segs': [{'end': 3094.681, 'src': 'embed', 'start': 3059.137, 'weight': 0, 'content': [{'end': 3062.9, 'text': 'So now we want to do is work on being able to create a new item.', 'start': 3059.137, 'duration': 3.763}, {'end': 3065.562, 'text': "So let's go back.", 'start': 3063.84, 'duration': 1.722}, {'end': 3068.904, 'text': "Let's go to our service.", 'start': 3067.703, 'duration': 1.201}, {'end': 3075.487, 'text': "And we're going to want a method to create a new item in our database.", 'start': 3070.803, 'duration': 4.684}, {'end': 3081.611, 'text': "So let's go right here and let's say async create.", 'start': 3076.507, 'duration': 5.104}, {'end': 3086.635, 'text': 'This will take in an item with the type of item.', 'start': 3082.592, 'duration': 4.043}, {'end': 3094.681, 'text': "And we're going to return a promise of an item.", 'start': 3088.136, 'duration': 6.545}], 'summary': 'Developing a method to create a new item in the database.', 'duration': 35.544, 'max_score': 3059.137, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb43059137.jpg'}, {'end': 3145.847, 'src': 'embed', 'start': 3118.515, 'weight': 1, 'content': [{'end': 3126.96, 'text': "whatever that new item is, it's going to get saved and it's going to return along with the ID that's automatically added by MongoDB.", 'start': 3118.515, 'duration': 8.445}, {'end': 3132.822, 'text': "now we need to call this from the controller, so let's make sure we save this service,", 'start': 3127.72, 'duration': 5.102}, {'end': 3137.164, 'text': 'go back to the controller where we have our create and we need to.', 'start': 3132.822, 'duration': 4.342}, {'end': 3145.847, 'text': "we need to change this up a little bit, so we're still dealing with this with the data transfer object.", 'start': 3137.164, 'duration': 8.683}], 'summary': 'Item will be saved with mongodb id and called from the controller.', 'duration': 27.332, 'max_score': 3118.515, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb43118515.jpg'}, {'end': 3268.237, 'src': 'embed', 'start': 3239.391, 'weight': 2, 'content': [{'end': 3242.176, 'text': "So all those endpoints are working and we're getting the data.", 'start': 3239.391, 'duration': 2.785}, {'end': 3246.785, 'text': 'So all we have left really is the delete and the update.', 'start': 3242.797, 'duration': 3.988}, {'end': 3249.67, 'text': "So let's go back to our service.", 'start': 3247.667, 'duration': 2.003}, {'end': 3252.31, 'text': "And let's create those methods.", 'start': 3250.629, 'duration': 1.681}, {'end': 3255.631, 'text': "So in our service, we'll go under the create.", 'start': 3253.33, 'duration': 2.301}, {'end': 3259.933, 'text': "And let's do the delete first.", 'start': 3257.392, 'duration': 2.541}, {'end': 3261.054, 'text': "That's a little bit easier.", 'start': 3259.973, 'duration': 1.081}, {'end': 3264.075, 'text': "So we'll say async delete.", 'start': 3261.154, 'duration': 2.921}, {'end': 3268.237, 'text': "It's going to take in an ID, which is a string.", 'start': 3265.276, 'duration': 2.961}], 'summary': 'Endpoints are working, remaining tasks: delete and update methods for service.', 'duration': 28.846, 'max_score': 3239.391, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb43239391.jpg'}, {'end': 3545.337, 'src': 'embed', 'start': 3521.967, 'weight': 3, 'content': [{'end': 3530.656, 'text': "so it gives us the item back with the change quantity and if i go back to the get get request and send, you'll see that now item one has quantity 30..", 'start': 3521.967, 'duration': 8.689}, {'end': 3536.122, 'text': 'so we have a complete crud create, read, update and delete rest api.', 'start': 3530.656, 'duration': 5.466}, {'end': 3537.383, 'text': 'all right.', 'start': 3536.122, 'duration': 1.261}, {'end': 3538.724, 'text': "so that's it.", 'start': 3537.383, 'duration': 1.341}, {'end': 3541.347, 'text': "uh oh, we don't need this async in the controller.", 'start': 3538.724, 'duration': 2.623}, {'end': 3545.337, 'text': "I don't know why I thought that, but we shouldn't need that.", 'start': 3542.674, 'duration': 2.663}], 'summary': 'Developed complete crud rest api with item quantity update to 30.', 'duration': 23.37, 'max_score': 3521.967, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb43521967.jpg'}, {'end': 3597.382, 'src': 'heatmap', 'start': 3561.455, 'weight': 1, 'content': [{'end': 3564.137, 'text': "And it's all packaged up nice and neat.", 'start': 3561.455, 'duration': 2.682}, {'end': 3573.102, 'text': 'So, you know, do you need to use NestJS? No, you can just use Express and create your your endpoints and stuff like that.', 'start': 3564.237, 'duration': 8.865}, {'end': 3578.585, 'text': "But if you want something that's a little more organized, especially if you're using angular on the front end,", 'start': 3573.402, 'duration': 5.183}, {'end': 3583.048, 'text': 'you can see how similar it is in terms of how everything flows together.', 'start': 3578.585, 'duration': 4.463}, {'end': 3588.875, 'text': 'So I think that having a full stack application with Angular on the front end, NestJS on the back end,', 'start': 3583.41, 'duration': 5.465}, {'end': 3592.658, 'text': 'I think is a really good idea and very powerful.', 'start': 3588.875, 'duration': 3.783}, {'end': 3594.38, 'text': "So that's it, guys.", 'start': 3593.459, 'duration': 0.921}, {'end': 3596.101, 'text': 'Hopefully you like this crash course.', 'start': 3594.42, 'duration': 1.681}, {'end': 3597.382, 'text': 'If you did, please leave a like.', 'start': 3596.161, 'duration': 1.221}], 'summary': 'Nestjs complements express for more organized full stack apps with angular, offering a powerful combination.', 'duration': 35.927, 'max_score': 3561.455, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb43561455.jpg'}], 'start': 3059.137, 'title': 'Building rest api with crud operations', 'summary': 'Explains the process of building a rest api with crud operations, including creating, reading, updating, and deleting items. it demonstrates the functionality of each operation, such as adding items to the database, retrieving items, deleting items, and updating item quantities, providing a complete understanding of the crud functionalities and their implementation.', 'chapters': [{'end': 3180.344, 'start': 3059.137, 'title': 'Creating a new item in database', 'summary': 'Explains the process of creating a new item in the database, involving defining a method to create a new item and modifying the controller to call this method, resulting in the return of the new item with an automatically added id from mongodb.', 'duration': 121.207, 'highlights': ["A method 'create' is defined in the service to take in an item and return a promise of an item, where a new item is created and saved to the database, returning the new item along with the automatically added ID from MongoDB.", "The controller is modified to call the 'create' method from the service, passing in the data transfer object and returning the new item as a promise."]}, {'end': 3599.084, 'start': 3181.044, 'title': 'Building rest api with crud operations', 'summary': 'Covers the process of building a rest api with crud operations, including creating, reading, updating, and deleting items. it demonstrates the functionality of each operation, such as adding items to the database, retrieving items, deleting items, and updating item quantities, providing a complete understanding of the crud functionalities and their implementation.', 'duration': 418.04, 'highlights': ['The chapter covers the process of building a REST API with CRUD operations, including creating, reading, updating, and deleting items. REST API, CRUD operations', 'It demonstrates the functionality of each operation, such as adding items to the database, retrieving items, deleting items, and updating item quantities. Functionality of CRUD operations, adding, retrieving, deleting, updating items', 'It provides a complete understanding of the CRUD functionalities and their implementation. Complete understanding of CRUD functionalities']}], 'duration': 539.947, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/wqhNoDE6pb4/pics/wqhNoDE6pb43059137.jpg', 'highlights': ["A method 'create' is defined in the service to take in an item and return a promise of an item, where a new item is created and saved to the database, returning the new item along with the automatically added ID from MongoDB.", "The controller is modified to call the 'create' method from the service, passing in the data transfer object and returning the new item as a promise.", 'The chapter covers the process of building a REST API with CRUD operations, including creating, reading, updating, and deleting items. REST API, CRUD operations', 'It demonstrates the functionality of each operation, such as adding items to the database, retrieving items, deleting items, and updating item quantities. Functionality of CRUD operations, adding, retrieving, deleting, updating items', 'It provides a complete understanding of the CRUD functionalities and their implementation. Complete understanding of CRUD functionalities']}], 'highlights': ['The tutorial demonstrates building a REST API and using MongoDB Atlas for the database, with a connection string obtained from the created cluster.', "Nest.js provides a lot of structure on the back end, using TypeScript, services, dependency injection, modules, and controllers, similar to Angular's syntax and structure.", 'Nest.js is a progressive Node.js framework for building efficient, reliable, and scalable server-side applications.', "The CLI can be used to create a new project, demonstrated with the command 'nest new '.", 'The package.json file includes core framework dependencies like NestJS Common, NestJS Core, platform express, and dev dependencies such as types for Express Jest, NodeMon, and prettier.', "Creating controllers and services for items By generating a controller called items using the command 'nest G', a folder for items is created in the source folder, with a controller file that imports the controller from NestJS common, and uses decorators for metadata.", 'The chapter introduces basic NestJS concepts such as defining endpoints, handling different HTTP request methods Introduces basic concepts of defining endpoints and handling various HTTP request methods.', 'The chapter emphasizes the importance of setting up functionality with items in NestJS by creating endpoints and using decorators to retrieve all items from the endpoint.', "The chapter provides a detailed example of using decorators and the common 'get' module in NestJS to set up an endpoint for retrieving all items.", 'The chapter discusses setting up a NestJS controller, importing and using decorators like @Body, accessing request and response objects, and the structure of a controller for handling requests and sending responses, with a focus on the NestJS way of doing things.', 'The chapter also emphasizes the NestJS way of structuring a controller, where the ultimate goal is to call methods from a service to handle database-related operations.', 'Implementing GET method for retrieving items by ID The chapter demonstrates implementing a GET method to retrieve items by ID, allowing for dynamic parameter access and successful retrieval of specific item data using Postman.', 'Implementing DELETE method for removing items by ID The chapter illustrates the implementation of a DELETE method to remove items by ID, showcasing the successful deletion of a specific item using Postman.', 'Implementing PUT method for updating items by ID The chapter explains the implementation of a PUT method to update items by ID, enabling the modification of item data and successful update testing using Postman.', 'Utilizing decorators like @Param and @Body for dynamic parameter and data access The chapter emphasizes the use of decorators such as @Param and @Body to enable dynamic parameter and data access, contributing to the functionality and flexibility of the implemented API methods.', 'Utilizing Postman for testing API endpoints The chapter showcases the utilization of Postman for testing the API endpoints, allowing for the successful testing of implemented methods such as GET, DELETE, and PUT.', 'A module is created to encapsulate the service and controller, similar to the app module.', "An interface 'item.interface.ts' is defined to specify the fields of an item, including optional ID, name, and description.", 'Creating a hard-coded array of items with defined properties like ID, name, and quantity.', 'Defining a find all function to return an array of items.', 'Injecting the service as a dependency using a constructor.', 'Creating a find one function to return a single item by its ID.', 'Installing NestJS/Mongoose and Mongoose, setting up URI string, verifying connection.', 'The schema includes fields for name, quantity, and description.', 'Injecting models in the service, allowing the use of Mongoose methods like find, create, and find one.', 'Marking methods as async and using async/await to handle promises for neat code execution.', 'Implementing MongoDB and Mongoose, using NestJS framework.', 'Highlighting the ease of implementation and benefits over regular express.', 'Configuring the for feature method in the items module with the schema name and the imported item schema.', "A method 'create' is defined in the service to take in an item and return a promise of an item, where a new item is created and saved to the database, returning the new item along with the automatically added ID from MongoDB.", "The controller is modified to call the 'create' method from the service, passing in the data transfer object and returning the new item as a promise.", 'The chapter covers the process of building a REST API with CRUD operations, including creating, reading, updating, and deleting items. REST API, CRUD operations', 'It demonstrates the functionality of each operation, such as adding items to the database, retrieving items, deleting items, and updating item quantities. Functionality of CRUD operations, adding, retrieving, deleting, updating items', 'It provides a complete understanding of the CRUD functionalities and their implementation. Complete understanding of CRUD functionalities']}