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

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

  • Maximilian Schwarzmüller
  • 4.69
  • (37140 reviews)
  • 40.5 hrs
  • 543 lectures
  • Udemy
NodeJS - The Complete Guide (MVC, REST APIs, GraphQL, Deno)

What you will 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

Your trainer

Maximilian Schwarzmüller

Starting out at the age of 13 I never stopped learning new programming skills and languages. Early I started creating websites for friends and just for fun as well. Besides web development I also explored Python and other non-web-only languages. This passion has since lasted and lead to my decision of working as a freelance web developer and consultant. The success and fun I have in this job is immense and really keeps that passion burningly alive.

Starting web development on the backend (PHP with Laravel, NodeJS, Python) I also became more and more of a frontend developer using modern frameworks like React, Angular or VueJS 2 in a lot of projects. I love both worlds nowadays!

543 lessons

Easy to follow lectures and videos covering subject details.

40.5 hours

This course includes hours of video material. Watch on-demand, anytime, anywhere.

Certificate of Completion

You will earn a Certificate of Completion at the end of this course.

Course curriculum

  • Introduction01:56
  • What is Node.js?04:42
  • Join our Online Learning Community00:25
  • Installing Node.js and Creating our First App09:39
  • Understanding the Role & Usage of Node.js07:32
  • Course Outline08:03
  • How To Get The Most Out Of The Course03:54
  • Working with the REPL vs Using Files02:58
  • Using the Attached Source Code00:36
  • Module Introduction01:38
  • JavaScript in a Nutshell02:38
  • Refreshing the Core Syntax04:37
  • let & const02:29
  • Understanding Arrow Functions05:21
  • Working with Objects, Properties & Methods03:23
  • Arrays & Array Methods04:19
  • Arrays, Objects & Reference Types02:16
  • Understanding Spread & Rest Operators06:46
  • Destructuring05:40
  • Async Code & Promises10:33
  • Template Literals00:25
  • Wrap Up00:51
  • Useful Resources & Links00:04
  • Module Introduction01:50
  • How The Web Works04:11
  • Creating a Node Server13:22
  • The Node Lifecycle & Event Loop04:53
  • Controlling the Node.js Process00:08
  • Understanding Requests03:10
  • Sending Responses05:37
  • Request & Response Headers00:16
  • Routing Requests05:48
  • Redirecting Requests04:10
  • Parsing Request Bodies11:12
  • Understanding Event Driven Code Execution06:00
  • Blocking and Non-Blocking Code05:04
  • Node.js - Looking Behind the Scenes12:01
  • Using the Node Modules System10:05
  • Wrap Up05:15
  • Time to Practice - The Basics1 question
  • Useful Resources & Links00:07
  • Module Introduction00:40
  • Understanding NPM Scripts07:03
  • Installing 3rd Party Packages08:20
  • Global Features vs Core Modules vs Third-Party Modules00:42
  • Using Nodemon for Autorestarts01:36
  • Global & Local npm Packages00:43
  • Understanding different Error Types01:49
  • Finding & Fixing Syntax Errors03:10
  • Dealing with Runtime Errors02:47
  • Logical Errors06:32
  • Using the Debugger03:10
  • Restarting the Debugger Automatically After Editing our App06:21
  • Debugging Node.js in Visual Studio Code00:05
  • Changing Variables in the Debug Console01:26
  • Wrap Up03:14
  • Useful Resources & Links00:08
  • Module Introduction02:15
  • What is Express.js?03:43
  • Installing Express.js03:47
  • Adding Middleware05:13
  • How Middleware Works02:58
  • Express.js - Looking Behind the Scenes03:42
  • Handling Different Routes04:59
  • Time to Practice - Express.js1 question
  • Parsing Incoming Requests08:00
  • Limiting Middleware Execution to POST Requests01:48
  • Using Express Router08:04
  • Adding a 404 Error Page02:30
  • Filtering Paths03:38
  • Creating HTML Pages05:09
  • Serving HTML Pages07:19
  • Returning a 404 Page02:00
  • A Hint!00:12
  • Using a Helper Function for Navigation03:37
  • Styling our Pages13:58
  • Serving Files Statically07:49
  • Time to Practice - Navigation1 question
  • Wrap Up03:36
  • Useful Resources & Links00:07
  • Module Introduction02:31
  • Sharing Data Across Requests & Users08:05
  • Templating Engines - An Overview04:40
  • Installing & Implementing Pug11:04
  • Outputting Dynamic Content11:02
  • Official Pug Docs00:03
  • Converting HTML Files to Pug05:55
  • Adding a Layout05:35
  • Finishing the Pug Template05:50
  • Avoiding an Error00:12
  • Working with Handlebars05:08
  • Converting our Project to Handlebars07:41
  • Adding the Layout to Handlebars08:41
  • Working with EJS08:19
  • Working on the Layout with Partials09:33
  • Wrap Up03:46
  • Time to Practice - Templating Engines1 question
  • [OPTIONAL] Assignment Solution25:02
  • Useful Resources & Links00:07
  • Module Introduction00:52
  • What is the MVC?02:48
  • Adding Controllers09:20
  • Finishing the Controllers02:37
  • Adding a Product Model08:05
  • Storing Data in Files Via the Model09:39
  • Fetching Data from Files Via the Model03:55
  • Refactoring the File Storage Code04:25
  • Wrap Up02:15
  • Useful Resources & Links00:07
  • Module Introduction01:21
  • Creating the Shop Structure05:34
  • Working on the Navigation02:49
  • Registering the Routes11:04
  • Storing Product Data05:15
  • Displaying Product Data03:02
  • Editing & Deleting Products04:47
  • Adding Another Item02:08
  • Useful Resources & Links00:06
  • Module Introduction01:07
  • Preparations01:23
  • Applied Changes00:05
  • Adding the Product ID to the Path04:34
  • Extracting Dynamic Params04:32
  • Loading Product Detail Data04:52
  • Rendering the Product Detail View05:26
  • Passing Data with POST Requests07:19
  • Adding a Cart Model12:29
  • Using Query Params07:54
  • Pre-Populating the Edit Product Page with Data06:46
  • Linking to the Edit Page02:20
  • Editing the Product Data08:58
  • Adding the Product-Delete Functionality05:34
  • Deleting Cart Items08:11
  • Displaying Cart Items on the Cart Page08:45
  • Deleting Cart Items05:24
  • Fixing a Delete Product Bug01:31
  • Wrap Up01:46
  • Useful Resources & Links00:07
  • Module Introduction01:33
  • Choosing a Database04:17
  • NoSQL Introduction04:20
  • Comparing SQL and NoSQL05:06
  • Setting Up MySQL07:16
  • Connecting our App to the SQL Database06:50
  • Basic SQL & Creating a Table04:07
  • Retrieving Data03:00
  • Fetching Products06:30
  • Fetching Products - Time to Practice01:04
  • Inserting Data Into the Database04:12
  • Fetching a Single Product with the "where" Condition02:57
  • Wrap Up01:24
  • Useful Resources & Links00:09
  • Module Introduction01:26
  • What is Sequelize?02:34
  • Connecting to the Database03:57
  • Defining a Model05:47
  • Syncing JS Definitions to the Database04:29
  • Inserting Data & Creating a Product04:49
  • MUST READ: findById() in Sequelize 500:08
  • Retrieving Data & Finding Products03:00
  • Getting a Single Product with the "where" Condition04:30
  • Fetching Admin Products01:25
  • Updating Products05:18
  • Deleting Products02:48
  • Creating a User Model02:48
  • Adding a One-To-Many Relationship05:54
  • Creating & Managing a Dummy User06:01
  • Using Magic Association Methods03:42
  • Fetching Related Products02:46
  • One-To-Many & Many-To-Many Relations06:03
  • Creating & Fetching a Cart05:45
  • Adding New Products to the Cart06:42
  • Adding Existing Products & Retrieving Cart Items04:55
  • Deleting Related Items & Deleting Cart Products02:24
  • Adding an Order Model04:19
  • Storing Cartitems as Orderitems08:19
  • Resetting the Cart & Fetching and Outputting Orders09:53
  • Wrap Up01:49
  • Useful Resources & Links00:07
  • Module Introduction01:17
  • What is MongoDB?03:57
  • Relations in NoSQL03:58
  • Setting Up MongoDB04:48
  • Installing the MongoDB Driver07:01
  • Creating the Database Connection03:25
  • Finishing the Database Connection04:21
  • Using the Database Connection05:14
  • Creating Products02:08
  • Understanding the MongoDB Compass02:38
  • Fetching All Products04:34
  • Fetching a Single Product07:45
  • Making the "Edit" & "Delete" Buttons Work Again02:21
  • Working on the Product Model to Edit our Product07:13
  • Finishing the "Update Product" Code03:57
  • One Note About Updating Products01:46
  • Deleting Products03:30
  • Fixing the "Add Product" Functionality01:28
  • Creating New Users07:00
  • Storing the User in our Database05:40
  • Working on Cart Items & Orders07:13
  • Adding the "Add to Cart" Functionality06:14
  • Storing Multiple Products in the Cart07:01
  • Displaying the Cart Items09:20
  • Fixing a Bug01:02
  • Deleting Cart Items04:02
  • Adding an Order04:36
  • Adding Relational Order Data06:21
  • Getting Orders03:20
  • Removing Deleted Items From the Cart02:58
  • Wrap Up02:19
  • Useful Resources & Links00:08
  • Two Adjustments (behind the scenes)00:05
  • Module Introduction01:23
  • What is Mongoose?02:04
  • Connecting to the MongoDB Server with Mongoose04:47
  • Creating the Product Schema06:01
  • Saving Data Through Mongoose06:10
  • Fetching All Products02:27
  • Fetching a Single Product01:24
  • Updating Products04:14
  • Deleting Products01:19
  • Adding and Using a User Model06:36
  • Using Relations in Mongoose03:44
  • One Important Thing About Fetching Relations03:53
  • Working on the Shopping Cart05:25
  • Loading the Cart05:12
  • Deleting Cart Items02:45
  • Creating & Getting Orders09:56
  • Storing All Order Related Data01:52
  • Clearing the Cart After Storing an Order01:59
  • Getting & Displaying the Orders03:40
  • Wrap Up01:37
  • Useful Resources & Links00:07
  • Module Introduction00:45
  • What is a Cookie?01:57
  • The Current Project Status02:18
  • Optional: Creating the Login Form06:22
  • Adding the Request Driven Login Solution07:40
  • Setting a Cookie05:55
  • Manipulating Cookies01:58
  • Configuring Cookies05:43
  • What is a Session?02:58
  • Initializing the Session Middleware02:43
  • Using the Session Middleware04:14
  • Using MongoDB to Store Sessions05:59
  • Sessions & Cookies - A Short Summary01:53
  • Time to Practice - Sessions and Cookies1 question
  • Deleting a Cookie04:35
  • Fixing Some Minor Bugs04:27
  • Making "Add to Cart" Work Again06:45
  • Two Tiny Improvements03:11
  • Wrap Up03:43
  • Code Adjustments00:06
  • Useful Resources & Links00:08
  • Module Introduction01:22
  • What is Authentication?02:25
  • How is Authentication Implemented?02:04
  • Our Updated Project Status02:25
  • Implementing an Authentication Flow07:34
  • Encrypting Passwords04:36
  • Adding a Tiny Code Improvement01:21
  • Adding the Signin Functionality06:21
  • Working on Route Protection02:12
  • Using Middleware to Protect Routes04:38
  • Understanding CSRF Attacks03:23
  • Using a CSRF Token06:56
  • Adding CSRF Protection04:23
  • csurf() Alternatives00:35
  • Fixing the Order Button01:16
  • Providing User Feedback07:10
  • Optional: Styling Error Messages03:32
  • Finishing the Flash Messages02:20
  • Adding Additional Flash Messages02:20
  • Wrap Up02:32
  • Useful Resources & Links00:08
  • Module Introduction00:46
  • How Does Sending Emails Work?01:34
  • Using SendGrid01:24
  • Using Nodemailer to Send an Email05:09
  • Potential Limitation for Large Scale Apps01:29
  • Useful Resources & Links00:07
  • Module Introduction00:42
  • Resetting Passwords03:03
  • Implementing the Token Logic07:40
  • Creating the Token01:27
  • Creating the Reset Password Form05:27
  • Adding Logic to Update the Password06:35
  • Why we Need Authorization01:58
  • Adding Authorization02:07
  • Adding Protection to Post Actions03:43
  • Why Editing Fails01:06
  • Wrap Up01:45
  • Useful Resources & Links00:06
  • Module Introduction01:03
  • Why Should We Use Validation?02:28
  • How to Validate Input?04:04
  • Setup & Basic Validation10:44
  • Using Validation Error Messages02:11
  • Built-In & Custom Validators03:55
  • More Validators04:26
  • Checking For Field Equality03:14
  • Adding Async Validation04:46
  • Time to Practice - Validation1 question
  • Keeping User Input04:11
  • Adding Conditional CSS Classes05:29
  • Adding Validation to Login05:36
  • Sanitizing Data03:41
  • Validating Product Addition11:40
  • Validating Product Editing06:57
  • Wrap Up01:23
  • Useful Resources & Links00:08
  • Module Introduction00:45
  • Types of Errors & Error Handling05:14
  • Analyzing the Error Handling in the Current Project02:22
  • Errors - Some Theory06:43
  • Throwing Errors in Code02:42
  • Returning Error Pages06:54
  • Using the Express.js Error Handling Middleware05:47
  • Updating the App03:09
  • Using the Error Handling Middleware Correctly04:54
  • Status Codes05:57
  • Available Status Codes00:40
  • Wrap Up02:21
  • Useful Resources & Links00:07
  • Module Introduction00:54
  • Adding a File Picker to the Frontend03:06
  • Handling Multipart Form Data05:15
  • Handling File Uploads with Multer04:51
  • Configuring Multer to Adjust Filename & Filepath04:29
  • Filtering Files by Mimetype02:28
  • Storing File Data in the Database07:42
  • Remove imageUrl from "Add Product"00:14
  • Serving Images Statically04:25
  • Downloading Files with Authentication07:33
  • Setting File Type Headers02:35
  • Restricting File Access03:19
  • Streaming Data vs Preloading Data03:20
  • Using PDFKit for .pdf Generation05:32
  • Generating .pdf Files with Order Data06:50
  • Deleting Files05:57
  • Fixing Invoice Links00:35
  • Wrap Up01:31
  • Useful Resources & Links00:08
  • Module Introduction00:48
  • Adding Pagination Links04:08
  • Retrieving a Chunk of Data03:47
  • Skip & Limit with SQL00:22
  • Preparing Pagination Data on the Server03:52
  • Adding Dynamic Pagination Buttons08:07
  • Re-Using the Pagination Logic & Controls03:41
  • Wrap Up01:02
  • Useful Resources & Links00:06
  • Module Introduction00:48
  • What are Async Requests?02:07
  • Adding Client Side JS Code07:24
  • The JSON Data Format00:21
  • Sending & Handling Background Requests09:26
  • Manipulating the DOM03:01
  • Useful Resources & Links00:08
  • Module Introduction00:58
  • How Payments Work02:04
  • Adding a Checkout Page06:00
  • Using Stripe in Your App19:23
  • Useful Resources & Links00:07
  • Module Introduction01:25
  • What are REST APIs and why do we use Them?07:01
  • Accessing Data with REST APIs05:41
  • Understanding Routing & HTTP Methods05:25
  • REST APIs - The Core Principles04:09
  • Creating our REST API Project & Implementing the Route Setup06:41
  • Sending Requests & Responses and Working with Postman13:28
  • REST APIs, Clients & CORS Errors10:33
  • Sending POST Requests06:32
  • Wrap Up02:14
  • Useful Resources & Links00:08
  • Module Introduction01:09
  • REST APIs & The Rest Of The Course03:59
  • Understanding the Frontend Setup04:17
  • Planning the API03:02
  • Fetching Lists of Posts06:19
  • Adding a Create Post Endpoint07:36
  • Adding Server Side Validation06:19
  • Setting Up a Post Model05:14
  • Storing Posts in the Database03:32
  • Static Images & Error Handling06:53
  • Fetching a Single Post07:48
  • Image Names & Windows00:43
  • Uploading Images08:56
  • Updating Posts14:02
  • Deleting Posts04:16
  • Adding Pagination06:20
  • Adding a User Model04:08
  • Adding User Signup Validation06:29
  • Signing Users Up07:24
  • How Does Authentication Work?03:10
  • Starting with User Login03:51
  • Logging In & Creating JSON Web Tokens (JWTs)07:53
  • Using & Validating the Token09:43
  • Adding Auth Middleware to All Routes01:52
  • Connecting Posts & Users06:13
  • Adding Authorization Checks03:50
  • Clearing Post-User Relations02:54
  • Time to Practice - Working with REST APIs1 question
  • Wrap Up02:28
  • Useful Resources & Links00:06
  • Module Introduction00:58
  • What is Async Await All About?04:08
  • Transforming "Then Catch" to "Async Await"04:26
  • Top-level "await"01:18
  • Time to Practice - Async Await1 question
  • The User Name is Missing!00:19
  • Wrap Up03:03
  • Useful Resources & Links00:07
  • Module Introduction00:55
  • What Are Websockets & Why Would You Use Them?04:17
  • Websocket Solutions - An Overview01:35
  • Setting Up Socket.io on the Server03:56
  • Establishing a Connection From the Client02:27
  • Identifying Realtime Potential02:42
  • Sharing the IO Instance Across Files02:46
  • Synchronizing POST Additions07:14
  • Fixing a Bug - The Missing Username01:44
  • Updating Posts On All Connected Clients03:58
  • Sorting Correctly00:59
  • Deleting Posts Across Clients02:31
  • Wrap Up01:48
  • Useful Resources & Links00:07
  • Module Introduction00:57
  • What is GraphQL?09:17
  • Understanding the Setup & Writing our First Query11:15
  • Defining a Mutation Schema05:42
  • Adding a Mutation Resolver & GraphiQL09:42
  • Adding Input Validation04:19
  • Handling Errors03:45
  • Connecting the Frontend to the GraphQL API06:49
  • Adding a Login Query & a Resolver06:20
  • Adding Login Functionality04:57
  • Adding a Create Post Mutation07:23
  • Extracting User Data From the Auth Token05:48
  • Sending the "Create Post" Query04:46
  • Fixing a Bug & Adding New Posts Correctly02:53
  • Adding a "Get Post" Query & Resolver04:53
  • Sending "Create Post" and "Get Post" Queries05:13
  • Adding Pagination04:28
  • Uploading Images10:26
  • Fetching the imageUrl00:22
  • Viewing a Single Post06:07
  • Updating Posts09:32
  • Deleting Posts09:25
  • Adding Posts & Pagination00:25
  • Managing the User Status09:17
  • Using Variables16:06
  • Fixing a Pagination Bug02:48
  • Wrap Up03:36
  • Useful Resources & Links00:07
  • Module Introduction01:16
  • Deploying Different Kinds of Apps01:39
  • Deployment Preparations04:52
  • Using Environment Variables11:12
  • Using Production API Keys01:19
  • Setting Secure Response Headers with Helmet02:40
  • Compressing Assets02:33
  • Setting Up Request Logging03:34
  • More on Logging00:11
  • Setting Up a SSL Server09:55
  • Using a Hosting Provider04:25
  • Understanding the Project & the Git Setup04:03
  • A Deployment Example with Heroku10:26
  • Storing User-generated Files on Heroku00:44
  • Deploying APIs02:52
  • Useful Resources & Links00:11
  • Module Introduction00:43
  • What is Testing?02:42
  • Why & How?03:25
  • Setup and Writing a First Test09:40
  • Testing the Auth Middleware12:33
  • Organizing Multiple Tests04:12
  • What Not To Test!08:02
  • Using Stubs08:38
  • Testing Controllers08:03
  • Testing Asynchronous Code05:53
  • Setting up a Testing Database06:33
  • Testing Code With An Active Database06:33
  • Cleaning Up03:29
  • Hooks04:34
  • Testing Code That Requires Authentication12:37
  • Wrap Up & Mastering Tests04:22
  • Useful Resources & Links00:01
  • Module Introduction01:01
  • npm & Node.js01:42
  • Using npm07:52
  • Versioning in package.json00:12
  • What is a Build Tool?05:01
  • Using Node.js in Build Processes05:50
  • Useful Resources & Links00:09
  • Module Introduction02:28
  • What is this Module About?02:19
  • Working with ES Modules & Node09:32
  • More on ES Modules06:26
  • Node Core Modules & Promises05:18
  • Module Resources00:03
  • Module Introduction01:22
  • TypeScript: What & Why?06:02
  • TypeScript Setup04:09
  • Assigning Types03:29
  • Type Inference & Type Casting06:10
  • Configuring TypeScript05:01
  • Working with Union Types04:23
  • Using Object & Array Types06:17
  • Working with Type Aliases & Interfaces03:22
  • Understanding Generics05:09
  • A First Summary00:34
  • Node & TypeScript: Setup02:14
  • Getting Started with Node and TypeScript09:31
  • Writing TypeScript Express.js Code03:59
  • Adding REST Routes with TypeScript06:42
  • Finishing the REST Routes05:53
  • Testing the API04:52
  • Using Type Casting04:21
  • Moving to a Better Project Structure03:44
  • Wrap Up02:50
  • Module Resources00:09
  • Module Introduction01:35
  • What is Deno?03:09
  • Why Deno?01:55
  • Deno Setup05:50
  • Writing First Deno Code04:18
  • The Deno Runtime (Namespace) API03:13
  • Using the Runtime API05:26
  • Working with Deno Permissions04:31
  • Repeating the Example with Node04:16
  • How Deno Features Are Organized04:28
  • Using the Standard Library08:30
  • Creating a Webserver02:54
  • Using the Oak Framework with Deno09:48
  • More on Module URLs00:32
  • An Example Node REST API12:15
  • Re-building the REST API with Deno16:18
  • Should You Switch From Node to Deno?05:05
  • Module Resources00:02
  • Module Introduction01:00
  • App Setup04:06
  • Handling CORS Errors07:16
  • Connecting Deno to MongoDB08:05
  • Using the MongoDB Client Module10:34
  • Finishing the Deno MongoDB CRUD Operations05:29
  • Wrap Up01:10
  • Module Resources00:02
  • Course Roundup02:40
  • Course Slides00:01
  • Bonus: More Content!00:20
Online Courses

Learning NodeJS doesn't have to be hard. Here is our curated list of recommended online courses that will guide you step-by-step in the learning process.

Learn more
Books

Are you an avid book reader? Do you prefer paperback, or maybe Kindle version? Take a look at our curated list of NodeJS related books and take yourskills to the next level.

Learn more
YouTube videos

The number of high-quality and free NodeJS video tutorials is growing fast. Check this curated list of recommended videos - there is no excuse to stop learning.

Learn more