Unit - 3 - Web Development With MERN Stack Using DevOps

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 126

Noida Institute of Engineering and Technology, Greater Noida

Web Development with MERN


Stack using DevOps

Unit: 3

Nodejs & Express Framework Srishti Dikshit


(Asst. Professor)
Course Details CSE (AIML)
(B. Tech. 6th Sem) Department

Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Faculty Introduction

Name Srishti Dikshit


Qualification M. Tech. (Computer Science & Engineering)
Designation Assistant Professor
Department Artificial Intelligence & Machine Learning
Total Experience 3.5 years
NIET Experience 2 months
Subject Taught Cyber Security, Computer System Security, Data Compression,
Soft Computing, Web Technology.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Evaluation Scheme

Srishti Dikshit Web Development using MERN Stack with DevOps


Sunday, May 19, 2024 Unit III
Overview of frameworks, N P M commands,SyllabusReact App, Project
Directory Structure, React Component Basic, Understanding JSX,
Props andUNIT-I:
State, Stateless and Stateful
Introduction Components,
to React JS C omponent
life cycle, Hooks, react-router vs react-router-dom.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Google Material UI, AppBar, Material UI's Syllabus
Toolbar, NavBar, Material
UI Buttons, SQL and Complex Transactions, Dynamic S chema,
create Index (), get Indexes
UNIT-II: () & drop
Connecting Index
React with(), Statement-based
mongo dB vs.
Binary Replication, Auto-Sharding and Integrated Caching, Load
balancing, Aggregation, scalability.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Syllabus
Introduction, Environment Setup, Serving static resources, Template
engine with vash and jade, Connecting Node.js to Database,
Mongoose Module,Node
UNIT-III: Creating Rest APIs, Express Framework,
js & Express
M VC Pattern, Routing,
Framework Cookies and Sessions, HTTP Interaction,
User Authentication.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Sunday, May 19, 2024
DevOps Principles, DevOps Lifecycle, DevOps Tools, Benefits of
Syllabus
DevOps, S D LC models, Lean, ITIL and, Agile Methodology, Agile vs
DevOps, Process flow of Scrum Methodologies, Project planning,
scrum testing, sprint Planning
UNIT-IV: EVOLUTION and Release management,
OF DEVOPS js Continuous
Integration and Delivery pipeline.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
GitHub, Introduction to Git, Version control,Syllabus
Jenkins Introduction,
Creating Job in Jenkins, Adding plugin in Jenkins, Creating Job with
Maven & Git, Integration of j Unit testing, Sonar, Dockers,
U N I T- V: C I / C D C o n c e p t s ( G i t H u b ,
Containers Image How to run, pull and push containers, Container
Jenkins, Sonar)
lifecycle, Introduction to Kubernetes.

Srishti Dikshit Web Development using MERN Stack with DevOps


Sunday, May 19, 2024 Unit III
Branch Wise Application

1. Real time web analytics


2. Digital Advertising
3. E-Commerce
4. Publishing
5. Massively Multiplayer Online Games
6. Backend Services and Messaging
7. Project Management & Collaboration
8. Real time Monitoring Services
9. Live Charting and Graphing
10. Group and Private Chat

Srishti Dikshit Web Development using MERN Stack with DevOps


Sunday, May 19, 2024 Unit III
In this
Study how
Students semester,
to design
examine the
andstudents
advancedbuild
topics will
staticlike
as Reactjs,
wellCourse
as dynamic
Devops, webpages for
Objective
Mongodb andweb
interactive
Also webExpress
examine
applications. applications
framework and Devops for interactive web applications
that use rich user interfaces.

Srishti Dikshit Web Development using MERN Stack with DevOps


Sunday, May 19, 2024 Unit III
CO3: Identify
CO4:
CO5: Explain, the
analyze
Demonstrate benefits
and of
popular apply
DevOps
the role
over
open-source oftools
other
server-side
software
with scripting
development
features andlanguagesprocesses
liketerminology
associated Nodejs
to Gain
andused
Atperform
CO1:
CO2: theinto
Express
insights
to end
Understand
Apply the
framework. of course,
knowledge
the
the DevOps
Continuous
impactof of
ES6 the
web
that
environment.
Integration student
designing
are vital
and Continuous Course
by
to will be
database
implement
Delivery. Outcomes
able to: (COs)dB.web.
connectivity
react application
with Mongo
over the

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with D
evOps Unit III
PO6:::Conduct
PO5
PO4 The engineer
Engineering
PO1
PO2
PO3 Problem
Engineering andwill
Graduates
Design/Development
Modern Analysis
toolKnowledge
usage
Investigations society
of ofbe Program
able to:
solutions
complex problems Outcomes (POs)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with D
evOps Unit III
PO12: Individual
PO8
PO9
PO10
PO11 :Project
Life-long
Engineering
PO7 Ethics
:Environmentlearning
Graduates
Communication
andand willand
teamwork Program
be able
sustainability
management to:
finance Outcomes (POs)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with D
evOps Unit III
COs - POs Mapping

CO.K PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12

CO1 2 2 2 3 3 - - - - - - -

CO2 3 2 3 2 3 - - - - - - -

CO3 3 2 3 2 3 - - - - - - -

CO4 3 2 3 2 3 - - - - - - -

CO5 3 2 3 3 3 - - - - - - -

AVG 2.8 2.0 2.8 2.4 3.0 - - - - - - -

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Program Specific Outcomes(PSOs)
Program Specific
S. No. PSO Description
Outcomes (PSO)

1 PSO1 Understand to shows relationships and interactions


between classes or objects of a pattern.

2 PSO2 Study to speed up the development process by


providing well-tested, proven development

3 PSO3 Select a specific design pattern for the solution of a


given design problem

Create a catalogue entry for a simple design pattern


4 PSO4 whose purpose and application is understood.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
COs - PSOs Mapping

CO.K PSO1 PSO2 PSO3 PSO4

CO1 3 - - -

CO2 3 3 - -

CO3 3 3 - -

CO4 3 3 - -

CO5 3 3 - -

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Program Educational Objectives (PEOs)

Program Educational
PEOs Description
Objectives (PEOs)
To have an excellent scientific and engineering breadth so as to comprehend,
PEOs analyze, design and provide sustainable solutions for real-life problems using state-
of-the-art technologies.

To have a successful career in industries, to pursue higher studies or to support


PEOs entrepreneurial endeavors and to face the global challenges.

To have an effective communication skills, professional attitude, ethical values and a


PEOs desire to learn specific knowledge in emerging trends, technologies for research,
innovation and product development and contribution to society.

To have life-long learning for up-skilling and re-skilling for successful professional
PEOs career as engineer, scientist, entrepreneur and bureaucrat for betterment of society.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Result Analysis(Department Result & Subject Result & Individual result

Name of the faculty Subject code Result % of clear passed

Srishti Dikshit Web Development using MERN Stack with DevOps Unit
Sunday, May 19, 2024 III
Pattern of Online External Exam Question Paper (100 marks)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Pattern of Online External Exam Question Paper (100 marks)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Pattern of Online External Exam Question Paper (100 marks)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Pattern of Online External Exam Question Paper (100 marks)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Pattern of Online External Exam Question Paper (100 marks)

Srishti Dikshit Web Development using MERN Stack with DevOps Unit
Sunday, May 19, 2024 III
Prerequisite / Recap

• Students should have knowledge of Web technology and terminology.

• Knowledge of HTML, CSS and JavaScript is required.

• Knowledge of Programming languages such as C/C++/Python etc.

• Knowledge of Nodejs, Mongo dB, Java, Javascript, Angular

• Good problem-solving Skills.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit
Sunday, May 19, 2024 III
Brief Introduction about the Subject with videos

YouTube/Other Video Links


 https://youtu.be/BLl32FvcdVM
 https://youtu.be/fCACk9ziarQ
 https://youtu.be/YSyFSnisip0
 https://youtu.be/7H_QH9nipNs
 https://youtu.be/AX1AP83CuK4

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Unit III Content
• Introduction, Environment Setup,
• Serving static resources, template engine with vash and jade,
• Connecting Node.js to Database,
• Mongoose Module,
• Creating Rest APIs,
• Express Framework & MVC Pattern,
• Routing,
• Cookies and Sessions,
• HTTP Interaction,
• User Authentication

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Unit III Objective
In Unit III, students will:

• Embark on a comprehensive exploration of foundational concepts in Node.js and web application development.

• Through a dynamic progression of topics, students will master the introductory principles of Node.js, establish
efficient development environments, and harness the power of the Serving static resources, template engine with
vash and jade.

• They will grasp the significance of streams and buffers in data manipulation, learn the art of seamlessly
connecting Node.js applications to databases using the Mongoose module, and gain proficiency in creating
RESTful APIs through the expressive Express framework.

• Furthermore, students will unlock the Model-View-Controller (MVC) pattern for organized code structuring,
navigate the realm of routing to ensure seamless navigation, and delve into the vital realm of cookies, sessions,
HTTP interaction, and user authentication, fortifying their grasp of secure and interactive web application
development.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Sunday, May 19, 2024
Topic Objective

Topic: Introduction & Environment Setup

• Gain a foundational understanding of Node.js and its significance in modern web


development.

• Explore the key features and benefits of Node.js that set it apart from traditional
server-side technologies.

• Set up a conducive development environment for Node.js, including installing


necessary tools and configuring code editors.

• Learn how to navigate and work effectively within the Node.js environment.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Introduction & Environment Setup
 Node.js is a powerful and versatile open-source runtime environment built on the V8 JavaScript engine.

 It enables developers to execute JavaScript code outside the browser, on the server side, offering a
unique blend of performance, scalability, and flexibility.

 Node.js has gained popularity for its ability to handle asynchronous operations efficiently, making it
particularly suitable for building real-time applications, APIs, and microservices.

 By leveraging the event-driven, non-blocking architecture, Node.js has transformed the landscape of web
development, empowering developers to create fast and dynamic applications across various domains.

 Node.js is an open-source, cross-platform runtime environment for developing server-side and networking
applications. It is built on top of the Google Chrome V8 JavaScript engine and is mainly used to create
web servers.

 However, Node.js can also be used to build real-time applications, such as chat apps and streaming media
applications.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Introduction & Environment Setup
• Environment Setup of Node.js: Setting up the Node.js environment is a crucial initial step in harnessing its
capabilities for web development. The process involves a few essential steps:

1. Install Node.js: Begin by downloading the Node.js installer from the official website. Once
downloaded, run the installer and follow the on-screen instructions to complete the installation.
2. Verify Installation: After installation, open a terminal or command prompt and enter the command
node -v. This will display the installed version of Node.js, confirming a successful installation.
3. Node Package Manager (NPM): NPM comes bundled with Node.js and serves as a vital tool for
managing packages, dependencies, and modules. To check if NPM is installed, enter the command
npm -v in the terminal.
4. Creating Your First Application: Create a new directory for your Node.js project. Inside the directory,
create a file with a .js extension (e.g., app.js). Open the file with a code editor and start writing your
first Node.js application.
5. Running the Application: In the terminal, navigate to the project directory and run the application
using the command node app.js. You should see the output of your application in the terminal.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Introduction & Environment Setup
Here are the steps for practical on how to set up a Node.js environment:

1.Download the Node.js installer from the Node.js website.

2.Run the installer and follow the instructions.

3.Once the installer is finished, you will have Node.js installed on your computer.

4.To check if Node.js is installed correctly, open a terminal window and type the following command:
node -v
If Node.js is installed correctly, you should see the version number of Node.js printed to the console.

5.Once Node.js is installed, you need to install the Node Package Manager (NPM). NPM is a package manager for Node.js
applications.

It allows you to install third-party modules and libraries that are used in Node.js applications.
To install NPM, open a terminal window and type the following command:
npm install -g npm
This will install the latest version of NPM globally on your computer.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Introduction & Environment Setup
6.Now that you have Node.js and NPM installed, you are ready to start developing Node.js applications.
Here is a simple Node.js application that prints "Hello, world!" to the console:

const http = require('http');

const server = http.createServer((req, res) => {


res.write('Hello, world!');
res.end();
});

server.listen(3000);
console.log('Server listening on port 3000’);

To run this application, save it as app.js and then type the following command in a terminal window:

node app.js

This will start the Node.js server and listen for connections on port 3000. If you open a web browser and go to
http://localhost:3000,
Sunday, May 19, 2024 you shouldSrishti
see Dikshit
the textWeb
"Hello, world!"
Development displayed
using MERN in the Unit
Stack with DevOps browser.
III
Introduction & Environment Setup Daily Quiz
1. What is the primary purpose of version control in software development?
a) To automate the build and deployment process
b) To manage project tasks and issues
c) To track changes in source code and enable collaboration
d) To create visually appealing user interfaces

2. What is a "commit" in version control systems?


e) A unique identifier for a specific point in the project's history
f) A proposal to merge changes from one branch to another
g) A mechanism for resolving conflicts between branches
h) A directory that contains all project files

3. How do branches in version control systems facilitate parallel development?


i) They provide a way to host the project on a remote server.
j) They enable different team members to work on separate features simultaneously.
k) They automate the process of testing and deploying code changes.
l) They allow developers to track project milestones and deadlines.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Introduction & Environment Setup Daily Quiz

4. What is the significance of a pull request in version control workflows?


a) To undo a previous commit and revert to an earlier version of the code
b) To create a copy of the project's repository for experimentation
c) To propose and review changes before merging them into the main branch
d) To request assistance from other developers in resolving code issues

5. How does version control support collaboration among developers working on the same project?
e) By providing a centralized server to host the codebase
f) By allowing developers to work offline and sync changes later
g) Restricting access to the codebase only to authorized users
h) By keeping track of changes made by different developers and enabling easy integration of their work

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Introduction & Environment Setup (Questions)

1.What is Node.js, and how does it differ from traditional server-side technologies?
2.Explain the significance of the V8 JavaScript engine in the context of Node.js.
3.What are the key features of Node.js that make it suitable for building real-time
applications?
4.Describe the process of setting up the Node.js development environment on your
local machine.
5.Why is it important to verify the installation of Node.js and NPM? How can you do
so?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Serving Static Resources & Template engine with Vash and Jade

• Understand the importance of serving static resources for improving website


performance and user experience.
• Explain the purpose of template engines in dynamically generating HTML content.
• Differentiate between different template engines, specifically Vash and Jade (Pug),
and their syntax.
• Implement static resource serving using Express.js.
• Create dynamic web pages using template engines like Vash and Jade (Pug).
• Develop a strong foundation for building interactive and visually appealing web
applications.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
Serving Static Resources and Using Template Engines: Enhancing Web Applications

Serving static resources and utilizing template engines are essential techniques in web development for
creating dynamic and visually appealing web applications. These methods allow developers to efficiently
manage and present content to users while maintaining code organization and reusability.

Serving Static Resources:

1.Definition: Static resources include files such as HTML, CSS, JavaScript, images, and other assets that do not
change dynamically based on user interactions.

2.Static Resource Server: Web servers can be configured to serve static resources directly to clients without
processing them. This improves performance by reducing server load.

3.Benefits: Serving static resources from dedicated servers or content delivery networks (CDNs) can
accelerate page loading times and enhance user experience.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
Template Engines:

1.Definition: Template engines allow developers to create dynamic HTML content by embedding placeholders
(variables) within templates. These placeholders are later replaced with actual data before rendering the content.

2.Dynamic Content: Template engines facilitate the generation of HTML with dynamic content, such as user-
specific data or database-driven information.

3.Code Reusability: Template engines promote code reusability by separating logic from presentation, enabling
developers to focus on functionality while designers focus on the layout.

Using Vash and Jade (now Pug) Template Engines:

4.Vash: Vash is a template engine for Node.js that supports the creation of dynamic HTML. It uses simple syntax
and allows for easy integration with Express.js.

5.Jade (Pug): Jade, now known as Pug, is another popular template engine for Node.js. It employs indentation-
based syntax and offers concise and expressive templates.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
Serving static resources in Node.js is the process of making static files, such as images, CSS, and JavaScript,
available to users. This is typically done by creating a directory for static files and then configuring your web
server to serve those files from that directory.

There are a variety of ways to serve static resources in Node.js. Here are a few popular options:
• Express is a popular web framework for Node.js that includes support for serving static resources. To
serve static resources with Express, you can use the express.static() middleware.

• Hapi is a lightweight framework for Node.js that includes support for serving static resources. To serve
static resources with Hapi, you can use the server.route({ path: '/static/*', file: { path:
'./public' } }); method.

• Fastify is a high-performance framework for Node.js that includes support for serving static resources.
To serve static resources with Fastify, you can use the fastify.addStatic() method.

The best way to serve static resources in Node.js will depend on your specific needs and requirements. If you
are not sure which method to use, you can consult with a Node.js developer or architect.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
The benefits of serving static resources in Node.js:

•It is easy to do.

•It is scalable.

•It is secure.

•It is efficient.

The challenges of serving static resources in Node.js:

•It can be difficult to manage large numbers of static files.

•It can be difficult to cache static files.

•It can be difficult to secure static files.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
The benefits and challenges:

 If we are not sure if we are ready to serve static resources, you can start with a simple solution, such as using
the express.static() middleware. As the application grows and matures, we can then implement a more
complex solution, such as using a content delivery network (CDN).

 Vash and Jade are two popular template engines for Node.js. Template engines are used to generate HTML
from templates. This can be useful for creating dynamic web pages that are personalized for each user.

 Vash is a lightweight template engine that is easy to learn and use. It is also very fast, making it a good choice
for high-traffic applications. Jade is a more powerful template engine that offers a wider range of features.
However, it is also more complex to learn and use.

 The best template engine for you will depend on your specific needs and requirements. If you are looking for
a lightweight and easy-to-use template engine, Vash is a good choice. If you need a more powerful template
engine with a wider range of features, Jade is a good choice.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
Example of Using Template Engines (Pug):

html
head
title My Web Page
body
h1 Welcome to #{pageTitle}
p This is a dynamic web page using Pug template engine.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade

Example of Serving Static Resources (Express.js):

const express = require('express');


const app = express();

// Serve static resources from the 'public' directory


app.use(express.static('public'));

app.get('/', (req, res) => {


res.render('index', { pageTitle: 'My Page' });
});

app.listen(3000, () => {
console.log('Server is running on port 3000');
});

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade
Benefits of using template engines in Node.js:
• They can help you to create dynamic web pages that are personalized for each user.
• They can help you to save time and effort by automating the process of generating HTML.
• They can help you to improve the performance of your application by caching templates.
• They can help you to improve the security of your application by preventing XSS attacks.

Challenges of using template engines in Node.js:


• They can be complex to learn and use.
• They can be difficult to debug.
• They can be a security risk if not used properly.

If you are considering using template engines in Node.js, it is important to weigh the benefits and challenges
carefully. If you are not sure if you are ready to use template engines, you can start with a simple template
engine, such as Vash. As your application grows and matures, you can then implement a more complex template
engine, such as Jade. Serving static resources and employing template engines are fundamental techniques that
contribute to creating engaging and user-friendly web applications. By efficiently handling static assets and
generating dynamic content, developers can deliver appealing and interactive experiences to users.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Serving Static Resources & Template engine with Vash and Jade

1. What are static resources in web development?


a) Resources that change dynamically based on user interactions
b) Files like HTML, CSS, images, and JavaScript that do not change dynamically
c) Resources used exclusively by content delivery networks (CDNs)
d) Dynamic data fetched from databases

2. How does serving static resources from dedicated servers or CDNs impact web performance?
e) It slows down page loading times
f) It has no impact on performance
g) It accelerates page loading times and improves user experience
h) It requires additional server processing for each resource

3. What is the primary purpose of a template engine in web development?


i) To serve static resources efficiently
j) To create dynamic HTML content by embedding placeholders in templates
k) To manage user authentication
l) To handle server-side scripting languages

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Serving Static Resources & Template engine with Vash and Jade

4. Which template engine was previously known as "Jade" and is now called "Pug"?
a) Mustache
b) Handlebars
c) Vash
d) Pug

5. How does Vash or Jade (Pug) template engine improve code organization in web applications?
e) It replaces the need for CSS styles
f) It separates logic from presentation, promoting code reusability
g) It automatically generates database schemas
h) It serves as a content delivery network (CDN)

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Serving Static Resources & Template engine with Vash and Jade

1. How does serving static resources from a content delivery network (CDN) contribute to faster web page loading
times?
2. Explain the term "template engine" and discuss its role in generating dynamic content.
3. Compare and contrast Vash and Jade (Pug) template engines in terms of syntax and features.
4. Describe the steps involved in using Express.js to serve static resources. How does it enhance website
performance?
5. Provide an example of a scenario where dynamic content is needed on a web page. How could a template
engine like Jade (Pug) fulfill this requirement?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Connecting Node.js to Database

• Acquire the skills to establish connections to databases, enabling data storage and
retrieval for dynamic applications.

• Understand the importance of data persistence and learn various database


integration techniques.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Connecting Node.js to Database
 There are many different ways to connect Node.js to a database. Here are a few popular options:

• MySQL is a popular relational database management system (RDBMS). There are many Node.js
modules that can be used to connect to MySQL, such as MySQL and MySQL2.

• MongoDB is a document database that is often used for storing JSON data. There are many Node.js
modules that can be used to connect to MongoDB, such as Mongo dB and Mongoose.

• PostgreSQL is a popular open-source relational database management system (RDBMS). There are
many Node.js modules that can be used to connect to PostgreSQL, such as pg and pg-promise.

• Cassandra is a distributed NoSQL database that is often used for storing large amounts of data. There
are many Node.js modules that can be used to connect to Cassandra, such as Cassandra and node-
Cassandra-driver.

 The best way to connect Node.js to a database will depend on your specific needs and requirements. If you
are not sure which database to use, you can consult with a database administrator or developer.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database
 Connecting Node.js to a database is a crucial step in building dynamic and data-driven applications.
Databases store, retrieve, and manage structured data, and integrating them with Node.js allows
developers to create powerful and scalable backends. Commonly used databases include relational
databases like MySQL and PostgreSQL, as well as NoSQL databases like MongoDB.

 Key Steps in Connecting Node.js to a Database:


• Selecting a Database Driver: Choose a database driver or library that provides the necessary tools
and methods to interact with the chosen database system. For example, for MySQL, you might use
the mysql2 library, and for MongoDB, you might use the mongodb library.

• Installing Dependencies: Use Node Package Manager (NPM) to install the required database driver
and any other dependencies.

• Establishing a Connection: Use the database driver to create a connection to the database server.
Provide connection details such as hostname, port, username, and password.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database

• Executing Queries: Once connected, you can execute queries or commands to interact with the database.
This includes operations like inserting, updating, retrieving, or deleting data.

• Handling Asynchronous Operations: Database operations are often asynchronous, so you'll need to use
callbacks, promises, or async/await to manage the flow of data and ensure responsiveness.

• Error Handling: Implement proper error handling to gracefully handle situations like connection failures
or query errors.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database
 Example of connecting Node.js to a MySQL database using the mysql2 library:

console.log('Connected to the database');


const mysql = require('mysql2');
});
// Create a connection to the database
// Perform database operations
const connection = mysql.createConnection({
connection.query('SELECT * FROM users',
host: 'localhost',
(err, results) => {
user: 'root',
if (err) throw err;
password: 'password',
console.log('Query results:', results);
database: 'mydb'
});
// Close the connection when done
connection.end();
// Establish a connection
});
connection.connect((err) => {
if (err) { By connecting Node.js to a database, developers
console.error('Error connecting to the database:', err); can store and retrieve data efficiently, enabling
return; the creation of dynamic web applications, APIs,
} and other data-driven solutions.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database
 Once you are connected to a database, you can use the Node.js module to perform queries and operations
on the database. The following code shows how to select all of the rows from the users table in the
MySQL database:

const sql = 'SELECT * FROM users';

connection.query(sql, (err, results) => {


if (err) {
console.log(err);
} else {
console.log(results);
}
});

This code will execute the SELECT * FROM users query on the MySQL database. The results variable will
contain an array of objects that represent the rows in the users table.
For more information on connecting Node.js to a database, you can consult the documentation for the specific
database module that you are using.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database Daily Quiz
1. What is the purpose of connecting Node.js to a database in web development?
a) To optimize website layout and design
b) To improve user interface responsiveness
c) To store, retrieve, and manage structured data
d) To enhance browser compatibility

2. Which type of databases can be used when connecting Node.js to a database?


e) Only NoSQL databases
f) Only relational databases
g) Both relational and NoSQL databases
h) Only in-memory databases

3. What is the first step in connecting Node.js to a database?


i) Executing queries
j) Installing a text editor
k) Selecting a database driver or library
l) Designing user interfaces

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database Daily Quiz

4. Which tool or library is commonly used to connect Node.js to a MySQL database?


a) mysql2
b) mongoose
c) sequelize
d) express

5. How does Node Package Manager (NPM) contribute to connecting Node.js to a database?
e) NPM handles database operations automatically
f) NPM provides a visual interface for database connections
g) NPM allows you to install the required database driver and dependencies
h) NPM converts databases into NoSQL format

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Connecting Node.js to Database (Questions)

1. Why is it important to connect Node.js applications to databases in web


development?
2. What are the common database systems compatible with Node.js?
3. Describe the steps involved in establishing a connection between a Node.js
application and a database.
4. How does asynchronous programming in Node.js align with database operations?
5. What are the benefits of using connection pooling when connecting Node.js to a
database?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Mongoose Module

• Explore the Mongoose module as a powerful tool for simplifying MongoDB


interactions through an intuitive schema-based approach.

• Learn to model and manipulate data using Mongoose, enhancing database


management.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Mongoose Module
Simplifying MongoDB Interactions through Schema-Based Approach

 The Mongoose module stands as a formidable asset within the Node.js ecosystem, offering a streamlined
conduit for orchestrating interactions with MongoDB databases.

 Mongoose encapsulates the complexities of database management through an elegant schema-based


methodology, empowering developers to model and manipulate data with remarkable ease.

 The Mongoose module is a dynamic asset within the Node.js ecosystem, serving as a robust bridge
between applications and MongoDB databases.

 By embracing a schema-based approach, Mongoose simplifies the choreography of MongoDB


interactions, empowering developers to model and manipulate data with remarkable fluidity.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
 Mongoose is a powerful tool that can be used to do a variety of things with MongoDB, such as:

•Create and manage collections. Collections are the equivalent of tables in a relational database. Mongoose
makes it easy to create and manage collections in MongoDB.

•Insert, update, and delete documents. Documents are the equivalent of rows in a relational database.
Mongoose makes it easy to insert, update, and delete documents in MongoDB.

•Query documents. Mongoose provides a powerful query language that you can use to query documents in
MongoDB.

•Enforce schemas. Mongoose allows you to enforce schemas on your documents. This ensures that your
documents are always consistent and valid.

•Handle relationships. Mongoose makes it easy to handle relationships between documents. This is useful for
modelling real-world entities.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
 The benefits of using Mongoose:

•It is easy to use. Mongoose provides a high-level abstraction for working with MongoDB, making it easy to
write efficient and scalable code.

•It is powerful. Mongoose provides a wide range of features for working with MongoDB, such as schema
validation, query building, and relationship handling.

•It is well-documented. Mongoose has extensive documentation that makes it easy to learn how to use the
module.

•It is actively maintained. Mongoose is actively maintained by a team of developers, which means that it is
constantly being updated with new features and bug fixes.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
 Let's delve into the Mongoose world with some illustrative code examples:

1. Installation and Setup:


First, ensure you have Mongoose installed. Use the following command:

npm install mongoose

2. Creating a Schema and Model:


const mongoose = require('mongoose');

// Define a schema
const userSchema = new mongoose.Schema({
name: String,
email: { type: String, required: true, unique: true },
age: Number
});

// Create a model based on the schema


const User
Sunday,= mongoose.model('User',
May 19, 2024 userSchema);
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
3. Connecting to MongoDB:

First, ensure you have Mongoose installed.


Use the following command:

mongoose.connect('mongodb://localhost/mydatabase', {
useNewUrlParser: true,
useUnifiedTopology: true
})
.then(() => {
console.log('Connected to MongoDB');
})
.catch((error) => {
console.error('Connection error:', error);
});

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
4. Creating and Saving a Document:

// Create a new user


const newUser = new User({
name: 'John Doe',
email: '[email protected]',
age: 30
});

// Save the user to the database


newUser.save()
.then((doc) => {
console.log('User saved:', doc);
})
.catch((error) => {
console.error('Error saving user:', error);
});
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
5. Querying Data: 6. Updating Data:

// Find all users // Update user by ID


User.find() User.findByIdAndUpdate('user_id_here', { age: 31 })
.then((users) => { .then((updatedUser) => {
console.log('All users:', users); console.log('Updated user:', updatedUser);
}) })
.catch((error) => { .catch((error) => {
console.error('Error querying users:', error); console.error('Error updating user:', error);
}); });

Mongoose elegantly streamlines MongoDB interactions, infusing a harmonious blend of structured


modelling, data validation, and expressive querying. It's an instrumental companion on the journey to
crafting resilient and data-driven Node.js applications.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
Exploring the Mongoose Module:
3. Data Validation: The schema-driven nature of Mongoose
At its core, Mongoose serves as an intermediary layer between paves the way for automatic data validation. This ensures
Node.js applications and MongoDB, ushering in an intuitive that data adheres to predefined rules before it integrates
paradigm that harmonizes data representation with the schema into the database, bolstering data integrity.
concept. This schema-driven approach bestows several
advantages: 4. Middleware Empowerment: Mongoose furnishes
developers with the capability to weave custom logic into
1.Structured Data Modeling: Mongoose empowers database operations. Middleware functions can be
developers to define data schemas that mirror real-world seamlessly integrated before or after actions like saving or
entities. Each schema prescribes the structure of documents, deleting documents, enabling tailored workflows.
delineating fields, their types, and validation constraints.
5. Enhanced Querying and Aggregation: Leveraging
2.Model Abstraction: With schemas in place, Mongoose Mongoose, developers harness a versatile toolkit for
engenders the creation of models that embody the data querying and aggregating data. Mongoose offers a wealth
structures. Models encapsulate crucial operations such as of query methods, and it harmonizes with MongoDB's
creating, reading, updating, and deleting documents, freeing aggregation framework for sophisticated data
developers from low-level database intricacies. manipulations.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module
 Learning the Mongoose Craft:

• Embarking on the journey of mastering Mongoose entails traversing a landscape where schema
definitions crystallize real-world entities, models become conduits for interaction, and data validation
becomes second nature.

• Through the Mongoose module, developers are endowed with the artistry to sculpt database
interactions to their will, relinquishing mundane tasks to the background.

• In essence, Mongoose stands as a potent instrument, bridging the gap between application logic and
database intricacies.

• It harmonizes the seemingly disparate realms of Node.js and MongoDB, amalgamating them into a
seamless symphony of data-driven craftsmanship.

• The result is an elevated realm of data modelling and management that enhances the very essence of
database-driven applications.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module Daily Quiz
1. What is the primary purpose of the Mongoose module in Node.js?
a) To design user interfaces
b) To create web servers
c) To facilitate MongoDB interactions
d) To handle network requests

2. What is a schema in the context of the Mongoose module?


e) A collection of HTML files
f) A data structure for routing
g) A blueprint for data modelling and validation
h) A template for CSS styling

3. How does Mongoose contribute to data validation?


i) It automatically generates data
j) It enforces schema consistency and validation rules
k) It manages server logs
l) It optimizes database queries

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module Daily Quiz

4. What role do models play in the Mongoose module?


a) They define routes for HTTP requests
b) They manage client-side scripting
c) They represent collections and provide CRUD operations
d) They create visual elements on web pages

5. Which command is used to create a new Mongoose model?


e) createModel
f) defineModel
g) mongoose.create
h) mongoose.model

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Mongoose Module (Questions)

1.What is Mongoose, and how does it simplify database interactions in Node.js?


2.Explain the concept of schemas and models in the context of Mongoose.
3.How does Mongoose enhance data validation and schema enforcement in
MongoDB?
4.Give an example of how you would define and use a Mongoose schema in a
Node.js application.
5.What role does Mongoose play in managing relationships between different
collections in MongoDB?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Creating Rest APIs

• Master the concept of RESTful APIs and learn how to design and build APIs in
Node.js for seamless client-server communication.

• Practice creating endpoints and handling HTTP methods to enable data


exchange.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Creating Rest APIs
 Creating REST APIs: Building Web Services for Data Interaction

 Creating Representational State Transfer (REST) APIs is a fundamental aspect of modern web development,
enabling seamless communication between clients and servers. REST APIs serve as a bridge, allowing
applications to request, retrieve, and manipulate data over the web.

 REST APIs can be created in Node.js using a variety of frameworks and libraries. Here are a few popular
options:
• Express is a popular web framework for Node.js that makes it easy to create REST APIs.
• Loopback is a powerful framework for creating REST APIs that are both scalable and secure.
• Sails.js is a full-stack framework for Node.js that includes support for creating REST APIs.
• Hapi is a lightweight framework for creating REST APIs that is well-suited for microservices
architectures.
• Fastify is a high-performance framework for creating REST APIs that is well-suited for high-traffic
applications.

The best framework or library for creating REST APIs in Node.js will depend on your specific needs and
requirements. If you are not sure which framework to use, you can consult with a Node.js developer or architect.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs
Overview of the process involved in creating RESTful APIs:

1. Define Endpoints: Begin by identifying the resources your API will expose. Each resource should
correspond to a unique URL endpoint. For example, /users could represent a collection of user data.

2. Choose HTTP Methods: REST APIs use HTTP methods (verbs) to perform different actions on resources.
Common methods include GET (retrieve), POST (create), PUT (update), and DELETE (remove).

3. Design Data Representation: Determine how data will be represented in requests and responses. JSON
(JavaScript Object Notation) is a popular format for data exchange due to its simplicity and compatibility.

4. Create Routes and Handlers: In your server-side code (using a framework like Express in Node.js),
define routes that map to each API endpoint. Attach handlers to these routes to process incoming requests and
generate responses.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs
5. Implement CRUD Operations: For each resource, implement the four basic CRUD operations: Create,
Read, Update, and Delete. Associate these operations with the appropriate HTTP methods and route handlers.

6. Validate and Sanitize Data: Validate user input and sanitize data to prevent security vulnerabilities and
ensure data integrity. Input validation guards against invalid or malicious input.

7. Handle Errors and Responses: Incorporate error handling mechanisms to provide meaningful error
responses. Successful requests should yield appropriate status codes (e.g., 200 for success) and relevant
data.

8. Enable Cross-Origin Resource Sharing (CORS): If your API will be accessed from different domains,
configure CORS to allow cross-origin requests while maintaining security.

9. Versioning and Documentation: As your API evolves, consider implementing versioning to maintain
compatibility. Additionally, provide clear and comprehensive documentation for developers who will
consume your API.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs
 Example of creating a REST API endpoint in Node.js using Express:

const express = require('express');


const app = express();
const PORT = 3000;

// Define a route for GET requests to /users


app.get('/users', (req, res) => {
// Retrieve and send user data as a JSON response
const users = [
{ id: 1, name: 'Alice' },
{ id: 2, name: 'Bob' }
];
res.json(users);
});

app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
}); Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs
 The basic steps involved in creating a REST API in Node.js:

1. Choose a framework or library. As mentioned above, there are many different frameworks and libraries
that you can use to create REST APIs in Node.js. Choose one that is well-suited for your needs and
requirements.

2. Define your endpoints. An endpoint is a URL that can be used to access a resource in your API. For
example, the endpoint /users might be used to retrieve a list of all users in your database.

3. Implement your endpoints. Once you have defined your endpoints, you need to implement them. This
involves writing code that will respond to requests to the endpoints.

4. Test your API. Once you have implemented your endpoints, you need to test your API to make sure that
it is working correctly. You can use a variety of tools to test your API, such as Postman or Insomnia.

5. Deploy your API. Once you are satisfied with your API, you need to deploy it so that it can be accessed
by other applications. You can deploy your API to a variety of platforms, such as Heroku, AWS, or Google
Cloud Platform.
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs Daily Quiz
1. What does REST stand for in the context of web development?
a) Responsive State Transition
b) Representational State Transfer
c) Remote Server Transaction
d) Reactive Server Technology

2. What is the purpose of a REST API?


e) To design user interfaces
f) To create graphical assets
g) To facilitate communication between clients and servers
h) To manage server hardware

3. Which HTTP method is typically used to retrieve data from a REST API?
i) POST
j) GET
k) PUT
l) DELETE

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs Daily Quiz

4. What is an API endpoint?


a) A software tool for debugging
b) A graphical user interface element
c) A unique URL that represents a resource in a REST API
d) An external device connected to a server

5. In REST API design, which HTTP method is often used to create new resources?
e) GET
f) POST
g) PUT
h) DELETE

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Creating Rest APIs (Questions)

1.Define RESTful APIs and explain their importance in modern web development.
2.What are the key principles of REST architecture, and how do they guide the design
of RESTful APIs?
3.Describe the main components of a typical REST API endpoint.
4.How do HTTP methods (GET, POST, PUT, DELETE) map to different actions in a
REST API?
5.Give an example of creating a simple REST API endpoint in a Node.js application.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Express Framework, M V C Pattern

• Understand the role of the Express framework in building web


applications and APIs.

• Create basic routes, middleware, and endpoints using Express to develop


functional and organized applications.

• Grasp the Model-View-Controller (MVC) architectural pattern and its


significance in structuring maintainable and scalable applications.

• Apply the MVC pattern to Node.js projects, promoting separation of


concerns and code .
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Express Framework, MVC Pattern

Express Framework and MVC Pattern: Building Structured Web Applications

 The Express framework is a robust and widely used web application framework for Node.js.

 It provides a set of tools and features that simplify the process of building web applications
and APIs.

 One of the key architectural patterns often used in conjunction with Express is the Model-
View-Controller (MVC) pattern.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern

 Express Framework: Express offers a streamlined approach to developing web applications by providing:

1.Routing: Express allows you to define routes that map HTTP methods (GET, POST, etc.) to specific functions,
making it easy to handle different types of requests.

2.Middleware: Middleware functions can be used to process requests before they reach the route handler,
enabling tasks like authentication, logging, and error handling.

3.Template Engines: Express supports various template engines (such as EJS, Pug, and Handlebars) to
dynamically render HTML views.

4.Static Files: Serving static files (e.g., images, CSS, JavaScript) becomes effortless with Express's built-in
middleware.

5.Request and Response Objects: Express provides request and response objects that encapsulate useful
information and methods for working with client requests and server responses.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern

 MVC Pattern:

The Model-View-Controller (MVC) pattern is an architectural paradigm that promotes separation of concerns in
software development. In the context of web applications:

1. Model: The model represents the application's data and business logic. It interacts with the database and
encapsulates data-related operations.

2. View: The view is responsible for presenting data to users. It generates the user interface and displays
information based on the model's data.

3. Controller: The controller acts as an intermediary between the model and the view. It handles user input,
processes requests, and updates the model or view accordingly.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern

Combining Express and MVC:

 When using Express, developers often follow the MVC pattern to achieve a structured and
modular codebase. Express routes act as controllers, handling requests and orchestrating
interactions between the model (data) and the view (UI).

 The Express framework, when combined with the MVC pattern, empowers developers to create
organized, scalable, and maintainable web applications that efficiently handle routing, data
management, and user interface rendering.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern
Example of using Express with MVC pattern:

const express = require('express');


const app = express();
const PORT = 3000; app.post('/add', (req, res) => {
// Update the model (add a new todo)
// Model: Sample data todos.push(req.body.todo);
const todos = []; // Redirect back to the home page
res.redirect('/');
// View: Using EJS template engine });
app.set('view engine', 'ejs');
app.listen(PORT, () => {
// Controller: Define routes console.log(`Server is running on port $
app.get('/', (req, res) => { {PORT}`);
// Render the 'index' view with data from the });
model
res.render('index', { todos });
});
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern Daily Quiz
1. What is the primary purpose of the Express framework in web development?
a) To design user interfaces
b) To manage server hardware
c) To simplify building web applications and APIs
d) To optimize database performance

2. Which architectural pattern promotes separation of concerns and is often used in conjunction with Express?
e) REST pattern
f) MVC pattern
g) Singleton pattern
h) Observer pattern

3. In the context of the MVC pattern, what does the "Model" represent?
i) The user interface elements
j) The application's data and business logic
k) The network communication layer
l) The routing and middleware

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern Daily Quiz

4. How do Express routes correspond to the MVC pattern's components?


a) Routes correspond to the "Model"
b) Routes correspond to the "View"
c) Routes correspond to the "Controller"
d) Routes correspond to all three components (Model, View, and Controller)

5. Which Express feature is used to define routes and handle different types of HTTP requests?
e) Middlewares
f) Templates
g) Endpoints
h) Controllers

6. Which part of the MVC pattern acts as an intermediary between the "Model" and the "View"?
i) Controller
j) Router
k) Middleware
l) Template engine

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Express Framework, MVC Pattern (Questions)

1. What is the Express framework, and how does it facilitate web application development in Node.js?
2. Explain the role of middleware in the Express framework and provide examples of common middleware functions.
3. How do you create and configure routes in an Express application?
4. Describe the concept of template engines in Express and their role in generating dynamic HTML content.
5. What are the advantages of using Express to build APIs compared to traditional approaches?
6. Define the Model-View-Controller (MVC) architectural pattern and its significance in software development.
7. How does the MVC pattern help in organizing code and separating concerns in a Node.js application?
8. Explain the roles of the Model, View, and Controller components in the MVC pattern.
9. Give an example of how you would implement the MVC pattern in a Node.js application.
10.What benefits does the MVC pattern offer in terms of maintainability, scalability, and collaboration among
developers?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Routing

• Learn to implement routing in Express to handle different URLs and


route requests to appropriate controllers.

• Develop a solid understanding of URL patterns and route parameters


for effective navigation.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Routing
 Routing in Node.js is the process of directing requests to different parts of your application. This is done
by defining routes, which are mappings between URLs and functions. When a request is made to a URL
that matches a route, the function associated with that route is executed.

 Routing is a core concept in web development that involves directing incoming requests to specific
handlers or functions based on the requested URL path and HTTP method. In the context of the Express
framework for Node.js, routing plays a pivotal role in defining how your application responds to different
routes and actions.

Key Aspects of Routing in Express:

1. Defining Routes: Express provides a simple and declarative way to define routes using the app object.
Routes are typically associated with specific URL paths and HTTP methods.

2. Route Handlers: Each route is associated with a route handler, which is a function that executes when a
request matches the defined route. Route handlers can handle tasks such as processing data, interacting
with databases, and generating responses.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing
3. Dynamic Routes: Express supports dynamic route segments that can capture values from the URL.
These parameters are accessible within the route handler, allowing for dynamic data processing.

4. Route Parameters: Route parameters are denoted by a colon (:) followed by the parameter name in the
route definition. They provide a way to extract data from the URL and use it in the handler.

5. Route Chaining: Express allows you to chain multiple route handlers together for a single route. This
can be useful for applying middleware, performing authorization checks, or handling different aspects of
the request.

6. HTTP Methods: Routes can be associated with specific HTTP methods, such as GET, POST, PUT, and
DELETE. This enables you to differentiate between different types of actions.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing
Example of defining and handling routes in
Express
Example of defining and handling routes in Express:

const express = require('express'); // Define a route with multiple handlers


const app = express(); app.get('/about', (req, res, next) => {
console.log('Middleware function');
// Define a route for the homepage next();
app.get('/', (req, res) => { }, (req, res) => {
res.send('Welcome to the homepage'); res.send('About Us');
}); });

// Define a dynamic route with a parameter app.listen(3000, () => {


app.get('/users/:id', (req, res) => { console.log('Server is running on port 3000');
const userId = req.params.id; });
res.send(`User ID: ${userId}`);
});

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing
 Express routing empowers developers to create structured and organized APIs and web applications.

 By defining routes and associating them with specific actions, developers can efficiently manage the flow of
incoming requests and provide appropriate responses.

 Here is an example of a route in Node.js:

const express = require('express');

const app = express();

app.get('/', (req, res) => {


res.send('Hello, world!');
});

app.listen(3000, () => {
console.log('Server listening on port 3000');
});
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing

 In this example, the route / is mapped to the function (req, res) => { res.send('Hello, world!'); }. This means
that when a request is made to the URL http://localhost:3000/, the function (req, res) => { res.send('Hello,
world!'); } will be executed.

 Routes can be defined in a variety of ways, depending on the framework or library that you are using.
However, the basic idea is always the same: you need to define a mapping between a URL and a function.

 Routing is a fundamental concept in Node.js web development. By understanding how routing works, you can
create applications that are easy to navigate and use.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing Daily Quiz

1. What is the primary purpose of routing in web development?


a) To design user interfaces
b) To manage server hardware
c) To direct incoming requests to specific handlers based on URL paths
d) To optimize database performance

2. In the context of Express routing, what is a route handler?


e) A function that processes incoming requests and generates responses
f) A graphical element on a web page
g) A middleware that authenticates users
h) A component responsible for rendering HTML templates

3. How is a dynamic route parameter defined in Express?


i) By using the :param syntax
j) By enclosing the parameter in curly braces {param}
k) By using the ?param= syntax
l) By prefixing the parameter with an underscore _param

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing Daily Quiz

4. What is the purpose of chaining multiple route handlers in Express?


a) To increase the complexity of the route
b) To apply multiple authentication layers
c) To handle different aspects of a request in sequence
d) To define multiple routes for the same URL path

5. Which HTTP method is typically used to retrieve data from the server in Express routing?
e) POST
f) GET
g) PUT
h) DELETE

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Routing (Questions)

1.How does routing in web development relate to directing incoming requests to


appropriate handlers?
2.Describe the concept of route parameters and how they are used in routing with
Express.
3.How do you define middleware-specific routes in an Express application?
4.Explain the process of handling HTTP requests with different methods (GET, POST,
PUT, DELETE) using route handlers.
5.What is the purpose of route chaining, and how can it help organize and optimize
code in an Express application?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: Cookies and Sessions

• Understand the concepts of cookies and sessions in web


applications, and how they enable user state management.

• Implement user authentication and session handling to enhance


application security.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Cookies and Sessions
 Cookies and Sessions: Managing User State in Web Applications

Cookies and sessions are essential components in web development that enable the management of user state
and data persistence between requests and responses. These mechanisms play a crucial role in enhancing user
experiences and providing personalized interactions on web applications.

 Cookies:

1. Definition: Cookies are small pieces of data sent from a web server to a user's browser and stored on
the user's device. They are used to store information such as user preferences, session identifiers, and
tracking data.

2. Purpose: Cookies are often employed for tasks like user authentication, tracking user behavior, and
maintaining a user's shopping cart contents across different pages.

3. Types: Cookies can be categorized into two types: session cookies, which expire when the user closes
the browser, and persistent cookies, which remain on the user's device for a specified duration.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Cookies and Sessions
 Sessions:
1. Definition: Sessions are a logical continuation of cookies. They allow web applications to track user
interactions over a series of requests and responses.
2. Session Management: When a user accesses a website, a unique session identifier is generated and
stored in a cookie. This identifier is used to associate subsequent requests from the same user with
the appropriate session data on the server.
3. Data Persistence: Sessions enable the storage of user-specific data, such as login credentials and
shopping cart contents, across multiple page views.

 Benefits of Cookies and Sessions:


1. Personalization: Cookies and sessions enable personalized user experiences by retaining user
preferences and data.
2. User Authentication: Cookies and sessions facilitate user login and authentication by maintaining user
sessions.
3. Stateful Interactions: They allow web applications to maintain a stateful connection with users,
supporting complex workflows and interactions.
4. E-commerce: Cookies and sessions are vital for e-commerce applications, preserving user shopping
carts and transaction history.
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Cookies and Sessions
 Example of using cookies and sessions in Express

const express = require('express');


const session = require('express-session');
const app = express(); // Route for accessing session data
app.get('/get-session', (req, res) => {
// Enable session management if (req.session.views) {
app.use(session({ req.session.views++;
secret: 'my-secret-key', } else {
resave: false, req.session.views = 1;
saveUninitialized: true, }
})); res.send(`Session views: ${req.session.views}`);
});
// Route for setting a cookie
app.get('/set-cookie', (req, res) => { app.listen(3000, () => {
res.cookie('username', 'john_doe', { maxAge: console.log('Server is running on port 3000');
3600000 }); });
res.send('Cookie set!');
});
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Cookies and Sessions Daily Quiz
1. What is the primary purpose of cookies in web development?
a) To store large amounts of data on the client-side
b) To track user behaviour for marketing purposes
c) To manage user state and data persistence between requests
d) To provide real-time communication between the server and the client

2. What type of cookie is stored on the user's device until a specified expiration time?
e) Session cookie
f) Persistent cookie
g) Transient cookie
h) Temporary cookie

3. In the context of sessions, what is a session identifier?


i) A unique username is assigned to each user
j) A password used for user authentication
k) A piece of data stored in cookies to track user interactions
l) A unique token used to associate a user's requests with session data on the server

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Cookies and Sessions Daily Quiz

4. How do sessions enhance user experiences on web applications?


a) By storing all user data on the client-side
b) By providing real-time chat functionality
c) By maintaining user state across multiple page views and interactions
d) By automatically generating user interface components

5. What is the primary purpose of the express-session middleware in Express.js?


e) To handle HTTP requests and responses
f) To manage user authentication
g) To enable dynamic routing
h) To facilitate session management and cookies

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Cookies and Sessions (Questions)

1.Why are cookies and sessions essential for managing user interactions in web
applications?
2.Explain the difference between cookies and sessions and their respective use cases.
3.How can you implement user authentication and maintain user sessions using
cookies and sessions in Node.js?
4.Describe the process of creating and setting cookies in a Node.js application.
5.What security considerations should be taken into account when working with
cookies and sessions to prevent unauthorized access?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: HTTP Interaction

• Explore the core concepts of HTTP and its role in client-server


communication.

• Learn to handle HTTP requests and responses effectively in Node.js


applications.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
HTTP Interaction
 Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the World Wide Web. It
defines the rules and conventions for exchanging data between a client (such as a web browser) and a
server (hosting a website).
 HTTP enables the retrieval of web resources, such as HTML pages, images, and files, and it forms the basis
for interactions between users and web applications.

 Critical Aspects of HTTP Interaction:

1. Client-Server Model: HTTP operates on a client-server model, where the client initiates resource
requests, and the server responds with the requested data.

2. Request and Response Cycle: A typical HTTP interaction consists of a request sent by the client and a
corresponding response from the server. Each HTTP request contains a method (GET, POST, etc.) and a
URL, while the response includes a status code and the requested content.

3. HTTP Methods: HTTP defines several methods that indicate the desired action to be performed on
the server. Standard methods include GET (retrieve data), POST (submit data), PUT (update data), and
DELETE (remove data).
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
HTTP Interaction
4. Headers: HTTP headers provide additional information about the request or response, such as content
type, encoding, and authentication credentials.

5. Status Codes: HTTP status codes convey the outcome of a request. They indicate whether the request was
successful, redirected, or encountered an error.

6. Stateless Protocol: HTTP is stateless, meaning each request is independent of previous requests. To
maintain state across multiple requests, mechanisms like cookies and sessions are used.

7. URLs and Resources: URLs (Uniform Resource Locators) identify web resources and determine their
location on the internet.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
HTTP Interaction
HTTP Request:
GET /example.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)
 Example of an HTTP request and
response interaction: HTTP Response:
HTTP/1.1 200 OK
Date: Thu, 01 Jul 2023 15:30:00 GMT
 HTTP interaction forms the backbone of web Content-Type: text/html
communication, enabling seamless data Content-Length: 2345
exchange and resource retrieval. It allows
users to access websites, submit forms, <!DOCTYPE html>
retrieve data, and interact with various web <html>
services and applications. <head>
<title>Example Page</title>
</head>
<body>
<h1>Welcome to the Example Page</h1>
</body>
</html>
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
HTTP Interaction Daily Quiz
What does HTTP stand for in web development?
a) Hypertext Transfer Protocol b)
b) Hyperlink Text Protocol c)
c) High-Traffic Transport Protocol d)
d) HTML Text Protocol

In the client-server model, which entity initiates the HTTP request?


e) Server
f) b) User
g) Browser
h) Database

Which HTTP method is used to retrieve data from a server?


i) POST
j) PUT
k) DELETE
l) G

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
HTTP Interaction Daily Quiz

What is the primary purpose of HTTP headers in an HTTP request?


a) To identify the client device
b) To determine the server's physical location
c) To provide additional information about the request
d) To encrypt the data being sent

Which component of an HTTP response provides information about the content being sent?
e) Status code
f) Request URL
g) Response body
h) Request method

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
HTTP Interaction (Questions)

1.How does the Hypertext Transfer Protocol (HTTP) facilitate communication


between clients and servers in web development?
2.What are the main components of an HTTP request, and how are they structured?
3.Explain the role of status codes in HTTP responses and provide examples of
common status codes.
4.Describe the difference between query parameters and request body parameters
in an HTTP request.
5.How can you handle different HTTP methods (GET, POST, PUT, DELETE) in a Node.js
application to perform specific actions?

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Objective

Topic: User Authentication

• Acquire the skills to implement user authentication


mechanisms, safeguarding user data and ensuring secure
access.

• Understand authentication strategies and practice


integrating them into Node.js applications.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
User Authentication
User Authentication: Securing Access to Web Applications

 User authentication is a critical aspect of web development that involves verifying the identity of users
before granting them access to protected resources or features within a web application.

 It ensures that only authorized individuals can interact with sensitive data and perform specific actions,
contributing to the overall security and privacy of online systems.

 User authentication in Node.js is the process of verifying the identity of a user. This is typically done by
requiring users to provide a username and password.

 Once a user has been authenticated, they are granted access to the application.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication
There are a variety of ways to implement user authentication in Node.js. Here are a few popular options:

• Session authentication is a simple and straightforward way to authenticate users. In session authentication, a unique
session ID is generated for each user. This session ID is stored in the user's browser and is used to authenticate the user on
subsequent requests.

• Token authentication is a more secure way to authenticate users than session authentication. In token authentication, a
token is generated for each user. This token is then used to authenticate the user on subsequent requests. Tokens are
typically more secure than session IDs because they are not stored in the user's browser.

• Basic authentication is a simple way to authenticate users over HTTP. In basic authentication, the user's username and
password are sent in clear text over the network. This is not a very secure way to authenticate users, but it is often used
for simple applications.

• OAuth 2.0 is a modern authentication protocol that is widely used by web applications. OAuth 2.0 allows users to
authenticate with a third-party service, such as Google or Facebook. This can be a convenient way for users to
authenticate with your application, as they do not need to create a new account with your application.

The best way to implement user authentication in Node.js will depend on your specific needs and requirements. If you
are not sure which method to use, you can consult with a Node.js developer or architect.
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication
Key Concepts of User Authentication:

1. Authentication Factors: User authentication typically involves one or more authentication factors:
something the user knows (password), something the user has (security token or device), or something
the user is (biometric data like fingerprints or facial recognition).

2. Authentication Process: When a user attempts to access a protected area, the application prompts
them to provide valid credentials. The credentials are compared against stored data to verify the user's
identity.

3. Credentials Storage: User credentials, such as passwords, are securely stored using encryption or
hashing techniques. Storing plain passwords is a security risk.

4. Session Management: After successful authentication, a session is established, allowing the user to
interact with the application without repeatedly entering credentials for each action.

5. Authorization: While authentication verifies identity, authorization determines the specific actions a
user is allowed to perform once authenticated.
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication
 The benefits of implementing user authentication in Node.js:

• It can help to protect your application from unauthorized access.

• It can help to prevent users from accessing resources that they are not authorized to access.

• It can help to track user activity and behaviour.

• It can help to improve the user experience by providing a more secure and personalized experience.

 The challenges of implementing user authentication in Node.js:

• It can be complex to implement user authentication correctly.

• It can be difficult to scale user authentication to handle a large number of users.

• It can be difficult to maintain user authentication over time.

Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication
Authentication Methods:
1. Username and Password: The most common method, where users provide a unique username and
associated password.
2. Multi-Factor Authentication (MFA): Requires users to provide multiple types of authentication, adding
an extra layer of security.
3. Token-Based Authentication: Users are issued tokens after successful login, which are then used for
subsequent requests.
4. Biometric Authentication: Uses unique physical traits like fingerprints, retinal scans, or facial recognition
for verification.
Example of User Authentication Flow:
5. User visits a login page and enters their username and password.
6. The application validates the credentials against a database.
7. If the credentials are correct, the application generates a session token.
8. The session token is stored on the server and sent back to the user's browser as a cookie.
9. Subsequent requests include the session token, allowing the server to identify and authorize the user.

Effective user authentication is crucial for safeguarding sensitive data and maintaining the integrity of web
applications. By employing strong authentication methods and secure credential storage, developers can create a
trustful and secure user experience.
Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication Daily Quiz

1. What is the primary purpose of user authentication in web applications?


a) To track user behavior
b) To generate random usernames
c) To verify the identity of users before granting access
d) To collect user preferences

2. Which of the following is NOT a common authentication factor?


e) Something the user knows
f) Something the user has
g) Something the user dreams
h) Something the user is

3. What does MFA stand for in the context of user authentication?


i) Multi-Feature Authentication
j) Master Function Algorithm
k) Multi-Factor Authentication
l) Mobile-Friendly Authorization

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication Daily Quiz

4. How does token-based authentication work?


a) Users enter a secret key provided by the server
b) Users provide their biometric data
c) Users receive a token after login, which is used for subsequent requests
d) Users are redirected to a different page for each action

5. What is the primary purpose of session management in user authentication?


e) To generate strong passwords for users
f) To store sensitive data on the client-side
g) To maintain user identity across multiple requests
h) To prevent unauthorized access to the server

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
User Authentication (Questions)

1.Why is user authentication a critical component of web application security?


2.Explain the process of user authentication using a username and password in a
Node.js application.
3.How can you enhance user authentication security by implementing techniques like
password hashing and salting?
4.Describe the concept of token-based authentication and its advantages over
traditional session-based authentication.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit V
Topic Link (YouTube & NPTEL Video Links)

YouTube/Other Video Links

• https://youtu.be/BLl32FvcdVM

• https://youtu.be/fCACk9ziarQ

• https://youtu.be/YSyFSnisip0

• https://youtu.be/7H_QH9nipNs

• https://youtu.be/AX1AP83CuK4

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
MCQ (End of Unit)
1. What is the primary role of Node.js in web development?
a) Rendering dynamic web pages
b) Managing client-side scripts
c) Handling server-side logic
d) Designing user interfaces

2. Node.js is built on which programming language?


e) Java
f) C++
g) JavaScript
h) Python

3. What is an essential step in setting up the Node.js development environment?


i) Installing a database management system
j) Configuring a code versioning system
k) Setting up a web server
l) Installing Node.js runtime
Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
MCQ (End of Unit)

4. Which tool is commonly used for managing Node.js versions and dependencies?
a) NPM (Node Package Manager)
b) Docker
c) Jenkins
d) MongoDB

5. What is the primary purpose of NPM in Node.js projects?


e) Managing database connections
f) Storing HTML templates
g) Handling user authentication
h) Managing third-party libraries and modules

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Glossary Questions
1. What is the primary function of a version control system?
2. Explain the concept of asynchronous programming.
3. How does a call-back function work in JavaScript?
4. Define the event loop in the context of Node.js.
5. What are streams and buffers in Node.js, and how are they used?
6. Describe the purpose of a database connection pool.
7. What is the role of a schema in the Mongoose module?
8. How do you define a RESTful API?
9. Explain the role of middleware in the Express framework.
10. What is the main purpose of the Model in the MVC pattern?
11. How does routing enable URL handling in web applications?
12. Describe the use of cookies in session management.
13. What is the significance of the HTTP protocol in web development?
14. Explain the concept of user authentication.
15. What is a package.json file, and what is its role in Node.js projects?
16. How does the 'require' function work in Node.js?
17. Describe the difference between synchronous and asynchronous operations.
18. What is an EventEmitter in Node.js, and how is it used?
19. How can you handle errors in a Node.js application?
20. Define the concept of middleware chaining in Express.
Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
Summary

 In this comprehensive unit, students have embarked on an enriching journey through the world of Node.js
development. They were introduced to the fundamental concepts of Node.js and its role in modern web development,
followed by practical guidance on setting up a conducive development environment.

 Exploring key tools like the Node Package Manager (NPM), students mastered the art of efficiently managing
dependencies and packages. They delved into the intricacies of asynchronous programming through callbacks, grasped
the event-driven architecture and event loop, and harnessed the power of streams and buffers for optimized data
processing.

 Building on these foundations, students seamlessly connected Node.js to databases using the Mongoose module,
skilfully modelled data and created RESTful APIs, and harnessed the robust Express framework to build dynamic
applications following the MVC pattern.

 With a keen understanding of routing, cookies, sessions, and HTTP interactions, students fortified their applications
with secure user authentication. As this unit concludes, students stand equipped with the knowledge and skills to craft
sophisticated Node.js applications, poised to embark on their next phase of web development mastery.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
References

1) Anthony Accomazzo, Ari Lerner, and Nate Murray, “Fullstack React: The Complete Guide to ReactJS and Friends”,
4th edition, 2020 International Publishing. 

2) David Cho, “Full-Stack React, Type Script, and Node: Build cloud-ready web applications using React 17 with Hooks
and GraphQL”, 2nd edition, 2017 Packt Publishing Limited.

3) Richard Haltman & Shubham Vernekar, “Complete node.js: The fast guide: Learn complete backend development with
node.js”5th edition, 2017 SMV publication.

4) Glenn Geenen, Sandro Pasquali, Kevin Faaborg, “Mastering Node.js: Build robust and scalable real-time server-side
web applications efficiently” 2nd edition Packt,2017 Publishing Limited.

5) Greg Lim,” Beginning Node.js, Express & MongoDB Development, kindle edition,2019 international publishing

6) Daniel Perkins, “ReactJS Master React.js with simple steps, guide and instructions” 3rd edition, 2015 SMV
publication.

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III
THANK YOU

Sunday, May 19, 2024 Srishti Dikshit Web Development using MERN Stack with DevOps Unit III

You might also like