Skip to main content
CourseFlix

NestJs - Build Modern APIs in NestJs with Unit Testing

9h 19m 27s
English
Paid

You will learn how to build clear and safe APIs with NestJS.You will also learn how to write unit tests that help you trust your code.

What You Learn

NestJS is a Node.js framework that helps you build server apps with clean structure. You use TypeScript, so you catch errors early and keep code easy to read.

You work with common NestJS features such as controllers, services, and modules. You also learn how to write tests that check each part of your app.

Why Use NestJS

NestJS gives you tools for routing, database access, and testing. You can connect to SQL or NoSQL databases with simple code. The framework guides you toward clear and strong design.

Apps built with NestJS are easy to test and maintain. The code stays organized because parts of the app do not depend too much on each other.

How This Course Helps You

You build the API step by step. You write tests as you go. This helps you understand how each piece works and why it matters.

By the end, you know how to build and test real APIs with NestJS and TypeScript.

About the Author: Udemy

Udemy thumbnail

Udemy is the largest open marketplace for online courses on the internet. Founded in 2010 by Eren Bali, Oktay Caglar, and Gagan Biyani and headquartered in San Francisco, the company went public on the Nasdaq in 2021 under the ticker UDMY. The platform hosts well over two hundred thousand courses across software development, IT and cloud, data science, design, business, marketing, and creative skills, taught by tens of thousands of independent instructors. Roughly seventy million learners use it worldwide, and the corporate arm — Udemy Business — supplies a curated subset of that catalog to enterprise customers.

Because Udemy is a marketplace rather than a single editorial publisher, the catalog is uneven by design. The strongest material lives in the long-form, project-based courses authored by working engineers — full-stack JavaScript, React, Node.js, Python data science, AWS, Docker and Kubernetes, mobile development with Flutter and React Native, and cloud certification preparation. The CourseFlix listing under this source is the slice of that catalog that has been mirrored here for offline-friendly viewing, organized by topic and updated as new releases land. Pricing on Udemy itself swings dramatically with the site's near-permanent sales, which is why the platform is best treated as a deep reference catalog: pick instructors with strong reviews and a track record of updating their material rather than buying on the headline price alone.

Watch Online 100 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 100 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Introduction to the Course
All Course Lessons (100)
#Lesson TitleDurationAccess
1
Introduction to the Course Demo
01:33
2
DEMO of API
05:47
3
What is Nest.js & Why we need it?
02:51
4
How to Follow the Course & Code?
01:55
5
Installing all required tools
02:54
6
Install MongoDB on MacOS
02:00
7
Install MongoDB on Windows
04:26
8
Installing Nest CLI & Creating app
03:15
9
Understanding the folder structure
03:07
10
Nest.js Modules
04:45
11
Nest.js Controllers
03:43
12
Nest.js Service & Providers
05:33
13
Connecting to MongoDB with mongoose
10:08
14
Creating Restaurant Schema
08:23
15
Get all Restaurants
11:10
16
Create a new Restaurant
06:23
17
What is DTO?
02:24
18
Creating a Restaurant DTO
02:33
19
Get Restaurant by ID
06:53
20
Update Restaurant by ID
08:10
21
Delete Restaurant
04:48
22
Adding Search
06:55
23
Adding Pagination
05:10
24
What are Pipes?
03:30
25
Using Validation Pipe Globally
10:37
26
Adding Validation Rules in Update DTO
03:35
27
Invalid Mongoose ID Error
03:00
28
What is GeoCoder
03:04
29
Generating Coordinates & Address
10:24
30
Saving Location in Restaurants
05:48
31
Create Bucket on S3
07:54
32
Getting files through File Intercepter
06:51
33
Uploading images to S3
11:56
34
Saving Images in Restaurant
03:16
35
Delete Restaurant Images
09:51
36
Generating Auth Module
02:55
37
Creating User Schema
05:54
38
Sign up DTO with Validators
02:24
39
User Sign up
06:41
40
Hash user password while Sign up
03:32
41
Handle Duplicate Email Error
02:46
42
Login User
07:36
43
Setting Up JWT & Passport
06:04
44
Sign JWT token on Login
05:49
45
Setting Up JWT Strategy
08:23
46
Using AuthGuard to Protect Routes
04:44
47
Current User Decorator
04:55
48
Saving Current User in Restaurant
05:53
49
Creating User Roles Guard
08:19
50
Roles Decorator
03:50
51
Authorize Restaurant Ownership
05:16
52
Creating Meal Model
05:54
53
Create Meal DTO
06:11
54
Creating a Meal
14:49
55
Getting all Meals
05:25
56
Get Meal by ID
03:52
57
Update Meal
06:58
58
Delete Meal
05:55
59
Create Library Project
04:26
60
Install & Setup Postgres & pgAdmin
03:37
61
Connecting to Postgres Database
04:09
62
Create Book Entity
03:14
63
Create new Book
08:12
64
Get all Books & Book by ID
03:59
65
Update Book
04:10
66
Delete Book
02:25
67
Relations & Types of relations
02:42
68
Create User Entity
05:34
69
Adding Books & User Relation (OneToMany & ManyToOne)
06:49
70
What is Unit Testing?
02:48
71
Write first unit test in Restaurant Service
08:40
72
Testing RestaurantsService - findAll
10:23
73
Testing RestaurantsService - create
09:49
74
Testing RestaurantsService - findById
08:44
75
Testing RestaurantsService - updateById
04:47
76
Testing RestaurantsService - deleteById
02:34
77
Testing RestaurantsService - uploadImages
05:50
78
Testing RestaurantsService - deleteImages
02:47
79
First unit test in Restaurant Controller
06:51
80
Testing RestaurantController - getAllRestaurants
03:43
81
Testing RestaurantController - createRestaurant
03:42
82
Testing RestaurantController - getRestaurantById
03:06
83
Testing RestaurantController - updateRestaurant
09:15
84
Testing RestaurantController - deleteRestaurant
07:24
85
Testing RestaurantController - uploadFiles
03:53
86
Testing Auth Service
05:54
87
Testing AuthService - signUp
09:27
88
Testing AuthService - login
08:49
89
Testing Auth Controller
04:09
90
Testing AuthController - signUp
03:05
91
Testing AuthController - login
02:21
92
Testing JwtStrategy
11:28
93
What is e2e Testing
04:20
94
Testing Authentication Routes
10:48
95
Testing Restaurants POST protected Routes
06:08
96
Testing Restaurants GET Routes
04:10
97
Testing Restaurants PUT & DELETE Routes
02:28
98
Preparing API for Deploy
07:27
99
Deploy API on Heroku
05:57
100
Congratulations!!!
00:46
Unlock unlimited learning

Get instant access to all 99 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Course content

100 lessons · 9h 19m 27s
Show all 100 lessons
  1. 1 Introduction to the Course 01:33
  2. 2 DEMO of API 05:47
  3. 3 What is Nest.js & Why we need it? 02:51
  4. 4 How to Follow the Course & Code? 01:55
  5. 5 Installing all required tools 02:54
  6. 6 Install MongoDB on MacOS 02:00
  7. 7 Install MongoDB on Windows 04:26
  8. 8 Installing Nest CLI & Creating app 03:15
  9. 9 Understanding the folder structure 03:07
  10. 10 Nest.js Modules 04:45
  11. 11 Nest.js Controllers 03:43
  12. 12 Nest.js Service & Providers 05:33
  13. 13 Connecting to MongoDB with mongoose 10:08
  14. 14 Creating Restaurant Schema 08:23
  15. 15 Get all Restaurants 11:10
  16. 16 Create a new Restaurant 06:23
  17. 17 What is DTO? 02:24
  18. 18 Creating a Restaurant DTO 02:33
  19. 19 Get Restaurant by ID 06:53
  20. 20 Update Restaurant by ID 08:10
  21. 21 Delete Restaurant 04:48
  22. 22 Adding Search 06:55
  23. 23 Adding Pagination 05:10
  24. 24 What are Pipes? 03:30
  25. 25 Using Validation Pipe Globally 10:37
  26. 26 Adding Validation Rules in Update DTO 03:35
  27. 27 Invalid Mongoose ID Error 03:00
  28. 28 What is GeoCoder 03:04
  29. 29 Generating Coordinates & Address 10:24
  30. 30 Saving Location in Restaurants 05:48
  31. 31 Create Bucket on S3 07:54
  32. 32 Getting files through File Intercepter 06:51
  33. 33 Uploading images to S3 11:56
  34. 34 Saving Images in Restaurant 03:16
  35. 35 Delete Restaurant Images 09:51
  36. 36 Generating Auth Module 02:55
  37. 37 Creating User Schema 05:54
  38. 38 Sign up DTO with Validators 02:24
  39. 39 User Sign up 06:41
  40. 40 Hash user password while Sign up 03:32
  41. 41 Handle Duplicate Email Error 02:46
  42. 42 Login User 07:36
  43. 43 Setting Up JWT & Passport 06:04
  44. 44 Sign JWT token on Login 05:49
  45. 45 Setting Up JWT Strategy 08:23
  46. 46 Using AuthGuard to Protect Routes 04:44
  47. 47 Current User Decorator 04:55
  48. 48 Saving Current User in Restaurant 05:53
  49. 49 Creating User Roles Guard 08:19
  50. 50 Roles Decorator 03:50
  51. 51 Authorize Restaurant Ownership 05:16
  52. 52 Creating Meal Model 05:54
  53. 53 Create Meal DTO 06:11
  54. 54 Creating a Meal 14:49
  55. 55 Getting all Meals 05:25
  56. 56 Get Meal by ID 03:52
  57. 57 Update Meal 06:58
  58. 58 Delete Meal 05:55
  59. 59 Create Library Project 04:26
  60. 60 Install & Setup Postgres & pgAdmin 03:37
  61. 61 Connecting to Postgres Database 04:09
  62. 62 Create Book Entity 03:14
  63. 63 Create new Book 08:12
  64. 64 Get all Books & Book by ID 03:59
  65. 65 Update Book 04:10
  66. 66 Delete Book 02:25
  67. 67 Relations & Types of relations 02:42
  68. 68 Create User Entity 05:34
  69. 69 Adding Books & User Relation (OneToMany & ManyToOne) 06:49
  70. 70 What is Unit Testing? 02:48
  71. 71 Write first unit test in Restaurant Service 08:40
  72. 72 Testing RestaurantsService - findAll 10:23
  73. 73 Testing RestaurantsService - create 09:49
  74. 74 Testing RestaurantsService - findById 08:44
  75. 75 Testing RestaurantsService - updateById 04:47
  76. 76 Testing RestaurantsService - deleteById 02:34
  77. 77 Testing RestaurantsService - uploadImages 05:50
  78. 78 Testing RestaurantsService - deleteImages 02:47
  79. 79 First unit test in Restaurant Controller 06:51
  80. 80 Testing RestaurantController - getAllRestaurants 03:43
  81. 81 Testing RestaurantController - createRestaurant 03:42
  82. 82 Testing RestaurantController - getRestaurantById 03:06
  83. 83 Testing RestaurantController - updateRestaurant 09:15
  84. 84 Testing RestaurantController - deleteRestaurant 07:24
  85. 85 Testing RestaurantController - uploadFiles 03:53
  86. 86 Testing Auth Service 05:54
  87. 87 Testing AuthService - signUp 09:27
  88. 88 Testing AuthService - login 08:49
  89. 89 Testing Auth Controller 04:09
  90. 90 Testing AuthController - signUp 03:05
  91. 91 Testing AuthController - login 02:21
  92. 92 Testing JwtStrategy 11:28
  93. 93 What is e2e Testing 04:20
  94. 94 Testing Authentication Routes 10:48
  95. 95 Testing Restaurants POST protected Routes 06:08
  96. 96 Testing Restaurants GET Routes 04:10
  97. 97 Testing Restaurants PUT & DELETE Routes 02:28
  98. 98 Preparing API for Deploy 07:27
  99. 99 Deploy API on Heroku 05:57
  100. 100 Congratulations!!! 00:46

Related courses

Frequently asked questions

What is NestJs - Build Modern APIs in NestJs with Unit Testing about?
You will learn how to build clear and safe APIs with NestJS. You will also learn how to write unit tests that help you trust your code. What You Learn NestJS is a Node.js framework that helps you build server apps with clean structure. You…
Who teaches NestJs - Build Modern APIs in NestJs with Unit Testing?
NestJs - Build Modern APIs in NestJs with Unit Testing is taught by Udemy. You can find more courses by this instructor on the corresponding source page.
How long is NestJs - Build Modern APIs in NestJs with Unit Testing?
NestJs - Build Modern APIs in NestJs with Unit Testing contains 100 lessons with a total runtime of 9 hours 19 minutes. All lessons are available to watch online at your own pace.
Is NestJs - Build Modern APIs in NestJs with Unit Testing free to watch?
NestJs - Build Modern APIs in NestJs with Unit Testing is part of CourseFlix's premium catalog. A CourseFlix subscription unlocks the full video player; the course description, table of contents, and preview information are available to everyone.
Where can I watch NestJs - Build Modern APIs in NestJs with Unit Testing online?
NestJs - Build Modern APIs in NestJs with Unit Testing is available to watch online on CourseFlix at https://courseflix.net/course/nestjs-build-modern-apis-in-nestjs-with-unit-testing. The page hosts every lesson with the integrated video player; no download is required.