Node.js Fundamentals Online Course

About the Course

Join the most comprehensive Node.js course. Node.js is probably the most popular and modern server-side programming language you can learn these days! Node.js developers are in high demand as this language is used for everything from traditional web apps with server-side rendered views over REST APIs through 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! Right 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. All topics and features of the course will be shown and used in these projects and so you'll learn about them in a realistic environment.

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

  • Node.js basics and basic core modules, parsing requests and sending responses
  • Rendering HTML dynamically (on the server) and using Express.js
  • Working with files and generating PDFs on the server (on-the-fly)
  • File upload and download and using the Model-View-Controller (MVC) pattern
  • Using Node.js with SQL (MySQL), Sequelize, NoSQL (MongoDB), and Mongoose
  • Working with sessions and cookies, user authentication, and authorization
  • Sending e-mails, validating user input, and data pagination
  • Handling payments with Stripe.js and building REST APIs
  • Authentication and file upload in REST APIs
  • Building GraphQL APIs and authentication in GraphQL APIs
  • File upload in GraphQL APIs
  • Building a real-time Node.js app with WebSocket
  • Automated testing (unit tests) and deploying a Node.js application

Prerequisites: -

  • No Node.js knowledge is required at all
  • No other programming language knowledge (besides JavaScript, see next point) is required
  • Basic JavaScript knowledge is assumed though you should at least be willing to pick it up whilst going through the course. A JS refresher module exists to get you up to the speed with the latest syntax quickly
  • Basic HTML with CSS knowledge will be helpful


Course Curriculum

Introduction

  • Introduction
  • What is Node.js?
  • Installing Node.js and Creating our First App
  • Understanding the Role & Usage of Node.js
  • Course Outline
  • How to Get the Most Out of the Course
  • Working with the REPL vs Using Files

Optional: JavaScript - A Quick Refresher

  • Module Introduction
  • JavaScript in a Nutshell
  • Refreshing the Core Syntax
  • let & const
  • Understanding Arrow Functions
  • Working with Objects, Properties & Methods
  • Arrays & Array Methods
  • Arrays, Objects & Reference Types
  • Understanding Spread & Rest Operators
  • Destructuring
  • Async Code & Promises
  • Wrap Up

Understanding the Basics

  • Module Introduction
  • How the Web Works
  • Creating a Node Server
  • The Node Lifecycle & Event Loop
  • Understanding Requests
  • Sending Responses
  • Routing Requests
  • Redirecting Requests
  • Parsing Request Bodies
  • Understanding Event Driven Code Execution
  • Blocking and Non-Blocking Code
  • Node.js - Looking Behind the Scenes
  • Using the Node Modules System
  • Wrap Up

Improved Development Workflow and Debugging

  • Module Introduction
  • Understanding NPM Scripts
  • Installing 3rd Party Packages
  • Using Nodemon for Autorestarts
  • Understanding different Error Types
  • Finding & Fixing Syntax Errors
  • Dealing with Runtime Errors
  • Logical Errors
  • Using the Debugger
  • Restarting the Debugger Automatically After Editing our App
  • Changing Variables in the Debug Console
  • Wrap Up

Working with Express.js

  • Module Introduction
  • What is Express.js?
  • Installing Express.js
  • Adding Middleware
  • How Middleware Works
  • Express.js - Looking Behind the Scenes
  • Handling Different Routes
  • Parsing Incoming Requests
  • Limiting Middleware Execution to POST Requests
  • Using Express Router
  • Adding a 404 Error Page
  • Filtering Paths
  • Creating HTML Pages
  • Serving HTML Pages
  • Returning a 404 Page
  • Using a Helper Function for Navigation
  • Styling our Pages
  • Serving Files Statically
  • Wrap Up

Working with Dynamic Content & Adding Templating Engines

  • Module Introduction
  • Sharing Data across Requests & Users
  • Templating Engines - An Overview
  • Installing & Implementing Pug
  • Outputting Dynamic Content
  • Converting HTML Files to Pug
  • Adding a Layout
  • Finishing the Pug Template
  • Working with Handlebars
  • Converting our Project to Handlebars
  • Adding the Layout to Handlebars
  • Working with EJS
  • Working on the Layout with Partials
  • Wrap Up

The Model View Controller (MVC)

  • Module Introduction
  • What is the MVC?
  • Adding Controllers
  • Finishing the Controllers
  • Adding a Product Model
  • Storing Data in Files via the Model
  • Fetching Data from Files via the Model
  • Refactoring the File Storage Code
  • Wrap Up

Optional: Enhancing the App

  • Module Introduction
  • Creating the Shop Structure
  • Working on the Navigation
  • Registering the Routes
  • Storing Product Data
  • Displaying Product Data
  • Editing & Deleting Products
  • Adding another Item

Dynamic Routes & Advanced Models

  • Module Introduction
  • Preparations
  • Adding the Product ID to the Path
  • Extracting Dynamic Params
  • Loading Product Detail Data
  • Rendering the Product Detail View
  • Passing Data with POST Requests
  • Adding a Cart Model
  • Using Query Params
  • Pre-Populating the Edit Product Page with Data
  • Linking to the Edit Page
  • Editing the Product Data
  • Adding the Product-Delete Functionality
  • Deleting Cart Items
  • Displaying Cart Items on the Cart Page
  • Deleting Cart Items
  • Fixing a Delete Product Bug
  • Wrap Up

SQL Introduction

  • Module Introduction
  • Choosing a Database
  • NoSQL Introduction
  • Comparing SQL and NoSQL
  • Setting Up MySQL
  • Connecting our App to the SQL Database
  • Basic SQL & Creating a Table
  • Retrieving Data
  • Fetching Products
  • Fetching Products - Time to Practice
  • Inserting Data into the Database
  • Fetching a Single Product with the "where" Condition
  • Wrap Up

Understanding Sequelize

  • Module Introduction
  • What is Sequelize?
  • Connecting to the Database
  • Defining a Model
  • Syncing JS Definitions to the Database
  • Inserting Data & Creating a Product
  • Retrieving Data & Finding Products
  • Getting a Single Product with the "where" Condition
  • Fetching Admin Products
  • Updating Products
  • Deleting Products
  • Creating a User Model
  • Adding a One-To-Many Relationship
  • Creating & Managing a Dummy User
  • Using Magic Association Methods
  • Fetching Related Products
  • One-To-Many & Many-To-Many Relations
  • Creating & Fetching a Cart
  • Adding New Products to the Cart
  • Adding Existing Products & Retrieving Cart Items
  • Deleting Related Items & Deleting Cart Products
  • Adding an Order Model
  • Storing Cartitems as Orderitems
  • Resetting the Cart & Fetching and Outputting Orders
  • Wrap Up

Working with NoSQL & Using MongoDB

  • Module Introduction
  • What is MongoDB?
  • Relations in NoSQL
  • Setting Up MongoDB
  • Installing the MongoDB Driver
  • Creating the Database Connection
  • Finishing the Database Connection
  • Using the Database Connection
  • Creating Products
  • Understanding the MongoDB Compass
  • Fetching All Products
  • Fetching a Single Product
  • Making the "Edit" & "Delete" Buttons Work Again
  • Working on the Product Model to Edit our Product
  • Finishing the "Update Product" Code
  • One Note about Updating Products
  • Deleting Products
  • Fixing the "Add Product" Functionality
  • Creating New Users
  • Storing the User in our Database
  • Working on Cart Items & Orders
  • Adding the "Add to Cart" Functionality
  • Storing Multiple Products in the Cart
  • Displaying the Cart Items
  • Fixing a Bug
  • Deleting Cart Items
  • Adding an Order
  • Adding Relational Order Data
  • Getting Orders
  • Removing Deleted Items from the Cart
  • Wrap Up

Working with Mongoose

  • Module Introduction
  • What is Mongoose?
  • Connecting to the MongoDB Server with Mongoose
  • Creating the Product Schema
  • Saving Data through Mongoose
  • Fetching All Products
  • Fetching a Single Product
  • Updating Products
  • Deleting Products
  • Adding and Using a User Model
  • Using Relations in Mongoose
  • One Important Thing about Fetching Relations
  • Working on the Shopping Cart
  • Loading the Cart
  • Deleting Cart Items
  • Creating & Getting Orders
  • Storing All Order Related Data
  • Clearing the Cart after Storing an Order
  • Getting & Displaying the Orders
  • Wrap Up

Sessions & Cookies

  • Module Introduction
  • What is a Cookie?
  • The Current Project Status
  • Optional: Creating the Login Form
  • Adding the Request Driven Login Solution
  • Setting a Cookie
  • Manipulating Cookies
  • Configuring Cookies
  • What is a Session?
  • Initializing the Session Middleware
  • Using the Session Middleware
  • Using MongoDB to Store Sessions
  • Sessions & Cookies - A Short Summary
  • Deleting a Cookie
  • Fixing Some Minor Bugs
  • Making "Add to Cart" Work Again
  • Two Tiny Improvements
  • Wrap Up

Adding Authentication

  • Module Introduction
  • What is Authentication?
  • How is Authentication Implemented?
  • Our Updated Project Status
  • Implementing an Authentication Flow
  • Encrypting Passwords
  • Adding a Tiny Code Improvement
  • Adding the Signin Functionality
  • Working on Route Protection
  • Using Middleware to Protect Routes
  • Understanding CSRF Attacks
  • Using a CSRF Token
  • Adding CSRF Protection
  • Fixing the Order Button
  • Providing User Feedback
  • Optional: Styling Error Messages
  • Finishing the Flash Messages
  • Adding Additional Flash Messages
  • Wrap Up

Sending Emails

  • Module Introduction
  • How Does Sending Emails Work?
  • Using SendGrid
  • Using Nodemailer to Send an Email
  • Potential Limitation for Large Scale Apps

Advanced Authentication

  • Module Introduction
  • Resetting Passwords
  • Implementing the Token Logic
  • Creating the Token
  • Creating the Reset Password Form
  • Adding Logic to Update the Password
  • Why we Need Authorization
  • Adding Authorization
  • Adding Protection to Post Actions
  • Why Editing Fails
  • Wrap Up

Understanding Validation

  • Module Introduction
  • Why Should We Use Validation?
  • How to Validate Input?
  • Setup & Basic Validation
  • Using Validation Error Messages
  • Built-In & Custom Validators
  • More Validators
  • Checking For Field Equality
  • Adding Async Validation
  • Keeping User Input
  • Adding Conditional CSS Classes
  • Adding Validation to Login
  • Sanitizing Data
  • Validating Product Addition
  • Validating Product Editing
  • Wrap Up

Error Handling

  • Module Introduction
  • Types of Errors & Error Handling
  • Analysing the Error Handling in the Current Project
  • Errors - Some Theory
  • Throwing Errors in Code
  • Returning Error Pages
  • Using the Express.js Error Handling Middleware
  • Updating the App
  • Using the Error Handling Middleware Correctly
  • Status Codes
  • Wrap Up

File Upload & Download

  • Module Introduction
  • Adding a File Picker to the Frontend
  • Handling Multipart Form Data
  • Handling File Uploads with Multer
  • Configuring Multer to Adjust Filename & Filepath
  • Filtering Files by Mimetype
  • Storing File Data in the Database
  • Serving Images Statically
  • Downloading Files with Authentication
  • Setting File Type Headers
  • Restricting File Access
  • Streaming Data vs Preloading Data
  • Using PDFKit for .pdf Generation
  • Generating .pdf Files with Order Data
  • Deleting Files
  • Fixing Invoice Links
  • Wrap Up

Adding Pagination

  • Module Introduction
  • Adding Pagination Links
  • Retrieving a Chunk of Data
  • Preparing Pagination Data on the Server
  • Adding Dynamic Pagination Buttons
  • Re-Using the Pagination Logic & Controls
  • Wrap Up

Understanding Async Requests

  • Module Introduction
  • What are Async Requests?
  • Adding Client Side JS Code
  • Sending & Handling Background Requests
  • Manipulating the DOM

Adding Payments

  • Module Introduction
  • How Payments Work
  • Adding a Checkout Page
  • Using Stripe in Your App

Working with REST APIs - The Basics

  • Module Introduction
  • What are REST APIs and why do we use them?
  • Accessing Data with REST APIs
  • Understanding Routing & HTTP Methods
  • REST APIs - The Core Principles
  • Creating our REST API Project & Implementing the Route Setup
  • Sending Requests & Responses and Working with Postman
  • REST APIs, Clients & CORS Errors
  • Sending POST Requests
  • Wrap Up

Working with REST APIs - The Practical Application

  • Module Introduction
  • REST APIs & the Rest of the Course
  • Understanding the Frontend Setup
  • Planning the API
  • Fetching Lists of Posts
  • Adding a Create Post Endpoint
  • Adding Server Side Validation
  • Setting Up a Post Model
  • Storing Posts in the Database
  • Static Images & Error Handling
  • Fetching a Single Post
  • Uploading Images
  • Updating Posts
  • Deleting Posts
  • Adding Pagination
  • Adding a User Model
  • Adding User Signup Validation
  • Signing Users Up
  • How Does Authentication Work?
  • Starting with User Login
  • Logging In & Creating JSON Web Tokens (JWTs)
  • Using & Validating the Token
  • Adding Auth Middleware to All Routes
  • Connecting Posts & Users
  • Adding Authorization Checks
  • Clearing Post-User Relations
  • Wrap Up

Understanding Async Await in Node.js

  • Module Introduction
  • What is Async Await All About?
  • Transforming "Then Catch" to "Async Await"
  • Wrap Up

Understanding Websockets & Socket.io

  • Module Introduction
  • What Are Websockets & Why Would You Use Them?
  • Websocket Solutions - An Overview
  • Setting Up Socket.io on the Server
  • Establishing a Connection from the Client
  • Identifying Realtime Potential
  • Sharing the IO Instance across Files
  • Synchronizing POST Additions
  • Fixing a Bug - The Missing Username
  • Updating Posts on All Connected Clients
  • Sorting Correctly
  • Deleting Posts across Clients
  • Wrap Up

Working with GraphQL

  • Module Introduction
  • What is GraphQL?
  • Understanding the Setup & Writing our First Query
  • Defining a Mutation Schema
  • Adding a Mutation Resolver & GraphiQL
  • Adding Input Validation
  • Handling Errors
  • Connecting the Frontend to the GraphQL API
  • Adding a Login Query & a Resolver
  • Adding Login Functionality
  • Adding a Create Post Mutation
  • Extracting User Data from the Auth Token
  • Sending the "Create Post" Query
  • Fixing a Bug & Adding New Posts Correctly
  • Adding a "Get Post" Query & Resolver
  • Sending "Create Post" and "Get Post" Queries
  • Adding Pagination
  • Uploading Images
  • Viewing a Single Post
  • Updating Posts
  • Deleting Posts
  • Managing the User Status
  • Using Variables
  • Fixing a Pagination Bug
  • Wrap Up

Deploying our App

  • Module Introduction
  • Deploying Different Kinds of Apps
  • Deployment Preparations
  • Using Environment Variables
  • Using Production API Keys
  • Setting Secure Response Headers with Helmet
  • Compressing Assets
  • Setting Up Request Logging
  • Setting Up a SSL Server
  • Using a Hosting Provider
  • Understanding the Project & the Git Setup
  • A Deployment Example with Heroku
  • Deploying APIs

Testing Node.js Applications

  • Module Introduction
  • What is Testing?
  • Why & How?
  • Setup and Writing a First Test
  • Testing the Auth Middleware
  • Organizing Multiple Tests
  • What Not To Test!
  • Using Stubs
  • Testing Controllers
  • Testing Asynchronous Code
  • Setting up a Testing Database
  • Testing Code with an Active Database
  • Cleaning Up
  • Hooks
  • Testing Code That Requires Authentication
  • Wrap Up & Mastering Tests

Node.js as a Build Tool & Using npm

  • Module Introduction
  • npm & Node.js
  • Using npm
  • What is a Build Tool?
  • Using Node.js in Build Processes

Roundup

  • Course Roundup

Tags: Node.js Fundamentals Online Course