NodeJS – The Complete Guide (MVC, REST APIs, GraphQL, Deno)

NodeJS – The Complete Guide (MVC, REST APIs, GraphQL, Deno)

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 543 lectures (40h 31m) | 18.81 GB

Master Node JS & Deno.js, build REST APIs with Node.js, GraphQL APIs, add Authentication, use MongoDB, SQL & much more!

This course was updated to also include sections on Deno.js – in addition to more than 30 hours of content on Node.js!

Node.js is probably THE most popular and modern server-side programming language you can dive into these days!

Node.js developers are in high demand and the language is used for everything from traditional web apps with server-side rendered views over REST APIs all the way up to GraphQL APIs and real-time web services. Not to mention its applications in build workflows for projects of all sizes.

This course will teach you all of that! From scratch with zero prior knowledge assumed. Though if you do bring some knowledge, you’ll of course be able to quickly jump into the course modules that are most interesting to you.

Here’s what you’ll learn in this course:

  • Node.js Basics & Basic Core Modules
  • Parsing Requests & Sending Responses
  • Rendering HTML Dynamically (on the Server)
  • Using Express.js
  • Working with Files and generating PDFs on the Server (on-the-fly)
  • File Up- and Download
  • Using the Model-View-Controller (MVC) Pattern
  • Using Node.js with SQL (MySQL) and Sequelize
  • Using Node.js with NoSQL (MongoDB) and Mongoose
  • Working with Sessions & Cookies
  • User Authentication and Authorization
  • Sending E-Mails
  • Validating User Input
  • Data Pagination
  • Handling Payments with Stripe.js
  • Building REST APIs
  • Authentication in REST APIs
  • File Upload in REST APIs
  • Building GraphQL APIs
  • Authentication in GraphQL APIs
  • File Upload in GraphQL APIs
  • Building a Realtime Node.js App with Websockets
  • Automated Testing (Unit Tests)
  • Deploying a Node.js Application
  • Using TypeScript with Node.js
  • Exploring Deno.js
  • And Way More!

Does this look like a lot of content? It certainly is!

This is not a short course but it is the “Complete Guide” on Node.js after all. We’ll dive into a lot of topics and we’ll not just scratch the surface.

We’ll also not just walk through boring theory and some slides. Instead, we’ll build two major projects: An online shop (including checkout + payments) and a blog.

All topics and features of the course will be shown and used in these projects and you’ll therefore learn about them in a realistic environment.

What you’ll learn

  • Work with one of the most in-demand web development programming languages
    Learn the basics as well as advanced concepts of NodeJS in great detail
  • Build modern, fast and scalable server-side web applications with NodeJS, databases like SQL or MongoDB and more
  • Understand the NodeJS ecosystem and build server-side rendered apps, REST APIs and GraphQL APIs
  • Get a thorough introduction to DenoJS
Table of Contents

Introduction
1 Introduction
2 What is Node.js_
3 Join our Online Learning Community
4 Installing Node.js and Creating our First App
5 Understanding the Role & Usage of Node.js
6 Course Outline
7 How To Get The Most Out Of The Course
8 Working with the REPL vs Using Files
9 Using the Attached Source Code

Optional_ JavaScript – A Quick Refresher
10 Module Introduction
11 JavaScript in a Nutshell
12 Refreshing the Core Syntax
13 let & const
14 Understanding Arrow Functions
15 Working with Objects, Properties & Methods
16 Arrays & Array Methods
17 Arrays, Objects & Reference Types
18 Understanding Spread & Rest Operators
19 Destructuring
20 Async Code & Promises
21 Template Literals
22 Wrap Up
23 Useful Resources & Links

Understanding the Basics
24 Module Introduction
25 How The Web Works
26 Creating a Node Server
27 The Node Lifecycle & Event Loop
28 Controlling the Node.js Process
29 Understanding Requests
30 Sending Responses
31 Request & Response Headers
32 Routing Requests
33 Redirecting Requests
34 Parsing Request Bodies
35 Understanding Event Driven Code Execution
36 Blocking and Non-Blocking Code
37 Node.js – Looking Behind the Scenes
38 Using the Node Modules System
39 Wrap Up
40 Useful Resources & Links

Improved Development Workflow and Debugging
41 Module Introduction
42 Understanding NPM Scripts
43 Installing 3rd Party Packages
44 Global Features vs Core Modules vs Third-Party Modules
45 Using Nodemon for Autorestarts
46 Global & Local npm Packages
47 Understanding different Error Types
48 Finding & Fixing Syntax Errors
49 Dealing with Runtime Errors
50 Logical Errors
51 Using the Debugger
52 Restarting the Debugger Automatically After Editing our App
53 Debugging Node.js in Visual Studio Code
54 Changing Variables in the Debug Console
55 Wrap Up
56 Useful Resources & Links

Working with Express.js
57 Module Introduction
58 What is Express.js_
59 Installing Express.js
60 Adding Middleware
61 How Middleware Works
62 Express.js – Looking Behind the Scenes
63 Handling Different Routes
64 Parsing Incoming Requests
65 Limiting Middleware Execution to POST Requests
66 Using Express Router
67 Adding a 404 Error Page
68 Filtering Paths
69 Creating HTML Pages
70 Serving HTML Pages
71 Returning a 404 Page
72 Using a Helper Function for Navigation
73 Styling our Pages
74 Serving Files Statically
75 Wrap Up
76 Useful Resources & Links
77 add-product
78 shop

Working with Dynamic Content & Adding Templating Engines
79 Module Introduction
80 Sharing Data Across Requests & Users
81 Templating Engines – An Overview
82 Installing & Implementing Pug
83 Outputting Dynamic Content
84 Official Pug Docs
85 Converting HTML Files to Pug
86 Adding a Layout
87 Finishing the Pug Template
88 Avoiding an Error
89 Working with Handlebars
90 Converting our Project to Handlebars
91 Adding the Layout to Handlebars
92 Working with EJS
93 Working on the Layout with Partials
94 Wrap Up
95 [OPTIONAL] Assignment Solution
96 Useful Resources & Links

The Model View Controller (MVC)
97 Module Introduction
98 What is the MVC_
99 Adding Controllers
100 Finishing the Controllers
101 Adding a Product Model
102 Storing Data in Files Via the Model
103 Fetching Data from Files Via the Model
104 Refactoring the File Storage Code
105 Wrap Up
106 Useful Resources & Links

Optional_ Enhancing the App
107 Module Introduction
108 Creating the Shop Structure
109 Working on the Navigation
110 Registering the Routes
111 Storing Product Data
112 Displaying Product Data
113 Editing & Deleting Products
114 Adding Another Item
115 Useful Resources & Links

Dynamic Routes & Advanced Models
116 Module Introduction
117 Preparations
118 Applied Changes
119 Adding the Product ID to the Path
120 Extracting Dynamic Params
121 Loading Product Detail Data
122 Rendering the Product Detail View
123 Passing Data with POST Requests
124 Adding a Cart Model
125 Using Query Params
126 Pre-Populating the Edit Product Page with Data
127 Linking to the Edit Page
128 Editing the Product Data
129 Adding the Product-Delete Functionality
130 Deleting Cart Items
131 Displaying Cart Items on the Cart Page
132 Deleting Cart Items
133 Fixing a Delete Product Bug
134 Wrap Up
135 Useful Resources & Links

SQL Introduction
136 Module Introduction
137 Choosing a Database
138 NoSQL Introduction
139 Comparing SQL and NoSQL
140 Setting Up MySQL
141 Connecting our App to the SQL Database
142 Basic SQL & Creating a Table
143 Retrieving Data
144 Fetching Products
145 Fetching Products – Time to Practice
146 Inserting Data Into the Database
147 Fetching a Single Product with the _where_ Condition
148 Wrap Up
149 Useful Resources & Links

Understanding Sequelize
150 Module Introduction
151 What is Sequelize_
152 Connecting to the Database
153 Defining a Model
154 Syncing JS Definitions to the Database
155 Inserting Data & Creating a Product
156 MUST READ_ findById() in Sequelize 5
157 Retrieving Data & Finding Products
158 Getting a Single Product with the _where_ Condition
159 Fetching Admin Products
160 Updating Products
161 Deleting Products
162 Creating a User Model
163 Adding a One-To-Many Relationship
164 Creating & Managing a Dummy User
165 Using Magic Association Methods
166 Fetching Related Products
167 One-To-Many & Many-To-Many Relations
168 Creating & Fetching a Cart
169 Adding New Products to the Cart
170 Adding Existing Products & Retrieving Cart Items
171 Deleting Related Items & Deleting Cart Products
172 Adding an Order Model
173 Storing Cartitems as Orderitems
174 Resetting the Cart & Fetching and Outputting Orders
175 Wrap Up
176 Useful Resources & Links

Working with NoSQL & Using MongoDB
177 Module Introduction
178 What is MongoDB_
179 Relations in NoSQL
180 Setting Up MongoDB
181 Installing the MongoDB Driver
182 Creating the Database Connection
183 Finishing the Database Connection
184 Using the Database Connection
185 Creating Products
186 Understanding the MongoDB Compass
187 Fetching All Products
188 Fetching a Single Product
189 Making the _Edit_ & _Delete_ Buttons Work Again
190 Working on the Product Model to Edit our Product
191 Finishing the _Update Product_ Code
192 One Note About Updating Products
193 Deleting Products
194 Fixing the _Add Product_ Functionality
195 Creating New Users
196 Storing the User in our Database
197 Working on Cart Items & Orders
198 Adding the _Add to Cart_ Functionality
199 Storing Multiple Products in the Cart
200 Displaying the Cart Items
201 Fixing a Bug
202 Deleting Cart Items
203 Adding an Order
204 Adding Relational Order Data
205 Getting Orders
206 Removing Deleted Items From the Cart
207 Wrap Up
208 Useful Resources & Links
209 Two Adjustments (behind the scenes)

Working with Mongoose
210 Module Introduction
211 What is Mongoose_
212 Connecting to the MongoDB Server with Mongoose
213 Creating the Product Schema
214 Saving Data Through Mongoose
215 Fetching All Products
216 Fetching a Single Product
217 Updating Products
218 Deleting Products
219 Adding and Using a User Model
220 Using Relations in Mongoose
221 One Important Thing About Fetching Relations
222 Working on the Shopping Cart
223 Loading the Cart
224 Deleting Cart Items
225 Creating & Getting Orders
226 Storing All Order Related Data
227 Clearing the Cart After Storing an Order
228 Getting & Displaying the Orders
229 Wrap Up
230 Useful Resources & Links

Sessions & Cookies
231 Module Introduction
232 What is a Cookie_
233 The Current Project Status
234 Optional_ Creating the Login Form
235 Adding the Request Driven Login Solution
236 Setting a Cookie
237 Manipulating Cookies
238 Configuring Cookies
239 What is a Session_
240 Initializing the Session Middleware
241 Using the Session Middleware
242 Using MongoDB to Store Sessions
243 Sessions & Cookies – A Short Summary
244 Deleting a Cookie
245 Fixing Some Minor Bugs
246 Making _Add to Cart_ Work Again
247 Two Tiny Improvements
248 Wrap Up
249 Code Adjustments
250 Useful Resources & Links

Adding Authentication
251 Module Introduction
252 What is Authentication_
253 How is Authentication Implemented_
254 Our Updated Project Status
255 Implementing an Authentication Flow
256 Encrypting Passwords
257 Adding a Tiny Code Improvement
258 Adding the Signin Functionality
259 Working on Route Protection
260 Using Middleware to Protect Routes
261 Understanding CSRF Attacks
262 Using a CSRF Token
263 Adding CSRF Protection
264 Fixing the Order Button
265 Providing User Feedback
266 Optional_ Styling Error Messages
267 Finishing the Flash Messages
268 Adding Additional Flash Messages
269 Wrap Up
270 Useful Resources & Links

Sending Emails
271 Module Introduction
272 How Does Sending Emails Work_
273 Using SendGrid
274 Using Nodemailer to Send an Email
275 Potential Limitation for Large Scale Apps
276 Useful Resources & Links

Advanced Authentication
277 Module Introduction
278 Resetting Passwords
279 Implementing the Token Logic
280 Creating the Token
281 Creating the Reset Password Form
282 Adding Logic to Update the Password
283 Why we Need Authorization
284 Adding Authorization
285 Adding Protection to Post Actions
286 Why Editing Fails
287 Wrap Up
288 Useful Resources & Links

Understanding Validation
289 Module Introduction
290 Why Should We Use Validation_
291 How to Validate Input_
292 Setup & Basic Validation
293 Using Validation Error Messages
294 Built-In & Custom Validators
295 More Validators
296 Checking For Field Equality
297 Adding Async Validation
298 Keeping User Input
299 Adding Conditional CSS Classes
300 Adding Validation to Login
301 Sanitizing Data
302 Validating Product Addition
303 Validating Product Editing
304 Wrap Up
305 Useful Resources & Links

Error Handling
306 Module Introduction
307 Types of Errors & Error Handling
308 Analyzing the Error Handling in the Current Project
309 Errors – Some Theory
310 Throwing Errors in Code
311 Returning Error Pages
312 Using the Express.js Error Handling Middleware
313 Updating the App
314 Using the Error Handling Middleware Correctly
315 Status Codes
316 Available Status Codes
317 Wrap Up
318 Useful Resources & Links

File Upload & Download
319 Module Introduction
320 Adding a File Picker to the Frontend
321 Handling Multipart Form Data
322 Handling File Uploads with Multer
323 Configuring Multer to Adjust Filename & Filepath
324 Filtering Files by Mimetype
325 Storing File Data in the Database
326 Remove imageUrl from _Add Product_
327 Serving Images Statically
328 Downloading Files with Authentication
329 Setting File Type Headers
330 Restricting File Access
331 Streaming Data vs Preloading Data
332 Using PDFKit for .pdf Generation
333 Generating .pdf Files with Order Data
334 Deleting Files
335 Fixing Invoice Links
336 Wrap Up
337 Useful Resources & Links

Adding Pagination
338 Module Introduction
339 Adding Pagination Links
340 Retrieving a Chunk of Data
341 Skip & Limit with SQL
342 Preparing Pagination Data on the Server
343 Adding Dynamic Pagination Buttons
344 Re-Using the Pagination Logic & Controls
345 Wrap Up
346 Useful Resources & Links

Understanding Async Requests
347 Module Introduction
348 What are Async Requests_
349 Adding Client Side JS Code
350 The JSON Data Format
351 Sending & Handling Background Requests
352 Manipulating the DOM
353 Useful Resources & Links

Adding Payments
354 Module Introduction
355 How Payments Work
356 Adding a Checkout Page
357 Using Stripe in Your App
358 Useful Resources & Links

Working with REST APIs – The Basics
359 Module Introduction
360 What are REST APIs and why do we use Them_
361 Accessing Data with REST APIs
362 Understanding Routing & HTTP Methods
363 REST APIs – The Core Principles
364 Creating our REST API Project & Implementing the Route Setup
365 Sending Requests & Responses and Working with Postman
366 REST APIs, Clients & CORS Errors
367 Sending POST Requests
368 Wrap Up
369 Useful Resources & Links

Working with REST APIs – The Practical Application
370 Module Introduction
371 REST APIs & The Rest Of The Course
372 Understanding the Frontend Setup
373 Planning the API
374 Fetching Lists of Posts
375 Adding a Create Post Endpoint
376 Adding Server Side Validation
377 Setting Up a Post Model
378 Storing Posts in the Database
379 Static Images & Error Handling
380 Fetching a Single Post
381 Image Names & Windows
382 Uploading Images
383 Updating Posts
384 Deleting Posts
385 Adding Pagination
386 Adding a User Model
387 Adding User Signup Validation
388 Signing Users Up
389 How Does Authentication Work_
390 Starting with User Login
391 Logging In & Creating JSON Web Tokens (JWTs)
392 Using & Validating the Token
393 Adding Auth Middleware to All Routes
394 Connecting Posts & Users
395 Adding Authorization Checks
396 Clearing Post-User Relations
397 Wrap Up
398 Useful Resources & Links

Understanding Async Await in Node.js
399 Module Introduction
400 What is Async Await All About_
401 Transforming _Then Catch_ to _Async Await_
402 Top-level _await_
403 The User Name is Missing!
404 Wrap Up
405 Useful Resources & Links

Understanding Websockets & Socket.io
406 Module Introduction
407 What Are Websockets & Why Would You Use Them_
408 Websocket Solutions – An Overview
409 Setting Up Socket.io on the Server
410 Establishing a Connection From the Client
411 Identifying Realtime Potential
412 Sharing the IO Instance Across Files
413 Synchronizing POST Additions
414 Fixing a Bug – The Missing Username
415 Updating Posts On All Connected Clients
416 Sorting Correctly
417 Deleting Posts Across Clients
418 Wrap Up
419 Useful Resources & Links

Working with GraphQL
420 Module Introduction
421 What is GraphQL_
422 Understanding the Setup & Writing our First Query
423 Defining a Mutation Schema
424 Adding a Mutation Resolver & GraphiQL
425 Adding Input Validation
426 Handling Errors
427 Connecting the Frontend to the GraphQL API
428 Adding a Login Query & a Resolver
429 Adding Login Functionality
430 Adding a Create Post Mutation
431 Extracting User Data From the Auth Token
432 Sending the _Create Post_ Query
433 Fixing a Bug & Adding New Posts Correctly
434 Adding a _Get Post_ Query & Resolver
435 Sending _Create Post_ and _Get Post_ Queries
436 Adding Pagination
437 Uploading Images
438 Fetching the imageUrl
439 Viewing a Single Post
440 Updating Posts
441 Deleting Posts
442 Adding Posts & Pagination
443 Managing the User Status
444 Using Variables
445 Fixing a Pagination Bug
446 Wrap Up
447 Useful Resources & Links

Deploying our App
448 Module Introduction
449 Deploying Different Kinds of Apps
450 Deployment Preparations
451 Using Environment Variables
452 Using Production API Keys
453 Setting Secure Response Headers with Helmet
454 Compressing Assets
455 Setting Up Request Logging
456 More on Logging
457 Setting Up a SSL Server
458 Using a Hosting Provider
459 Understanding the Project & the Git Setup
460 A Deployment Example with Heroku
461 Storing User-generated Files on Heroku
462 Deploying APIs
463 Useful Resources & Links

Testing Node.js Applications
464 Module Introduction
465 What is Testing_
466 Why & How_
467 Setup and Writing a First Test
468 Testing the Auth Middleware
469 Organizing Multiple Tests
470 What Not To Test!
471 Using Stubs
472 Testing Controllers
473 Testing Asynchronous Code
474 Setting up a Testing Database
475 Testing Code With An Active Database
476 Cleaning Up
477 Hooks
478 Testing Code That Requires Authentication
479 Wrap Up & Mastering Tests
480 Useful Resources & Links

Node.js as a Build Tool & Using npm
481 Module Introduction
482 npm & Node.js
483 Using npm
484 Versioning in package.json
485 What is a Build Tool_
486 Using Node.js in Build Processes
487 Useful Resources & Links

Modern JavaScript & NodeJS
488 Module Introduction
489 What is this Module About_
490 Working with ES Modules & Node
491 More on ES Modules
492 Node Core Modules & Promises
493 Module Resources

NodeJS & TypeScript
494 Module Introduction
495 TypeScript_ What & Why_
496 TypeScript Setup
497 Assigning Types
498 Type Inference & Type Casting
499 Configuring TypeScript
500 Working with Union Types
501 Using Object & Array Types
502 Working with Type Aliases & Interfaces
503 Understanding Generics
504 A First Summary
505 Node & TypeScript_ Setup
506 Getting Started with Node and TypeScript
507 Writing TypeScript Express.js Code
508 Adding REST Routes with TypeScript
509 Finishing the REST Routes
510 Testing the API
511 Using Type Casting
512 Moving to a Better Project Structure
513 Wrap Up
514 Module Resources

An Introduction to Deno
515 Module Introduction
516 What is Deno_
517 Why Deno_
518 Deno Setup
519 Writing First Deno Code
520 The Deno Runtime (Namespace) API
521 Using the Runtime API
522 Working with Deno Permissions
523 Repeating the Example with Node
524 How Deno Features Are Organized
525 Using the Standard Library
526 Creating a Webserver
527 Using the Oak Framework with Deno
528 More on Module URLs
529 An Example Node REST API
530 Re-building the REST API with Deno
531 Should You Switch From Node to Deno_
532 Module Resources

Deno, CRUD & Databases (MongoDB)
533 Module Introduction
534 App Setup
535 Handling CORS Errors
536 Connecting Deno to MongoDB
537 Using the MongoDB Client Module
538 Finishing the Deno MongoDB CRUD Operations
539 Wrap Up
540 Module Resources

Roundup
541 Course Roundup
542 Course Slides
543 Bonus_ More Content!

Homepage