All About Nodejs

Tags: Node.Js

Create & Deploy High Performance Node JS Apps on the Cloud and More !

Last updated 2022-01-10 | 4.7

- Build High Performance and Scalable Apps using NodeJS
- Learn about ES6 with my free eBook - ECMAScript 6 QuickBytes
- Use NodeJS Streams to write a Web Server

What you'll learn

Build High Performance and Scalable Apps using NodeJS
Learn about ES6 with my free eBook - ECMAScript 6 QuickBytes
Use NodeJS Streams to write a Web Server
Use the Node Package Manager (NPM) for managing dependencies
Use the Express 4 Framework for building NodeJS Apps
Use the EJS templating language
Understand MongoDB as a NoSQL Database
Create & Use MongoDB Databases using services like MongoLab
Create Realtime Apps that use Web Sockets
Upload & Resize Images using NodeJS
Integrate Authentication using Social Media Sites like Facebook
Structure the NodeJS app into modules
Create and Deploy EC2 Cloud Server Instances on Amazon Web Services
Create and Use Amazon's S3 Storage Service with NodeJS
Use Amazon's Cloudfront Service
Using Amazon's Elastic IP
Configure Security Groups
Ports & Forwarding on Amazon EC2
Deploy a NodeJS app on the EC2 Instance
Deploy a NodeJS app on Heroku
Deploy a NodeJS app on Digital Ocean
Install & Deploy NGINX as a Reverse Proxy Server for NodeJS Apps
Configure NGINX as a Load Balancer
Learn about Enterprise Integration
Create an app using the incredible Hapi framework
Learn more about logging using the Hapi framework
Learn to use ES6 with Nodejs
Install & Deploy Apache Apollo MQ with Nodejs and a Python Script

* Requirements

* Working knowledge of HTML
* CSS and Javascript
* Basic Working knowledge of an image editing application such as Adobe Photoshop would also help
* but is not necessarily needed.

Description

  • Build High Performance and Scalable Apps using NodeJS
  • Learn about ES6 with my free eBook - ECMAScript 6 QuickBytes
  • Use NodeJS Streams to write a Web Server
  • Use the Node Package Manager (NPM) for managing dependencies
  • Use the Express 4 Framework for building NodeJS Apps
  • Use the EJS templating language
  • Understand MongoDB as a NoSQL Database
  • Create & Use MongoDB Databases using services like MongoLab
  • Create Realtime Apps that use Web Sockets
  • Upload & Resize Images using NodeJS
  • Integrate Authentication using Social Media Sites like Facebook
  • Structure the NodeJS app into modules
  • Create and Deploy EC2 Cloud Server Instances on Amazon Web Services
  • Create and Use Amazon's S3 Storage Service with NodeJS
  • Use Amazon's Cloudfront Service
  • Using Amazon's Elastic IP
  • Configure Security Groups, Ports & Forwarding on Amazon EC2
  • Deploy a NodeJS app on the EC2 Instance
  • Deploy a NodeJS app on Heroku
  • Deploy a NodeJS app on Digital Ocean
  • Install & Deploy NGINX as a Reverse Proxy Server for NodeJS Apps
  • Configure NGINX as a Load Balancer
  • Learn about Enterprise Integration
  • Create an app using the incredible Hapi framework
  • Learn more about logging using the Hapi framework
  • Learn to use ES6 with Nodejs
  • Install & Deploy Apache Apollo MQ with Nodejs and a Python Script

Course content

10 sections • 136 lectures

What is NodeJS ? Preview 14:19

Thank you for joining this comprehensive course on NodeJS. I'm delighted to have you here. This video explores NodeJS from its fundamental concepts to its use case scenarios as well as establishes reasons why its becoming one of the hottest technologies to master.

Before You Begin | ECMAScript 6 QuickBytes | Free eBook Preview 01:58

NodeJS 4.x has brought native support for ECMAScript 6, out in the wild. So, here's a free eBook for everyone to get up and running with ECMAScript 6 today!


Since this course is being upgraded, all new lectures will support ES6. So, do read this work in progress document.


Also present is an Update Log that will keep you upto speed on the status of the course revision process.

Installing NodeJS on Windows Preview 01:55

In this video, we will download and install NodeJS on our Windows PC. To download NodeJS go to www.nodejs.org

Installing NodeJS on a Mac Preview 01:42

In this video, we will download and install NodeJS on our Mac. To download NodeJS go to www.nodejs.org

Installing NodeJS on Linux (Ubuntu) Preview 02:51

There are many ways of installing NodeJS on Linux. In this screencast, we'll use the Node Version Manager - N to install NodeJS and npm on Ubuntu.

Installing and using muliple versions of NodeJS (Only on Mac/Linux) Preview 05:16

Before You Begin : Important Note Preview 01:12

Read-Evaluate-Print-Line | REPL & Hello Node ! Preview 03:23

NodeJS provides an interactive terminal/shell based coding environment called R-E-P-L which stands for Read-Evaluate-Print-Line. A REPL interface executes one line or a code block at a time and hence is interactive. We can use Node's REPL for quickly experimenting with code.

Hello NodeJS Preview 11:57

In this lecture, you'll learn how to write your very first app with NodeJS - A Server that prints Hello NodeJS in the browser.

Hello Routing! | Understanding how Requests & Responses work Preview 08:06

Routing refers to handling requests from users. In this lecture, we'll understand how requests and responses work in NodeJS and we'll take our first steps at understanding the process of routing.

Hello Routing! | Handling GET Requests Preview 17:44

In this screencast, we begin by writing a router that can handle GET requests.

Hello Routing! | Handling POST Requests Preview 11:30

Our router graduates up to handle POST requests in this screencast.

NodeJS at its core Preview 02:51

So how exactly do the requests and responses work in NodeJS?

Build a Web Server | Basic Preview 20:43

How about writing a web server that serves a static HTML website!

Promise me you'll never callback Preview 14:15

It is very easy to write badly tangled up asynchronous code. So, let's detangle right away using Promises.

Build a Web Server | Using Streams Preview 06:50

Streams is an amazing feature. Know all about it, in this screencast.

Modules & NPM Preview 19:25

Modules help break down a bigger app into manageable chunks. In this screencast, you'll use an existing module to write an app that generates QR Codes. And we get to use NPM!

Writing your own Module! Preview 17:25

Finally, we get to write our very own module.

Enigma v2 Preview 08:24

Introduction to MongoDB Preview 09:55

MongoDB is a NoSQL database that stores data as documents in a format similar to JSON instead of using tables with rows and columns such as in a traditional RDBMS like MySQL MongoDB is schema-less which is pretty awesome for modern day product development lifecycles that need to be very dynamic and flexible. In this video, you'll be introduced to MongoDB.

Installing MongoDB on Windows Preview 09:48

Though we will be using a hosted MongoDB Implementation for our production examples in this course, in this video, we will download the MongoDB installer for Windows and we'll set it up to run as a windows service.

Installing MongoDB on a Mac Preview 04:21

Here's how to install MongoDB locally on a Mac. For Mongo Shell and basic commands, refer to Lecture 10.

Playing with the MongoDB Shell Preview 07:02

In this screencast, we'll play with the MongoDB Shell, a command line based interface to MongoDB, also based on the Chrome V8 engine.

What are frameworks? Preview 08:33

Express and the MEAN Stack Preview 06:49

Beyond the MEAN Stack Preview 11:16

The Goal Preview 04:22

Structuring the app Preview 05:37

Examining the user interface Preview 03:59

Installing Nodemon Preview 03:36

npm init and here we go! Preview 12:35

Hello Express! Preview 11:17

Middleware Ahoy! Preview 06:04

The View Renderer Preview 12:24

Serving Static Assets Preview 03:58

Express Router : First Steps Preview 06:32

Express Router : The routes object Preview 05:28

Express Router : Mounting the routes - 1 Preview 10:03

Express Router : Mounting the routes - 2 Preview 04:24

Express Router : Handling a 404 Preview 05:36

Do we need a database? Yes we do! Preview 03:32

MongoDB as a service | MongoLab.com Preview 07:13

Migrating to MongoDB Atlas - IMPORTANT Preview 01:34

Environments and the config loader Preview 08:26

Mongoose and the database module Preview 04:12

Sessions 101 Preview 04:53

Implementing sessions using the express-session middleware Preview 11:40

Social Authentication : An Introduction Preview 05:13

Social Authentication : Introduction to Passport Preview 08:50

Social Authentication : Installing Passport & Strategies Preview 01:16

Social Authentication : Registering the app on Facebook Preview 08:55

Social Authentication : Facebook Strategy Preview 05:25

Social Authentication : Database helpers Preview 10:44

Social Authentication : Serializing & deserializing user data Preview 04:17

Social Authentication : Routes Preview 04:48

Updates to Facebook Login | Enforcing HTTPS Preview 00:26

Social Authentication : Rendering name and profile picture Preview 02:05

Social Authentication : Registering the app with Twitter Preview 04:22

Social Authentication : Twitter Strategy Preview 02:11

Social Authentication : The logout button Preview 01:57

Social Authentication : Securing routes Preview 03:24

Socket.io | An introduction Preview 07:22

Socket.io | Installation and rewiring the server Preview 03:57

Socket.io | Storing chat rooms and user data Preview 03:48

Socket.io | Bridging Socket.io with Session Preview 02:25

Socket.io | Setting up the Rooms Page Preview 06:26

Socket.IO | Rendering the list of chatrooms Preview 07:28

Socket.IO | Creating a new chatroom Preview 12:14

Socket.IO | The chatroom route Preview 07:36

Socket.IO | Joining a chatroom Preview 16:10

Socket.IO | Updating the list of active users Preview 05:01

Socket.IO | When a user leaves or disconnects Preview 05:12

Socket.IO | The chat functionality Preview 09:17

Sending images using Cloudinary (Optional) Preview 07:20

Socket.IO | Scaling with Redis Preview 20:04

Logging with Winston Preview 09:08

Logging requests using Morgan Preview 03:31

Heroku | An introduction Preview 06:56

Heroku | Installing the Heroku Toolbelt CLI Preview 01:47

Heroku | Preparing for deployment Preview 08:26

Heroku | Setting up configuration variables Preview 03:45

Heroku | Provisioning Redis Preview 02:40

Heroku | Reconfiguring Facebook & Twitter and Deployment! Preview 04:17

Heroku | Monitoring your app Preview 04:21

Scaling up - An insight | Summary Preview 06:06

Introduction to Project PhotoGRID Preview 05:11

PhotoGRID is a photo gallery app that we'll build using NodeJS. We will build this app based on technologies that we've learnt so far and we'll take our experience one notch higher by integrating & deploying our app on the Amazon Elastic Compute Cloud (EC2). We will also use a couple of other AWS Services like the S3 Storage Service, Elastic IP & Cloudfront.

IMPORTANT : Before you Begin Preview 2 pages

This document should be read properly to avoid potential problems with this chapter.

Examining the User Interface & Getting Started Preview 06:41

As in the ChatCAT example, the User Interface files have been provided. We'll examine the user interface in this video.

Creating the Express App & Setting up Socket.io Preview 08:10

In this video, we'll download Express 4.0 - one of the most popular frameworks for making NodeJS apps. Once done, we'll create a basic scaffold for a working Express app. We'll also install SocketIO & Hogan-Express modules as well.

Creating the Routes.js module Preview 01:46

In this video, we'll create a Routes module like how we created in the ChatCAT example.

Creating Configuration Files Preview 03:02

In this video we'll create configuration files and a module to manage development and production environments.

Amazon Web Services | Signing Up & Creating an S3 Bucket Preview 05:36

Amazon is the global leader in Cloud Computing Services. In this video, we'll signup for an account on Amazon Web Services and we'll begin by provisioning an S3 (Simple Storage Service) Bucket to store all the photos that the user uploads via PhotoGRID.

Amazon Web Services | Setting up a Bucket Policy Preview 04:53

Access to an Amazon S3 Bucket depends on a bucket policy, without which users would be unable to access files. In this video we'll create a bucket policy.

Amazon Web Services | Setting up Knox Preview 05:04

To enable our PhotoGRID app to interact with the Amazon S3 Bucket, we'll use the KnoxJS module. In this video we'll download and setup the KnoxJS module.

Setting up the Upload Button Handler & AJAX Preview 14:48

In this video, we'll prep our front end to transfer files using a custom built AJAX function. Instead of using jQuery or similar libraries, we'll cook our own AJAX function.

Setting up Formidable for Receiving the files Preview 13:41

Once the Javascript on the front end UI sends the file using AJAX, we'll use the Formidable module to receive the files within the NodeJS app. In this video we'll download and setup Formidable so it is able to receive files.

Setting up GraphicsMagick Library + gm for Nodejs for resizing images Preview 05:16

Before we put uploaded images into the S3 bucket, we will resize them down to a width of 300 pixels. To achieve that, we'll use the GraphicsMagick Image Processing Library along with the gm module in NodeJS which will interact with GraphicsMagick to resize the images.

Uploading resized images to the S3 using Knox Preview 05:13

In this video we'll write code which uploads files after they've been resized using GraphicsMagick to the S3 bucket using the Knox module.

Storing the file name and votes in MongoDB on MongoLab Preview 12:05

In this video, we'll create a MongoDB database on MongoLab and we'll store the name of our file and the initial vote count in a collection. Additionally we'll also delete the image file as locally stored on the server during the resizing process.

Getting images into the Photogrid gallery Preview 15:36

As Photos are uploaded, the gallery portion of our PhotoGRID website should also update to reflect all images.

Amazon Web Services | Setting up CloudFront Distribution Preview 04:19

Since we're serving image files from our S3 bucket onto our PhotoGRID gallery, we need to optimize S3 for delivery. This can be done by using Amazon's CloudFront service which turns our S3 bucket into a Content Delivery Network (CDN) that is optimized for delivery.

Creating the Vote Up Functionality & Final Testing Preview 10:50

PhotoGRID also incorporates a vote-up functionality that lets users upvote images that they like. I've kept the functionality very simple and as a matter of fact it allows you to keep clicking to increase the vote count which is unlike how it would be in a production case scenario. However, this should whet your appetite enough to build a more practical version of the vote-up functionality. We'll also test our app so its ready for deployment.

Amazon Web Services | Creating an Elastic Compute Cloud (EC2) Instance Preview 05:58

An Amazon Elastic Compute Cloud Instance (EC2) is a server in the cloud that you can easily instantiate and setup. It comes with an OS of your choice with full root access to let you install, and setup virtually anything. In this video, we'll spin up our EC2 instance in preparation for deploying our NodeJS App.

Amazon Web Services | Installing NodeJS on EC2 Preview 04:38

To run NodeJS apps, we need to install NodeJS on our EC2 instance. This video shows you how.

Amazon Web Services | Creating an Elastic IP for your EC2 Instance Preview 03:11

So far we've been accessing the EC2 instance using a public DNS which can change if the server is restarted. To ensure we're able to access the server, we'll setup an Elastic IP which binds our server to a fixed IP address. This ensures that even if we restart our EC2 instance, we would still be able to access the server using the fixed IP provided to us by Elastic IP.

Amazon Web Services | Installing the Photogrid App on the EC2 Instance Preview 06:55

And the big moment arrives when we finally deploy the PhotoGRID app on our EC2 instance !

Amazon Web Services | Security Group, Ports & Port Forwarding Preview 14:07

Before we can access the NodeJS app, we need to setup our security group, open ports and ensure that Port 80 (HTTP) forwards to our PhotoGrid NodeJS App typically running on Port 3000.

Important :: It should be noted that practically speaking, we should use NGINX Web Server as a front facing server that routes requests from Port 80 to Port 3000 on the NodeJS app through reverse proxying requests. This is demonstrated exclusively in the next section in this course. For now, I've kept the deployment easy to understand by simply forwarding Port 80 to Port 3000.

Amazon Web Services | Ensuring the Photogrid app runs automatically Preview 07:17

Imagine a situation where your EC2 instance reboots. This would mean that the NodeJS app would not come back online since so far we've been launching it manually from the terminal. We'll correct this in this video by making sure the app runs automatically when the server starts up.

What are we talking about ? Preview 03:38

The Awesome Cloud9 IDE Preview 07:12

Cloud9 combines a powerful online code editor with a full Ubuntu workspace in the cloud.

Spinning a Droplet on Digital Ocean & Using Cloud9IDE Preview 07:31

Digital Ocean has become the third fastest growing Cloud Hosting provider in the world and is competing directly with the biggies such as Amazon. Digital Ocean has been designed with developers in mind and gets you up and running in no time with no complexity involved at all.

Installing Nginx Preview 01:38

NGINX is a super fast Web Server, Proxy Server and a Load Balancer, all rolled into one. By placing NGINX infront of your NodeJS apps, you can deliver static assets such as images, css files and javascript files directly without routing them through the Node app which negatively affects performance. In this video, we'll install NGINX on our Digital Ocean server instance (Droplet)

Nginx as a Proxy Server for NodeJS Preview 07:55

By using NGINX as a reverse proxy server for our NodeJS app, we get optimum performance because NGINX takes over serving static files including caching.

Uploading and Reconfiguring ChatCAT to work with Nginx Preview 06:02

In this video we'll install our good old ChatCat on the Digital Ocean Server using NGINX as a reverse proxy. Download the accompanying archive that contains a slightly modified ChatCAT App that is ready to be installed on the Digital Ocean instance.

Load Balancing with NGINX Preview 03:59

A Load Balancer distributes the incoming user traffic over a cluster of servers so as not to overload a single server instance. NGINX is a terrific load balancer that is super easy to configure. In this video, I'll show you to how to configure NGINX when using it as a Load Balancer.

Introduction to Enterprise Integration Preview 10:56

Enterprise integration refers to the process of getting software across a gamut of platforms and servers to talk and share data with each other.

The task at hand Preview 07:56

In this video, we'll setup base and foundation for an example Node.js app that we'll write in this section that demonstrates interoperability between a Node.js app and a Python script. This is going to be purely for demonstration purposes only and this process can be adapted to any scenario.

Installing Python dependencies on a Mac Preview 02:41

This section uses a provided Python script. This video shows you to how to set it up on a Mac (OS X Yosemite)

Installing Python dependencies on Windows Preview 03:02

This section uses a provided Python script. This video shows you to how to set it up on a PC running Microsoft Windows 10

Installing Apache Apollo on a Mac Preview 06:27

Apache Apollo is the next generation of Apache ActiveMQ, one of the most popular message queue solutions out there. In this video, you'll learn how to set it up on a Mac (OS X Yosemite)

Installing Apache Apollo on Windows Preview 05:35

Apache Apollo is the next generation of Apache ActiveMQ, one of the most popular message queue solutions out there. In this video, you'll learn how to set it up on a PC running Microsoft Windows 10

Configuring Apache Apollo | Users and Queues Preview 03:42

Once installed, we'll configure Apache Apollo to create our users and designate queues or channels which will carry our data to and from the Python script.

Introduction to the Hapi Framework Preview 06:08

Hapi is an amazing enterprise grade Node.js framework from Walmart Labs.

Hello Hapi and a bit of ES6 Preview 10:34

Set up your first app using the Hapi framework.

More about arrow functions on Youtube : Coming up on Monday, 5th October.

Writing the Core Plugin | Routes & Views Preview 16:38

In this video, you'll setup your core plugin which will contain all the functionality and routes related to this app.

Setting up Socket.io Preview 13:13

Our good old Socket.io is always there. Learn how to set it up with Hapi.

Setting up the Stomp Client & Storing Access Credentials Preview 10:22

In this video, we'll setup the Stomp client which will enable our Hapi app to talk to Apache Apollo. We'll also learn how to use dot files to store access credentials including how to do it in the correct way.

The 'Process' Button State Preview 09:03

The only button in our app can be enabled or disabled based on the state of the app and data. This video shows you how.

Core Functionality : The Workflow Preview 04:02

Before you dive into code and nail down the core function of this app, try and understand how it works in the first place.

Core Functionality : The Code Preview 16:31

In this video, we'll code our app's core functionality.

UPDATE : Fixing the Array.observe() deprecation issue Preview 08:47

Fixing data retrieval on a page refresh Preview 05:09

In this video we'll fix a tiny issue which occurs when the user refreshes the page in the browser after we've received all the data back from Apollo.

Logging using Hapi Preview 07:12

Logging and Process Monitoring is essential for server level apps. In this video, we'll examine how Hapi plugins allow you to log events and errors to a file.

Summary Preview 02:29

Thank You :)

Recommended Reading & Resources Preview 1 page

BONUS : Join my inner circle of friends! Preview 00:18