What topics will be covered in the course?
Introduction to Node.js
Opening Words and Course Overview:
Opening words.
What will be covered in the course and an introduction to Node.js.
Emphasis on working with code repositories.
Writing a Basic Server:
Building a simple first server.
Explanation of what a server is and handling HTTP requests and responses.
Understanding status codes and returning JSON vs. HTML.
Basic Handling of Requests:
Introduction to API server endpoints.
Defining multiple routes for handling requests.
Advanced Handling of Server Requests:
Understanding HTTP request structure.
Status codes explanation and server behavior.
Preparation for Writing a Restful API:
Introduction to Restful APIs.
Understanding QueryString and request parameters.
Working with the File System
Reading Files in Node.js:
Working with the file system module (fs).
Using the readFile function asynchronously.
Using the readFileSync function synchronously.
Introduction to fs and path modules.
Creating a server with multiple endpoints.
Saving text and JSON files.
Saving Files in Node.js:
Using the writeFile function asynchronously to write files.
Using the writeFileSync function synchronously to write files.
Handling errors in the server.
Deleting Files in Node.js:
Deleting files using unlinkSync.
Using directories in the file system.
Function to check if a file exists in the file system.
Handling POST Requests:
Basic server architecture.
Handling post requests.
Using Postman to create get and post requests.
Using Validation in the Server:
Writing a meaningful server.
Using validations and errors in the server.
Creating a server with multiple requests (read, write, delete files from the operating system).
Writing a Server with Express
Introduction to Using Express:
Background on the express library.
Using the express library to write a server.
Using send, sendStatus, and json functions.
Handling get requests.
Handling Querystring and Params:
Using req.query with express.
Using req.params with express.
Writing an admin data server using the file system.
Handling POST Requests in the Server:
Handling post requests with express.
Explanation of middleware use.
Adding number validations in the server.
Server Architecture:
Server architecture in express.
Using express.Router to handle server routing.
Adding and building controllers in the server.
Adding and building services in the server.
Using Middlewares in Express:
Understanding middlewares in express.
Properly embedding middlewares in controllers.
Writing validations using middlewares.
MongoDB
Introduction to MongoDB:
Introduction to databases.
Differences between relational and non-relational databases.
Introduction to MongoDB and common use cases.
Connecting the express server to MongoDB.
Introduction to using the mongo GUI.
Saving and Retrieving Records:
Defining schemas and going over common types.
Creating a record in MongoDB with the save function.
Searching for records in MongoDB using the find function.
Using common filters such as gte$, $gt, $lte, $lt, and eq$.
Advanced Queries in MongoDB:
Understanding the ObjectId identifier.
Explanation of the toJSON function.
Using findById query in MongoDB.
Updating records using findByIdAndUpdate.
Using the inc$ operator.
Using the count function in MongoDB.
Defining default values for the schema in MongoDB.
Deletion Queries and Basic Operators:
Deleting records using findByIdAndDelete.
Using the push$ operator.
Handling server failure requests (500).
Advanced Aggregations in MongoDB:
Building an advanced pipeline and using aggregations.
Sorting data in MongoDB queries.
Using common operators such as sum, $max, $min, and avg$.
Advanced Relationships Between Collections in MongoDB:
Explanation of connecting collections using ref.
Using the populate action in MongoDB.
In-depth explanation of creating an id in MongoDB.
Server Security with Authentication
Introduction to JWT:
Background on server security.
Introduction to the jsonwebtoken package.
Creating the first token.
Using the verify function to check the validity of the token.
Writing a Secure API:
Adding a security layer to the server.
Building Middleware for server security.
Implementing security with JWT on the server we write.
Using the Crypto Library:
Background on using encryption in the server.
Explanation of hash functions for password hashing.
Adding salt to the schema for enhanced security.
Explanation of possible attacks.
Communication Between Servers:
Using the axios library for server communication.
Fetching data from another server through the server we write.
Storing data in MongoDB for data fetched from an external server.
Closing Words:
Closing words to summarize the course.