NodeJS MongoDB Express and JavaScript Course

New 13+ Hour NodeJS MongoDB Express and JavaScript Course

NodeJS is built for performance.   NodeJS allows you to build complex and powerful application quickly and easily writing JavaScript code.  NodeJS allows you to use JavaScript for not only web applications with the flexibility for a wide range of different purposes.  Node brings JavaScript to the server, using Googles V8 engine.   

Node PDF Guide

Top Reasons for using Node.JS 

  • In Demand Skillset – used by popular and large businesses
  • NodeJS is written in JavaScript which makes the transition to Node take less time if you are already familiar with JavaScript.
  • Perfect solution for a full stack developer dealing with backend and databases
  • JavaScript is easy to start with a write code and run code within your own computer
  • Easily to develop locally
  • Open Source with an active community and support
  • Node Package Manager can allow you to create complex applications using existing modules, NPM has a massive number of packages.
  • Node is well supported, large size community and many forms and groups to share code and get help
  • Can be used to build micro services

Final Project in Section #6

Creating a fully functional node application, that uses Express to run a web application.  Connect to a MongoDB and using Node allow the frontend web application to access the Database items, full CRUD interaction.

  1. Create a web application using Express – output html file from public folder
  2. Setup a MongoDB in the cloud prep to connect using NodeJS
  3. Create and test insert into the database
  4. Setup Frontend web application
  5. Add DOM event listeners to trigger requests
  6. Generate visual response as HTML from the Node response object
  7. Update and create interactive list of database content CRUD
  8. Add HTML updates to send requests to database.

Create (POST)

Read (GET)

Update (PUT)

Delete (DELETE)

#1 Introduction to Installing and Setup of Node

This section is a fast paced quick intro to NodeJS, and how you start using NodeJS.   We discuss what NodeJS is and that it is not a programming language like JavaScript is but an interpreter and Environment for JavaScript.   

Node is a lightweight framework developed on Chrome’s V8 engine that can be used for largeScale application development.   It’s scalable because the server can respond in a non-blocking way.   

Process object which is a global that provides information, and control over, the current Node.js process. Because its global it is always available to Node.js applications without using require()

npm registry contains packages, many of which are also Node modules, or contain Node module

  1. Demo how to setup your development environment setting up Editor
  2. Visual Studio Code as an Editor with ready terminal
  3. Creating your first Node File and running the code
  4. How Node Works and examples of simple node syntax
  5. Where you can find out more about Node with more examples.
  6. How to debug and output content into the terminal various command line and console outputs
  7. NodeJS programming language environment REPL Read Evaluate Print Loop
  8. Examples of Node
  9. Process Object – with examples
  10. What Node Packages and NPM

#2 JavaScript Fundamentals quick review of JavaScript Coding

Explore the fundamentals of JavaScript and writing JavaScript code within the Node.   Loaded with examples about the basics of coding JavaScript.   Back to the basics of JavaScript code .  Because node uses JavaScript code this section will provide a refresher and quick overview of JavaScript.   Designed to cover the core JavaScript required for the upcoming sections and writing Node.

  1. Variables and the Data Types.  How to declare variables and examples of different Data Types.
  2. Adding Comments to code
  3. How to create Objects and Array
  4. What JavaScript Functions are and how they work
  5. Advanced Functions Immediately invoked Function Expression IIFE, Arrow format for functions, JavaScript Closure example
  6. Different JavaScript operators and examples
  7. Use of conditions for logic, turthy and falsey.  How to use the  Ternary Operator.
  8. Examples of logic switch statement, and condition statement
  9. JavaScript loop Structures For Loop, While Loop, DO-While Loop with code examples
  10. Use of Objects and objects with methods.
  11. JavaScript Arrays, adding, updating and removing items from an array. lots of commonly used useful array methods for array manipulation.
  12. Array and Object Values, iterating through the contents of each.
  13. Use of Template literals to set string values
  14. Math and Data Method examples, generating random numbers and dates in JavaScript
  15. Global object in Node with the use of timeout
  16. Event Queue and Asynchronous operations with JavaScript
  17. Examples of JavaScript Node Timer module
  18. How to Construct promises and Resolve and Reject Promises
  19. Debugging – use of Try, Catch, Finally which are used to handle exceptions in the JavaScript
  20. JavaScript Async and Await examples and how the order of output on promise completion.

#3 JavaScript Asynchronous programming

Asynchrony, in computer programming, refers to the occurrence of events independent of the main program flow and ways to deal with such events. How to add callbacks that run once a stack is complete.

Covering Input Output which accesses anything outside the application.  Once the application is started it will be loaded into the machine memory.

Coding Examples, and practice code outputting into the console when ready

Event Driven programming which makes Node.js fairly fast compared to other similar technologies.  Once the application starts it initiates its variables, declares its functions and then waits for the event to occur. 

The two types of API functions in Node.js, Asynchronous, non-blocking functions and Synchronous, blocking functions. 

The differences difference between blocking and non-blocking calls in Node.js. 

Blocking occurs when the execution of additional JavaScript in the Node.js process must wait until a non-JavaScript operation completes. The event loop is unable to continue running JavaScript while a blocking operation is occurring.  All the IO methods in node.js provide asynchronous versions, which are non-blocking.

Node keeps an event loop, which monitors when a task gets completed, which would then fire the corresponding events.  Node.js overcomes the problem of blocking of I/O operations by using the event loop instead of threads.

Recursive functions, Function that calls itself is called a recursive function – must have a condition to break the loop.

The EventEmitter module makes possible the communication and interaction between objects in Node.  EventEmitter provides properties like on and emit. The on property is used to bind a function with the event and emit property is used to fire an event.

  1. NodeJS works on the Google v8 environment utilizing JavaScript as its scripting language.
  2. How a callback works, Callback added to the background will run once stack is complete
  3. Use of setTimeout and how it works in the queue.
  4. Callback example Create a function that returns the results from another function
  5. Event Loop with an Example of a Recursive Function
  6. The three states of promises
  7. How to create promises and more promises examples
  8. Node process object
  9. Node Event EventEmitter
  10. how to setup events and trigger emit of events

#4 Node Modules

Each module in NodeJS has its own context and cannot interfere with other modules.  Modules are like libraries that you can include into your application.  Node.js has a set of built-in modules which you can use without any further installation like http, fs, path, and url.   

You can create your own modules, and easily include them in your applications. Save them locally and use within your node application as needed.  Perfect to separate functionality for your application. To make properties and methods available outside the module file use the keyword exports.

NPM hosts thousands of third party modules, free packages to download and use.  A package in Node.js contains all the files you need for a module.

Debugging – The try…catch statement marks a block of statements to try and specifies a response should an exception be thrown.

  1. How you can create your own module locally
  2. Commonly used builtin modules like http, fs, path and url
  3. Using FS module to update file contents, delete files, create new files
  4. Getting file information including file size with fs.stat()
  5. Use of node package manager NPM explore some popular node packages.
  6. Use of package.json – adding and removing packages
  7. Node Package Manager Module lodash
  8. Node Buffers how to copy and slice buffer contents
  9. Debugging node use of Throw, try and catch

#5  Node Web Application with Express

Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.  Explore how to setup a web application quickly with Express. 

The arguments which are available to an Express JS route handler function are request (request Object), response (response Object) and optional Next which can pass control to one of the subsequent route handlers.

  1. How to setup express and output html into a localhost webpage
  2. How to Serve files from  a static directory using Express
  3. Values that can be used in route filtering, pattern match and reg exp
  4. Route parameters with req.params
  5. Express Route with full CRUD Create Read Update Delete Methods
  6. Returning JSON response
  7. Use of bodyparser
  8. Sending data from a frontend form to node express to output into the terminal
  9. Returning a JSON response to the frontend from a frontend request

#6 MongoDB with Frontend web page interaction using Node and Express

The official MongoDB Node. js driver allows Node. js applications to connect to MongoDB and work with data. The driver features an asynchronous API which allows you to access method return values through Promises or specify callbacks to access them when communicating with MongoDB.

  1. How to setup a cloud base mongo Database to use in practice development
  2. Connecting to a mongoDB
  3. Use of mongoDB client in Node
  4. Checking a connection to the database
  5. How to connect to a MongoDB and select the collections, create collections
  6. How to output database collections to the frontend using Express and Node.

Creating a fully functional node application that uses Express to run a web application. Connect to a MongoDB and using Node allow the frontend web application to access the Database items, full CRUD interaction.

Leave a Comment