EIEIOTECHNOVATION
← Training programmes

EIEIO / AUTOMATION & EMERGING TECHNOLOGY

Nodejs

Course outline

3 days

Duration

3 days

Overview

Technology will never stand still. After 20 years of stateless web technology, solutions like Gmail and Facebook has inspired real-time websites with push capability. These real-time web applications are employing push technology over web sockets. Web solutions are being pushed to handle huge number of simultaneous connections with high throughput, which equates to high scalability. These connections are from various types of devices like mobile phones, IOT devices as well as the normal PC browsers.

Node.js shines in real-time web applications employing push technology over web sockets. Finally the Node.js technology allows us to have web applications with real-time, two-way connections, where both the client and server can initiate communication, allowing them to exchange data freely. Node really shines in building fast, scalable network applications, as it’s capable of handling a huge number of simultaneous. Compared to traditional web-serving techniques where each connection (request) spawns a new thread, taking up system RAM and eventually maxing-out at the amount of RAM available, Node.js operates on a single-thread, using non-blocking I/O calls, allowing it to support tens of thousands of concurrent connections.

Understanding the fundamental concepts of Node.js is very important for a fulfilling career in this area, even for those who are not working directly in this industry. For example a basic grasp of the subject area will enable a project manager to appreciate the technical challenge faced in the project or help a mechanical engineer understand why the circuit designer insists on specific technical decision.

With this objective in mind, this course is designed to equip participants with both foundation knowledge and broad appreciation of each underlying application, and therefore increased interest and confidence for their future undertaking. The subject is delivered with minimal complex equations, stressing on practical applications instead.

After over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections.

Prerequisites

Before attending this course, students should have general programming experience and knowledge of HTML and CSS.

Course Topics

Day 1

  • Introduction to "Modern (ES5)" JavaScript
  • Basic language features
  • JavaScript types: Number, String, Boolean
  • Variable declaration using let
  • Operators – arithmetic, assignment, comparison
  • Decision Making – if, else, switch case, double equal ==, triple equal ===
  • Loops – for, while, do ... while
  • Arrays, iterating arrays using for … in
  • Functional Programming
  • Functions
  • Returning functions
  • Parameterized functions
  • Default function parameters
  • REST parameters
  • Anonymous functions and IIFE
  • Function constructor
  • Lambda functions
  • Lambda statement
  • Lambda expression
  • Function hoisting
  • Generated functions
  • Object Oriented Programming - OOP
  • Java Script Objects
  • Object creation – Literal method, Using Object, Function constructor
  • Properties, Methods
  • Comparing Objects
  • Object de-structuring
  • JavaScript call, apply and bind
  • Class
  • Creating Objects
  • Constructor
  • Inheritance
  • Method Overriding
  • Built-in Objects
  • String
  • Date
  • Math
  • Collections – Map, Set
  • Promise
  • Importing a module
  • Exporting a module
  • Error Handling
  • Syntax Errors
  • Runtime Errors
  • Logical Errors
  • Throwing Exceptions
  • Exception handling
  • Custom Errors
  • Node Projects
  • The JavaScript Repository
  • Node Package Manager (NPM)
  • Creating a JavaScript project
  • The package.json configuration file
  • Installing Packages Global
  • Installing Packages Locally
  • Adding dependency in package.json
  • Scripting through package.json
  • Webpack Project

Day 2

  • HTTP
  • The HTTP protocol
  • Creating web server
  • Handling http requests
  • Sending requests
  • Building an HTTP server
  • Rendering a response
  • Processing query strings
  • Using Representational State Transfer
  • Node JS Console
  • Configuring TLS
  • File System
  • Synchronous I/O vs. asynchronous I/O
  • Path and directory operations
  • __dirname and __filename
  • Synchronous file reads
  • Synchronous file writes
  • Asynchronous file reads using Promises
  • Asynchronous file writes using Promises
  • Buffers, Streams, and Events
  • Using buffers for binary data
  • Flowing vs. non-flowing streams
  • Streaming I/O from files and other sources
  • Processing streams asynchronously
  • Configuring event handlers
  • Modules and Unit Testing
  • Modularization
  • The CommonJS and RequireJS specifications
  • Defining modules with exports
  • Modules are singletons
  • Creating a package
  • Module scope and construction
  • Unit testing frameworks
  • What to test and how to test it
  • Building unit tests with Mocha
  • Events
  • When to use Event Emitters
  • Binding Functions to Events
  • Event Requests
  • Event Listening
  • What are callbacks
  • Callback-last
  • Callbacks: Error-first
  • Errors in Event Emitters
  • Uncaught Exceptions
  • Using Domains
  • Express
  • The model-view-controller pattern
  • Defining Jade and Handlebars templates
  • Building a front-end controller
  • Defining routes
  • Creating actions
  • Configuring Express to use Handlebars
  • Using REST
  • Reading POST data
  • Building Handlebars helpers
  • Adding middleware

Day 3

  • Data Sources
  • How Node.js connects to databases
  • Configuration and platform setup
  • RDBMS databases and NoSQL databases
  • Connecting to RDBMS and NoSQL databases
  • Performing CRUD operations
  • Building client requests to web services
  • Data Modelling
  • Create Database
  • Drop Database
  • Create Collection
  • Drop Collection
  • Data Types
  • Insert Document
  • Query Document
  • Update Document
  • Delete Document
  • Queries
  • Field equality tests
  • Operators available
  • Projections
  • Limiting Records
  • Paging
  • Sorting Records
  • Simple Updates and Deletes
  • Field updates
  • Field insertions
  • Field removal
  • Document deletion
  • Existential field values
  • Socket Programming
  • Network Structure
  • Classifications and Topologies
  • Switching and Routing
  • Gateway, Repeater, Hub, Bridge
  • OSI & TCP/IP Protocol Layers
  • Physical & Logical Addresses
  • ARP & RARP Networking and TCP/IP Applications
  • Internet Protocol
  • Routing Protocol and IP Datagram
  • Error and Control Messages (ICMP) UDP
  • Transfer Control Protocol
  • TCP Networking Applications
  • (FTP, TFTP, TELNET, DNS, DHCP, SNTP, POP3, IMAP, SNMP)
  • Creating a REST API with Node.js

Introduction

  • Setting up Node Project with MongoDB for API
  • Adding Data (POST requests in Node)
  • Retrieving Data (GET requests in Node)
  • Updating Data (PUT requests in Node)
  • Deleting Data (DELETE requests in Node)
  • Authentication and Security
  • Setting up our User Model for Authentication in Node
  • Authentication Middleware and Securing Resources in Node

Programme scope, delivery arrangements and suitability are confirmed during enquiry.