Repository contains concepts and code related to Node JS (Vanilla Node, Express Framework, REST APIs, GraphQL, Websockets & More...) & Deno, both as a Runtime Environment.
- NodeJS Course by Maximilian Schwarzmüller
- NodeJS Documentation
- Ben Awad's Fullstack Tutorial on YouTube
- What is NodeJS?
- Software Requirements
- Compiler Details
- Role & Usage of NodeJS
- Node Lifecycle & Event Loop
- Running NodeJS + TypeScript
- NodeJS — Behind the Scenes: Single Thread, Event Loop & Blocking Code (Deep Dive) 🌟✨ — MUST READ!
- Event Loop, Timers & process.nexttick - Official NodeJS Docs
- Don't Block the Event Loop - Official NodeJS Docs
- The Concept of Middleware
- What's the Model-View-Controller Architecture?
- Why Databases? ⭐ Must Read
- SQL v/s NoSQL Databases ⭐ Must Read
- Introduction
- Understanding Basics
- Express Framework 🚅🌪💨
- Dynamic Content & Templating Engines
- Models Views & Controllers
- Dynamic Routes & Advanced Models
- Databases — Prerequisites
- SQL Introduction
Contents of this section are in node-first-app directory.
- First NodeJS App: Commit Details
- Writing to a new file using
fsmodule withfs.writeFileSync()method (Basic Intro): Commit Details
Contents of this section are in understanding-basics directory.
- Creating a Node Server: Commit Details
- The Node Lifecycle & Event Loop: READ THIS BEFORE MOVING AHEAD | Commit Details
- Understanding the
requestobject (request.url,request.method&request.headers): Commit Details - Sending Responses using
response.write()&response.end(): Commit Details - Diving deeper into the
requestobject- Routing Requests using
request.url: Commit Details - Redirecting Requests
request.url && request.methodby usingfs.writeFileSyncalong withresponse.writeHead()(orresponse.setHeader()/response.statusCode) to write a to a file on a specific route: Commit Details - Parsing Request Bodies using
request.on('data'),request.on('end')&Buffer.concat(): READ THIS BEFORE GOING AHEAD | Commit Details
- Routing Requests using
- Understanding Event Driven Code Execution ⭐
- Blocking —
writeFileSync()& Non-Blocking —writeFile()Code: Commit Details - NodeJS — Behind the Scenes: Single Thread, Event Loop & Blocking Code (Deep Dive) 🌟✨ — MUST READ!
- Using the Node Modules System —
exports&imports(ES5/ES6+): Commit Details - Assignment I: Solution - I && Solution - II (revision)
- Debugging using VS Code's NodeJS Debugger: Commit Details 🌟
Contents of this section are in working-with-express directory.
- Prerequisite: A Basic Setup: Commit Details
- Installing Express & Using
express(): Commit Details - Adding Middleware using
app.use(): Commit Details - How Middleware Works: Commit Details
- Express.js — Looking Behind the Scenes: Commit Details
- Handling Different Routes: Commit Details
- Assignment II: Solution && Solution-II (revision)
- Parsing Incoming Requests using
express.urlencoded({ extended: false })(or,bodyParser[deprecated]) passed toapp.use()middleware: Commit Details - Limiting Middleware Execution to POST/GET Requests Using
app.get()&app.post(): Commit Details - Using Express Router using
express.Router(): Commit Details - Adding a 404 Error Page using
res.status(400).send(): Commit Details - Filtering & Grouping Routes/Paths Logically: Commit Details
- Creating HTML Pages: Commit Details
- Serving HTML Pages using
path.join()&__dirname: Commit Details - Returning a 404 Error Page: Commit Details
- Using a Helper Function for Navigation using
path.dirname(require.main.filename): Commit Details - Styling HTML Pages: Commit Details
- Serving Files Statically using
express.static()middleware: Commit Details - Assignment III: Solution && Solution-II (Revision) 📜
Contents of this section are in dynamic-content-templating-engines directory.
- Basic Setup: Commit Details
- Sharing Data Across Requests & Users: Commit Details
- Templating Engines: Commit Details
- Templating Engines:
- Installing Pug, Handlebars & EJS:
- Packages:
npm i --save pug express-handlebars ejs - TypeScript Support:
npm i -D @types/pug @types/express-handlebars @types/ejs
- Packages:
- Pug — Minimalist Syntax 🐶 [Supported in Express Out of the Box]:
- Using the Pug Templating Engine: Commit Details 🌟
- Outputting Dynamic Content Using Pug Templates —
each,if,else&#{<object_name>}: Commit Details & Commit Details - Fixed.activeclass bug - Converting Remaining HTML files to Pug templates: Commit Details
- Adding a Base Layout using
blocks & Extending that Layout to other templates usingextends <layout-name>: Commit Details - Finishing the Pug Template by adding conditional
.activeclassproperty to elements in templates: Commit Details
- Handlebars — Templating language syntax similar to HTML, but keep the logic separate from the view 👨🏾 [No Support from Express]:
- Working with Handlebars: Commit Details
- Converting our Project to Handlebars: Commit Details
- Adding the Layout to Handlebars: Commit Details
- EJS — Closest to JS, Simple Syntax & HTML like syntax 📜⭐[Supported in Express Out of the Box]
- Working with EJS: Commit Details
- Working on the Layout with Partials/Includes using
<%- include(<path>) %>: Commit Details
- Assignment IV:
- Solutions using Pug Template Engine:
- Solution-I && Commit Details
- Revision — Solution-II && Commit Details
- Solutions using Handlebars Template Engine:
- Revision — Solution-I && Commit Details
- Solutions using EJS Template Engine:
- Solution-I && Commit Details
- Revision — Solution-II && Commit Details
- Solutions using Pug Template Engine:
- Installing Pug, Handlebars & EJS:
Contents of this section are in model-view-controller directory.
- What's MVC? ⭐⭐
- Adding Controllers: Previous Setup -> What needs changing? -> Moving Core Logic to
controllersdirectory - Adding all other controllers — controller for error 404 route: Commit Details
- Adding a
ProductModel usingSingleton Pattern: Commit Details - Storing Data (Model) in Files via the
fs.readFile()andfs.writeFile()functions: Commit Details - Restructuring the directory structure for online shop application: Commit Details 🌟🌟
- Working on the Navigation — Adding New Links: Commit Details
- Registering Routes for New Navigation Items: Commit Details
- Letting the User Add More Fields (vis.
Image URL,Price&Description) & Storing that Data: Commit Details - Displaying Product Data: Commit Details
- Preparing for Editing & Deleting Products: Commit Details
- Adding another view/route: Commit Details
Contents of this section are in dynamic-routes-advanced-models directory.
- Basic Setup: Commit Details
- Adding Product ID to the Query Path: Commit Details
- Dynamic Routes (Eg:
/products/:productId) & Extracting Dynamic Params usingreq.params.productId: Commit Details - Loading Product Details Data: Commit Details ✨✨ — Many concepts covered!
- Rendering the Product Detail View: Commit Details
- Passing Data with
POSTRequests: Commit Details - Adding a Cart Model: Commit Details ✨✨✨ V.V.Imp Section — Understand this before moving on!
- Accessing Query Parameters in Controllers using
request.query- Rendering the Edit Page Manually: Commit Details
- Pre-populating the Edit Product Page w. Data: Commit Details
- Linking to the Edit Page — Reaching Edit Product Page through
Editbutton on the respective product: Commit Details ⭐ - Updating Product Data Model to Enable Editing Product Data: Commit Details
- Adding the Product Delete Functionality
- Changes in Product Model: Commit Details
- Deleting Cart Items i.e., Changes in Cart Model: Commit Details
- Fixing Edit Product Bug In Relation to Cart Pricing: Commit I - main & Commit II - for-of loop to reduce function change — ⭐⭐ focus on
save()changes && new methods in bothProductandCartmodels
Contents of this section are in db-intro directory.
- Why Databases? ⭐ Must Read
- SQL v/s NoSQL Databases ⭐ Must Read
Contents of this section are in sql-sequelize directory.
- Initial Setup of MySQL on Ubuntu 18.04
- Connecting Our App to the MySQL DB & Basic Retrieval: Commit Details;
- Basic Retrieval & Updation from Tables using
mysql2: Commit Details