0% found this document useful (0 votes)
28 views47 pages

Him Anshu 23

Uploaded by

Dharmesh saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views47 pages

Him Anshu 23

Uploaded by

Dharmesh saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

A

REPORT

ON

INDUSTRIAL TRAINING ON

“BACKEND DEVELOPMENT ”

Taken at

In partial fulfillment of the requirement for the award of degree of

Bachelor of Technology
In
Information Technology

(Session 2024-25)

Duration: From 14 MAY to 01 JULY 2024

Submitted to: Submitted by:


Dr. Smita Agarwal Himanshu Jain
Mr. Piyush Gautam 21EJCIT053
VII Semester (A)

Department of Information Technology


Jaipur Engineering College and Research Centre, Jaipur
Rajasthan Technical University, Kota 2024-25

i
ii
CERTIFICATE

This is to certify that the report of the training submitted is the outcome of the
practical training done at “Learn and Build” in “Backend Development ” is
carried out by Himanshu Jain bearing RTU Roll No.:21EJCIT053 under the
guidance and supervision of “Mr. Piyush Gautam” for the award of Degree of
Bachelor of Technology (B. Tech.) in Information Technology from Jaipur
Engineering College & Research Centre, Jaipur (Raj.), India affiliated to
Rajasthan Technical University, Kota during the academic year 2024-2025.

To the best of my knowledge the report: -

i) Embodies the work of the candidate.


ii) Has duly been completed.
iii) Fulfills the requirement of the ordinance relating to the bachelor of
technology degree of the Rajasthan technical University and
iv) Is up to the desired standard for the purpose of which is submitted.

Dr. Smita Agarwal Mr. Piyush Gautam


Head of Department Assistant Prof. &TPO
Information technology Information Technology
JECRC, Jaipur JECRC, Jaipur

iii
DECLARATION
I hereby declare that the report entitled” Industrial Training on Backend
Development ” has been carried out and submitted by the undersigned to the Jaipur
Engineering College & Research Centre, Jaipur (Rajasthan) in an original work,
conducted under the guidance and supervision of Mr. Saurabh Kumar of Learn
and Build , Jaipur.

The empirical findings in this report are based on the data, which has been collected
by me. I have not reproduced from any report of the University neither of this year
nor of any previous year.

I understand that any such reproducing from an original work by another is liable to
be punished in a way the University authorities’ deed fit.

Place: Jaipur Himanshu Jain


Date: 14 October 2024 Roll No.: - 21EJCIT053

iv
PREFACE

Bachelor of Technology in Information Technology is the Rajasthan Technical


University course (Approved by AICTE) having duration of 4 years. As a
prerequisite of the syllabus every student on this course has to take professional
training from any Industry related to the stream for 60 days in order to complete
his/her studies successfully. And it is required to submit the project report on the
completion of it.

The main objective of this training is to create awareness regarding the application
of theories in the practical world of Information Technology and to give a practical
exposure of the real world to the student.

I, therefore, submit this project report of this training, which was undertaken at Learn and
Build. Jaipur.

v
ACKNOWLEDGEMENT

Any serious and lasting achievement or success, one can never achieve without the help,
guidance and co-operation of so many people involved in the work.

It is my pleasant duty to express my profound gratitude and extreme regards and


thanks to Mr. Arpit Agarwal and Dr. V.K. Chandna who gave me an opportunity
to take professional training in Learn and Build, Jaipur.

I am indebted towards Mr. Saurabh Kumar who has allotted this project and his
precious time and advice during the training period, which is imminent to the report.

I would like to express deep gratitude to Dr. Smita Agrawal, Head of Department
(Information Technology), Jaipur Engineering College & Research Centre, Jaipur
(Rajasthan) without whose permission the training would not be possible. I would
also like to thank Mr. Piyush Gautam, Training & Placement Officer and PTS
Coordinator, Department of Information Technology JECRC, Jaipur who
recommended me for this training.

Last but not the least, I am grateful to my beloved parents whose blessings and
inspirations are always with me. I am heartily thankful to those people who are
involved directly or indirectly in this project for encouraging me whenever I needed
their help in spite of their busy schedule.

Himanshu Jain
21EJCIT053

vi
CHAPTER INDEX

S. NO. TITLE PAGE


NO.

Front page

Certificate i-ii

Declaration iii

Preface iv

Acknowledgement v

Chapter Index vi-vii

Figure Index viii

Company Profie ix

1. Introduction 1

1.1 Web Development 1

2. Backend Development 4

2.1 Introduction 4

2.2 MongoDB 6

2.3 Express.js 10

2.4 React 13

2.5 NPM 16

vii
2.6 Node js 18

2.7 Key Concepts of an API 21

2.8 Mongoose 24

2.9 JWT (JSON Web Token) 27

3. Tools Used 29

3.1 Visual Studio Code 29

3.2 Postman 30

3.3 MongoDB Compass 31

4. Project Description 33

4.1 Introduction 33

4.2 Key Features 33

4.3 Technology Stack 34

5. Screenshots of Project 35

6. Conclusion 38

7. Future Scope 39

8. References 40

viii
FIGURE INDEX

S.NO TITLE PAGE.NO

2.1 MERN Stack Development 20

2.2 Mongoose 25

3.1 Visual Studio Code 30

3.2 Postman 31

3.3 MongoDB Compass 32

5.1 Login Page 35

5.2 Registration Page 35

5.3 File Uploading 36

5.4 File Sharing 36

5.5 File Uploaded 37

5.6 File Received 37

ix
COMPANY PROFILE

Learn and Build, Jaipur, is a leading IT company known for its comprehensive software
solutions tailored to meet diverse client needs.

With a strong focus on delivering cost-effective and innovative software development services,
Regex Software Services has established itself as a key player in the region's tech landscape.

Their team of skilled professionals is dedicated to providing customized software solutions that
enhance operational efficiency and drive business growth.

Through a commitment to quality and client satisfaction, Learn and Build, Jaipur, Jaipur,
continues to be a trusted partner for businesses seeking reliable and scalable software
development services.

Key Features and Offerings:

• Interactive Learning
• Modules Project
• State-of-the-Art Simulation
• ToolsExpert-Led Courses

x
CHAPTER 1 INTRODUCTION

1.1 Web Development


Web development refers to the process of creating and maintaining websites or web applications.
It involves a combination of programming, design, and content management to deliver a
seamless and interactive user experience on the World Wide Web. Web development
encompasses a wide range of tasks, from building simple static web pages to developing
complex dynamic web applications.

Key components of web development include:

1. Front-end Development:

• Front-end development, also known as client-side development, involves creating


the visual elements of a website that users interact with directly.
• Technologies such as HTML (Hypertext Markup Language), CSS (Cascading Style
Sheets), and JavaScript are fundamental for building the structure, style, and
behaviorof web pages.
• Front-end frameworks and libraries like React, Angular, and Vue.js are commonly
used to streamline the development process and enhance user interface (UI)
interactions.

2. Back-end Development:

• Back-end development, or server-side development, focuses on the server, databases, and


application logic that power the front-end of a website.
• Common back-end languages include PHP, Python, Ruby, Java, and Node.js. These
languages help manage data, process requests, and perform other server-side tasks.
• Frameworks like Django (Python), Ruby on Rails (Ruby), and Express.js
(JavaScript/Node.js) provide structured environments for building robust back-end
applications.
3. Database Management:

• Databases are used to store and retrieve data for web applications. Popular database
management systems (DBMS) include MySQL, PostgreSQL, MongoDB, and SQLite.

1
• Web developers use database languages like SQL (Structured Query Language) to interact
with and manipulate data.

4. Full-Stack Development:

• Full-stack developers are proficient in both front-end and back-end development, allowing
them to work on all aspects of a web application.
• Full-stack development often involves understanding multiple programming languages,
frameworks, and technologies to build end-to-end solutions.

5. Web Development Tools:

• Various tools aid in the web development process, from text editors like Visual Studio Code
and Sublime Text to version control systems like Git.
• Package managers, task runners, and build tools such as npm, Yarn, and webpack help
automate repetitive tasks and manage project dependencies.

6. Responsive Design:

• With the increasing diversity of devices accessing the internet, responsive design is crucial.
Web developers design websites to be accessible and user-friendly acrossvarious screen
sizes, from desktops to smartphones.

7. Web Development Lifecycle:

• The web development lifecycle involves planning, designing, building, testing, deploying,
and maintaining a website or web application. Agile and DevOps methodologies are
often employed to streamline the development process and enhance collaboration.
8. Security Considerations:
Web developers must prioritize security to protect websites and user data from potential
threats. This involves practices like data encryption, secure authentication mechanisms, and
staying informed about common vulnerabilities.

Web development is a dynamic field, and staying current with emerging technologies and
best practices is essential for success in this rapidly evolving industry. Whether working on
personal projects, for a company, or as part of a development team, web developers play a
crucial role in shaping the digital experiences that users encounter on the internet.
2
CHAPTER 2 BACKEND DEVELOPMENT

2.1 Introduction
Backend development is a critical component of modern web applications. It encompasses the
server-side logic, database management, and API development that underpin the functionality
and performance of online platforms. Backend developers are responsible for designing,
implementing, and maintaining the infrastructure that processes data, handles user interactions,
and ensures the security and scalability of applications. Their expertise in programming
languages, frameworks, and database systems is essential for creating robust, efficient, and
reliable web solutions. Let's explore each component of Backend:

1. MongoDB

• Database: MongoDB is a NoSQL database that stores data in a flexible, JSON-like format
called BSON (Binary JSON). It is known for its scalability, flexibility, and ease of use.
MongoDB is often used to handle large volumes of unstructured or semi-structured data.

2. Express.js:

• Back-end Framework: Express.js is a minimalist and flexible Node.js web application


framework. It simplifies the process of building robust and scalable web applications by
providing a set of features for routing, handling HTTP requests and responses, and
managing middleware.

3. React:

• Front-end Library: React is a JavaScript library for building user interfaces. Developed and
maintained by Facebook, React allows developers to create reusable UI components that
efficiently update in response to data changes. It is widely used for building single-page
applications (SPAs) and dynamic user interfaces.
4. Node.js:

Back-end Runtime: Node.js is a JavaScript runtime built on the V8 JavaScript engine. It


allows developers to execute server-side JavaScript, enabling the use of a single programming

3
language (JavaScript) for both front-end and back-end development. Node.js is known for its
event-driven, non-blocking I/O model, making it well-suited for building scalable and high-
performance server- side applications.

When combined, the MERN stack offers a unified JavaScript-based technology stack for full-stack
development. Here's a brief overview of how each component fits into the development process:

Front-end (React):

• React is used to build the user interface and handle client-side interactions.
• Components created with React can be reused, making the codebase modular and
maintainable.
• React allows for the efficient updating of the UI based on changes in application state.

Back-end (Node.js and Express.js):

• Node.js is used as the runtime environment to execute server-side JavaScript.


• Express.js simplifies the process of building the back-end by providing a framework for
handling routes, requests, and middleware.

Database (MongoDB):

• MongoDB stores and retrieves data in a flexible, JSON-like format, making it suitable for
handling various types of data.
• As a NoSQL database, MongoDB allows for scalability and adaptability to changing data
structure

2.2 MongoDB

MongoDB is a popular and widely-used NoSQL (Not Only SQL) database management system
that falls under the category of document-oriented databases. It is designed to efficiently handle
large volumes of unstructured or semi-structured data, making it well-suited for a variety of

4
applications and use cases. Here are key features and aspects of MongoDB MongoDB's
combination of flexibility, scalability, and ease of use has contributed to its popularity in the
development community. It is particularly well-suited for projects where the data structure is
expected to evolve over time or where a more flexible schema is required :

1. Document-Oriented:

• MongoDB is a document-oriented database, meaning it stores data in flexible, JSON-like


documents called BSON (Binary JSON). BSON is a binary representation of JSON
documents, and it allows for complex data structures and nested arrays.
2. Schema-less Design:

• MongoDB is schema-less, which means that each document in a collection can have a
different structure. This flexibility allows for easy modification and evolution of the data
model without requiring a predefined schema.

3. Collections and Documents:

• In MongoDB, data is organized into collections, which are equivalent to tables in relational
databases. Each collection contains documents, which are individual records or data entries.
Documents are represented in a format similar to JSON.

4. Indexes:

• MongoDB supports the creation of indexes to improve query performance. Indexes can be
created on fields within documents, similar to indexing columns in traditional relational
databases.

5. Query Language:

• MongoDB uses a rich and powerful query language that supports a wide range of queries,
including filtering, sorting, and aggregation. Queries are expressed using a syntax that is
similar to JSON.

6. Aggregation Framework:

5
• MongoDB provides a powerful aggregation framework for performing data transformation
and analysis. It allows developers to perform complex data manipulations and aggregations
directly within the database.
7. Scalability:

• MongoDB is designed to scale horizontally by distributing data across multiple servers or


nodes. This horizontal scaling approach allows MongoDB to handle large amounts of data
and traffic by adding more servers to a cluster.
8. Replication:

• MongoDB supports automatic replication, which involves maintaining multiple copies of


data across different servers. This provides fault tolerance and ensures high availability by
allowing automatic failover to a secondary server in case the primary server fails.

9. Sharding:

• Sharding is a feature in MongoDB that allows for horizontal partitioning of data across
multiple servers or clusters. This helps distribute the load and enables the database to handle
large datasets and high levels of concurrent traffic.

10. Community and Ecosystem:

• MongoDB has a large and active community of developers. The ecosystem includes a
variety of tools, drivers, and connectors for integrating MongoDB with different
programming languages and frameworks.

11. Use Cases:

• MongoDB is suitable for a wide range of applications, including content management


systems, e-commerce platforms, real-time analytics, mobile applications, and more. Its
flexibility and scalability make it adaptable to diverse use cases

MongoDB's combination of flexibility, scalability, and ease of use has contributed to its
popularityin the development community. It is particularly well-suited for projects where the
data structure is expected to evolve over time or where a more flexible schema is required.
6
The US software company 10gen began developing MongoDB in 2007 as a component of a
planne platform as a service product.

In 2009, the company shifted to an open-source development model, with the company offering
commercial support and other services.

In 2013, 10gen changed its name to MongoDB Inc.

On October 20, 2017, MongoDB became a publicly traded company, listed on NASDAQ as
MDB with an IPO price of $24 per share.

On November 8, 2018 with the stable release 4.0.4 the software's license changed from AGPL
3.0 to SSPL.

On October 30, 2019, MongoDB teamed up with Alibaba Cloud, who will offer its customers a
MongoDB-as-a-service solution. Customers can use the managed offering from BABA's global
data centers.

Due to the default security configuration of MongoDB, allowing anyone to have full access to
the database, data from tens of thousands of MongoDB installations has been stolen.
Furthermore, many MongoDB servers have been held for ransom.

In September 2017; updated January 2018, in an official response Davi Ottenheimer, lead
Product Security at MongoDB, proclaimed that measures have been taken by MongoDB to
defend against these risks.

From the MongoDB 2.6 release onwards, the binaries from the official MongoDB RPM and
DEB packages bind to localhost by default. From MongoDB 3.6, this default behavior was
extended to all MongoDB packages across all platforms. As a result, all networked connections
to the database will be denied unless explicitly configured by an administr

2.3 Express.js
Express.js, commonly referred to as Express, is a minimalistic and flexible web application
framework for Node.js. It simplifies the process of building robust and scalable web applications
by providing a set of features and tools for creating web and mobile applications. Express is
7
designed to be unopinionated, allowing developers to structure their applications in the way that
best suits their needs. Here are key aspects and features of Express.js.

Express.js is widely used in the Node.js development community for building web applications and
APIs due to its simplicity, flexibility, and the ease with which it integrates with other technologies
in the JavaScript ecosystem. It serves as a foundational component in many modern web
development stacks.
Express.js was founded by TJ Holo wayc huk. The first release, according to Express.js GitHub
repository, was on 22 May 2010. Version 0.12 In June 2014, rights to manage the project were
acquired by Strong Loop. Strong Loop was acquired by IBM in September 2015; in
January 2016, IBM announced that it would place Express.js under the stewardship of the Node.js
Foundation incubator:

1. Web Application Framework:

• Express.js is a server-side web application framework, built on top of Node.js. It provides a


set of features for building web and mobile applications, handling HTTP requests and
responses, and managing middleware.

2. Routing:

• Express enables developers to define routes for handling different HTTP methods (GET,
POST, PUT, DELETE, etc.) and URL patterns. This routing mechanism allows for the
creation of clean and organized application structures.

3. Middleware:

• Middleware functions are a fundamental concept in Express. They are functions that have
access to the request and response objects and can modify them or terminate the request-
response cycle. Middleware is used for tasks such as authentication, logging, and error
handling.

4. HTTP Utility Methods:

8
• Express provides utility methods for simplifying common HTTP tasks, such as setting
headers, handling redirects, and sending various types of responses.

5. Template Engines:

• While Express itself does not include a template engine, it allows developers to use their
preferred template engines. Common choices include Pug (formerly Jade), EJS (Embedded
JavaScript), and Handlebars. These template engines help in dynamically generating HTML
on the server side.

6. Static File Serving:

• Express makes it easy to serve static files, such as images, stylesheets, and client-side
JavaScript files, by using the `express.static` middleware.
7. Restful API Development:

• Express is commonly used for building RESTful APIs. It simplifies the creation of API
endpoints and the handling of HTTP methods for data retrieval, creation, updating, and
deletion.

8. Error Handling:

• Express provides a mechanism for handling errors during the request-response cycle.
Developers can define error-handling middleware to centralize error processing and
improve code maintainability.
9. Integration with Other Libraries:

• Express can be easily integrated with various libraries and tools, making it a versatile
framework. For example, it can be used in conjunction with database libraries like
Mongoose (for MongoDB) or Sequelize (for SQL databases).

10. Community and Middleware Ecosystem:

• Expresses a large and active community of developers. The ecosystem includes a wide range
of middleware modules that can be easily incorporated into Express applications to add
additional functionality.
11. Scalability:

9
• Express is lightweight and has a minimalistic core, making it scalable for both small and
large applications. Its simplicity and flexibility make it well-suited for a variety of projects.

Express.js is widely used in the Node.js development community for building web applications and
APIs due to its simplicity, flexibility, and the ease with which it integrates with other technologies
in the JavaScript ecosystem. It serves as a foundational component in many modern web
development stacks.
Express.js was founded by TJ Holo wayc huk. The first release, according to Express.js GitHub
repository, was on 22 May 2010. Version 0.12 In June 2014, rights to manage the project were
acquired by Strong Loop. Strong Loop was acquired by IBM in September 2015; in January 2016,
IBM announced that it would place Express.js under the stewardship of the Node.js Foundation
incubator.
The original author, TJ Holowaychuk, described it as a Sinatra -inspired server, meaning that it is
relatively minimal with many features available as plugins. Express is the back-end component of
popular development stacks like the MEAN, MERN or MEVN stack, together with the MongoDB
database software and a javascript front-end framework or library.

2.4 React
React, developed and maintained by Facebook, is a JavaScript library for building user interfaces,
particularly for single-page applications (SPAs) where dynamic, responsive, and interactive user
experiences are crucial. React follows a component-based architecture, allowing developers to
create reusable UI components and manage the state of an application efficiently. Here are key
features and aspects of React:

1. Declarative Syntax:

a. React uses a declarative syntax, making it easy for developers to describe how the UI
should look based on the application's current state. This simplifies the process of
understanding and updating the user interface.

2. Component-Based Architecture:

10
a. React is built around the concept of reusable components. Components encapsulate UI
elements and logic, making it easier to manage and maintain code. Components can be
composed hierarchically to create complex user interfaces.

3. Virtual DOM:

a. React uses a virtual DOM (Document Object Model) to optimize the updating of the
actualDOM. Changes to the UI are first applied to the virtual DOM, and React then
efficiently updates only the necessary parts of the real DOM. This approach results in
improved performance and responsiveness.

b. This approach enables the declarative API of React: You tell React what state you want the UI to
be in, and it makes sure the DOM matches that state. This abstracts out the attribute manipulation,
event handling, and manual DOM updating that you would otherwise have to use to build your
app.
c. Since “virtual DOM” is more of a pattern than a specific technology, people sometimes say it to
mean different things. In React world, the term “virtual DOM” is usually associated with React
elements since they are the objects representing the user interface. React, however, also uses
internal objects called “fibers” to hold additional information about the component tree. They
may also be considered a part of “virtual DOM” implementation in React.

4. JSX (JavaScript XML):

a. JSX is a syntax extension for JavaScript that allows developers to write HTML-like code
within their JavaScript files. JSX is then transformed into regular JavaScript code during
the build process. It makes React components more readable and expressive.
b. React embraces the fact that rendering logic is inherently coupled with other UI logic: how events
are handled, how the state changes over time, and how the data is prepared for display.
c. Instead of artificially separating technologies by putting markup and logic in separate files,
React separates concerns with loosely coupled units called “components” that contain both. We
will come back to components in a further section, but if you’re not yet comfortable putting
markup in JS, this talk might convince you otherwise.
11
d. React doesn’t require using JSX, but most people find it helpful as a visual aid when working
with UI inside the JavaScript code. It also allows React to show more useful error and warning
messages.
5. One-Way Data Binding:

a. React follows a unidirectional data flow, meaning that the data flows in a single direction
from parent components to child components. This helps in maintaining a predictable
stateand makes it easier to debug and understand the application's behavior.

6. State and Props:

a. React components can have both state and props. State represents the internal state of a
component, and when the state changes, React re-renders the component. Props (short
for properties) are used to pass data from parent components to child components

7. React Hooks:

a. React Hooks, introduced in React 16.8, allow functional components to use state and
lifecycle features that were previously available only in class components. Hooks enable
developers to reuse stateful logic across components.
8. Lifecycle Methods:

a. Class components in React have lifecycle methods that allow developers to execute code
at different points in a component's life, such as when it is mounted, updated, or
unmounted. With the introduction of hooks, functional components can achieve similar
functionality.

9. React Router:

a. React Router is a popular library for handling navigation and routing in React
applications.It allows developers to create a single-page application with multiple views
or pages withoutthe need for a full page reload.

10. Flux and Redux:

12
a. React can be used with Flux architecture or libraries like Redux for managing the state
of larger applications. These patterns provide a predictable and centralized way to
manage application state.

11. Community and Ecosystem:

a. React has a large and active community of developers. The ecosystem includes a variety
of libraries, tools, and resources that enhance React development, such as state
management libraries, UI component libraries, and development tools.

React has become a go-to library for many developers and organizations due to its efficiency in
building dynamic and interactive user interfaces. It is widely adopted in the industry and plays a
keyrole in the development of modern web applications.

2.5 NPM

NPM, short for Node Package Manager, is a powerful tool designed to handle and manage
packages in the JavaScript ecosystem. It was created to work alongside Node.js and has grown
to become the world's largest software registry. It simplifies the process of managing project
dependencies, making it easier for developers to build and maintain scalable applications..

Key Functions of NPM:

1. Package Installation:
NPM allows developers to install third-party packages and libraries via simple
commands. For example, running npm install <package-name> will fetch and install the
desired package into your project.

2. Dependency Management:

13
NPM helps in keeping track of project dependencies, saving them in a package.json file.
It ensures that the correct versions of the packages are installed, helping in resolving
compatibility issues.

3. Versioning and Updates:


Packages on NPM follow Semantic Versioning (SemVer), which makes it easier to
upgrade or rollback to specific versions. NPM provides commands to check for outdated
packages and update them accordingly.

4. Local and Global Packages:


NPM supports the installation of packages locally (specific to a project) and globally
(available across the system).

5. Package Publishing:
Developers can create their own packages and publish them to the NPM registry, making
them available for use by others. This encourages community-driven development and
code reuse.

6. NPM Scripts:
NPM allows users to define custom scripts in the package.json file. These scripts can
automate tasks like testing, building, or running applications, simplifying the
development workflow.

2.6 Node.js
Node.js is an open-source, cross-platform JavaScript runtime environment built on the V8
JavaScript engine developed by Google. It allows developers to execute JavaScript code server-
side, enabling the creation of scalable and high-performance network applications. Node.js is
particularly well-suited for building real-time web applications and APIs. Here are key features
and aspects of Node.js:

14
1. JavaScript Runtime:

• Node.js is primarily known for executing JavaScript on the server side, extending the use of
JavaScript beyond the browser to build full-stack applications.

2. V8 JavaScript Engine:

• Node.js is built on the V8 JavaScript engine, the same engine used in the Google Chrome
browser. V8 compiles JavaScript code into machine code, providing fast and efficient
execution.

3. Event-Driven and Asynchronous:

• Node.js follows an event-driven, non-blocking I/O model. This means that it can handle many
concurrent connections without the need for multi-threading, making it efficient for building
scalable applications.

4. Single-Threaded, Event Loop:

• Node.js is single-threaded, but it uses an event loop to handle asynchronous operations. This
allows Node.js to efficiently handle a large number of concurrent connections without the
overhead of traditional multi-threading.

5. NPM (Node Package Manager):

• NPM is the default package manager for Node.js, providing a vast ecosystem of open-source
libraries and tools that developers can easily integrate into their projects. NPM simplifies
the process of dependency management and project configuration.

6. CommonJS Modules:

• Node.js uses the CommonJS module system for organizing and structuring code. Modules
enable developers to encapsulate functionality and share code between different parts of an
application.

7. Built-In Modules:

15
• Node.js comes with a set of built-in modules that provide essential functionality for building
server-side applications. These include modules for file system operations, networking, and
handling HTTP requests.

8. Cross-Platform:

• Node.js is designed to be cross-platform, meaning it can run on various operating systems,


including Windows, macOS, and Linux. This makes it easier for developers to build and
deploy applications across different environments.

9. Scalability:

• Node.js is well-suited for building scalable applications, particularly those requiring real- time
features. Its non-blocking, event-driven architecture allows it to handle a large number of
simultaneous connections efficiently.

10. Community and Ecosystem:

• Node.js has a large and active community of developers. The ecosystem includes a wide range
of libraries and frameworks for building web applications, APIs, and other server- side
solutions.

11. Use Cases:

• Node.js is commonly used for building web servers, APIs, real-time applications (such as chat
applications and online gaming), and microservices. It is a popular choice for developers
working on projects that require high concurrency and low-latency responses.
Node.js has had a significant impact on the development landscape, enabling the creation of fast
and scalable server-side applications using JavaScript. Its lightweight and efficient architecture
make it a preferred choice for modern web development.

16
Figure 2.1 MERN Stack Development

2.7 Key Concepts of an API:

1. Interface for Communication:


APIs provide a standard way for different software systems to interact, often by sending
and receiving data or executing specific commands. This interaction can happen between
different parts of the same application or between entirely different applications.

2. Endpoints:
In API terminology, an endpoint is a specific path where a particular resource can be
accessed. APIs usually consist of multiple endpoints that offer various services or data
interactions.

3. Request and Response:


APIs operate through a request-response model. A client sends a request to the API with
specific parameters or instructions, and the API processes this and sends back a response.
The response could be data (e.g., JSON, XML) or confirmation of an action (e.g.,
success, failure).

4. Methods:
APIs typically use HTTP methods (especially in web-based APIs) for interaction:

17
GET: Retrieve data from a resource.
POST: Submit data to a server to create a resource.
PUT/PATCH: Update an existing resource.
DELETE: Remove a resource.
Authentication: Many APIs require authentication to ensure secure access to the system. This could
involve API keys, tokens, or OAuth for verifying the identity of the client making the request.

Types of APIs:

1. Web APIs: The most common type, web APIs, are used for exchanging data over the
internet. REST (Representational State Transfer) and SOAP (Simple Object Access Protocol) are
popular architectural styles for designing these APIs.

2. Operating System APIs: APIs that allow software to interact with an operating system.
For example, Windows API provides functions for interacting with system resources like files or
memory.

3. Library/Framework APIs: Many programming libraries or frameworks come with their


own APIs, which allow developers to use pre-defined functions or objects without needing to
know the underlying details.

5. Database APIs: These APIs allow applications to interact with databases by performing
queries, updates, or deletions.

Importance of APIs:

1.Integration: APIs allow different applications, services, or platforms to integrate seamlessly,


creating rich, connected ecosystems. For example, an e-commerce website may integrate a
payment gateway API to handle transactions.

18
2.Reusability: APIs promote code reusability by providing a way to use existing functionalities
rather than building everything from scratch.

3.Automation: APIs enable automation of tasks by allowing systems to communicate and trigger
actions programmatically.

4.Scalability: APIs allow businesses to scale their services easily by providing external access to
their software components, opening opportunities for third-party development.

Real-world Examples:

Google Maps API: Allows developers to integrate mapping and location services into their
applications.

Twitter API: Provides access to Twitter’s data, enabling developers to read tweets, post content,
and interact with users programmatically.

Stripe API: Enables online businesses to accept payments by integrating its payment processing
system.

2.8 Mongoose

Mongoose is a powerful Object Data Modeling (ODM) library for MongoDB and Node.js,
providing a straightforward, schema-based solution for modeling and interacting with MongoDB
documents. It simplifies the process of working with MongoDB, a NoSQL database, by offering
features that make it easier to structure, validate, and query data.

Key Features of Mongoose:

1.Schema Definition: Mongoose allows developers to define schemas for MongoDB collections,
enforcing structure on the data. A schema specifies the shape of documents within a collection,
such as the data types, default values, and constraints on each field.
19
2.Models: In Mongoose, models are constructed from schemas and represent collections in
MongoDB. A model provides an interface for interacting with the database, enabling the creation,
reading, updating, and deletion (CRUD) of documents.

3.Data Validation: Mongoose offers built-in data validation, ensuring that data entered into the
database adheres to the specified schema. Developers can also define custom validation rules to
further enforce data integrity.

4.Middleware (Hooks): Mongoose supports middleware functions (also called hooks) that can
run at different points in the lifecycle of a model operation (e.g., before or after saving, updating,
or deleting a document). This allows for preprocessing or modifying data during operations.

5.Relationships: Although MongoDB is non-relational, Mongoose allows for defining


relationships between collections through referencing or embedding documents. This gives
developers the flexibility to simulate relational database behavior, such as populating related
documents.

6.Query Building: Mongoose provides a simple and intuitive API for querying MongoDB
documents. Complex queries, filtering, sorting, and pagination can be performed using the
methods provided by Mongoose, simplifying database operations.

7.Virtuals: Virtual properties in Mongoose are additional fields that don’t get persisted in the
database but are computed dynamically when documents are retrieved. For instance, you could
create a fullName virtual that combines firstName and lastName fields.

8.Plugins: Mongoose has a flexible plugin system, allowing developers to extend its functionality
with custom or third-party plugins. This makes it easy to add features like automatic
timestamping, versioning, or soft deletes.

20
Here’s a simple example of defining a schema and model with Mongoose:

Figure 2.2 Mongoose

Use Cases of Mongoose:

1.Web Applications: Mongoose is commonly used in web applications to manage user data,
session information, and other structured datasets.

2.API Development: It is frequently used in building RESTful APIs where MongoDB is the
database of choice.

3.Prototyping: Due to its flexibility and ease of use, Mongoose is often chosen for rapid
prototyping in Node.js applications.

21
2.9 JWT (JSON Web Token)

JWT (JSON Web Token) is an open standard (RFC 7519) for securely transmitting information
between parties as a compact, self-contained, and digitally signed token. It is commonly used for
authentication and authorization in web applications and APIs. The token is encoded in a JSON
format and can be easily passed between client and server as part of an HTTP request.

Structure of a JWT:
A JWT consists of three parts, each encoded in Base64 and separated by dots (.):

Header: Contains metadata about the token, such as the type of token (JWT) and the signing
algorithm used (e.g., HMAC SHA256 or RSA).

Payload: Contains the claims or data that is being transmitted. Claims can include information
about the user (like userId, email) or token-specific details (such as iat for the issued timestamp,
and exp for the expiration time).

Signature: The signature is used to verify the authenticity of the token. It is generated by signing
the encoded header and payload using a secret or private key, along with the specified algorithm.
This ensures that the token has not been tampered with.

Key Characteristics of JWT:

1.Self-Contained: JWTs contain all the necessary information (claims) within the token itself,
meaning no need to store session data on the server.

2.Compact and Portable: JWTs are compact, making them ideal for use in HTTP headers,
URLs, or cookies, as they are easy to pass between the client and server.

3.Stateless: Since JWTs are self-contained and don't require server-side sessions, they are often
used in stateless authentication systems, making scaling easier for distributed applications.
22
4.Signed and Secure: JWTs are digitally signed, ensuring their integrity and authenticity.
Depending on the signing algorithm (e.g., HMAC, RSA), the signature can be verified using a
secret or public/private key pair.

23
CHAPTER 3 TOOLS USED

3.1 Visual Studio Code


Visual Studio Code (VS Code) is a highly acclaimed, cross-platform source code editor
developed by Microsoft, widely embraced in the web development community. Known for its
lightweight and fast performance, it caters to developers on Windows, macOS, and Linux. The
editor excels in intelligent code editing, featuring syntax highlighting, autocompletion, and
smart suggestions for a plethora of programming languages commonly used in web
development.

One of VS Code's standout features is its seamless Git integration, enabling version control
operations directly within the editor. The expansive extension ecosystem, accessible through
the Visual Studio Code Marketplace, allows developers to augment their workflows with a
variety of extensions spanning languages, frameworks, themes, and tools.

The integrated terminal is a notable convenience, facilitating the execution of command-line


tools and scripts without leaving the editor. Debugging is streamlined through the built-in
debugger, empowering developers with breakpoint setting, variable inspection, and a smooth
debugging experience across multiple languages.

Task automation is simplified, with VS Code supporting tasks and build systems for effortless
configuration and execution of common development tasks. Live server functionality and live
preview features further enhance the development experience, providing real-time updates as
developers make changes to their code.

VS Code's IntelliSense capabilities offer context-aware code completion, supporting languages


like TypeScript, JavaScript, HTML, and CSS. The editor's commitment to accessibility,theming
options, and customization allows users to tailor their coding environment to suit their
preferences.
Backed by a vibrant community, VS Code receives regular updates that incorporate user
feedback and ensure its continuous improvement. With its combination of speed, flexibility, and
a rich feature set, Visual Studio Code has become a staple for web developers tackling a diverse
range of projects.

24
Figure 3.1: Visual Studio Code

3.2 Postman
Postman is a robust API development and testing platform known for its user-friendly interface
and comprehensive features. It simplifies API development by providing a workspace where
developers can create, test, and manage APIs efficiently. Users can organize API requests into
collections, apply environment variables for easy switching between different environments,
and write JavaScript scripts for automated testing.

With collaborative workspaces, Postman facilitates teamwork by allowing members to share


requests, collections, and environments. The platform supports mock servers, aiding in
simulating API endpoints and responses during early development stages. Postman's
automation features enable scheduling of tests and monitoring tasks, and its integration with
CI/CD pipelines ensures API testing is seamlessly incorporated into the development workflow.
The tool also generates API documentation automatically, aiding in project documentation and
communication. Postman's security features, including OAuth 2.0 support and SSL certificate
validation, contribute to its status as an essential tool for developers and teams involved in API
development.
25
Figure 3.2: Postman

3.3 MongoDB Compass


MongoDB Compass serves as the official graphical user interface (GUI) for MongoDB, offering
a user-friendly environment for developers and administrators to interact with MongoDB
databases. The GUI is designed with intuitiveness in mind, providing users, regardless of their
MongoDB expertise, with a visually accessible platform to explore and manage their MongoDB
data.

One of its standout features is the Visual Data Exploration capability, allowing users to interact
with MongoDB data through visual representations of collections, documents, and fields. This
aids in comprehending the data structure and content. The Query Builder is a powerful tool,
enabling users to construct MongoDB queries visually, a valuable feature for those less familiar
with the intricacies of MongoDB query syntax.

MongoDB Compass simplifies the process of managing indexes in real-time, providing a clear
view of existing indexes, allowing users to create new ones, and assessing the impact of

26
different indexing strategies on query performance. The Aggregation Pipeline Builder facilitates
the construction and modification of complex data processing tasks using a visual interface.

For geospatial data, Compass supports visualization and querying, including the creation and
analysis of geospatial indexes for location-based information. Performance analysis tools
enable users to profile and scrutinize query performance, aiding in the identification of potential
bottlenecks and optimization of database operations.

The GUI also manages multiple MongoDB connections seamlessly, allowing users to navigate
between various databases and server instances effortlessly. Additionally, Compass supports
document validation rules for MongoDB collections, ensuring data integrity by enforcing
predefined criteria.

Figure 3.3: MongoDB Compass

27
CHAPTER 4

PROJECT DESCRIPTION

4.1 INTRODUCTION
4.1.1 Purpose
The main purpose of this document is to describe the external requirements for the TravelNest platform,
inspired by Airbnb. It outlines the interfaces, functionalities, and specifications necessary to meet user
expectations and enhance the user experience when searching, booking, and managing
accommodations.
4.1.2 Scope
This document serves as a comprehensive guide for the requirements of the TravelNest platform. It is
intended for both developers and stakeholders and will serve as the basis for validating the final
delivered solution. Any future modifications to the requirements must follow a formal change approval
process. Developers are responsible for seeking clarifications when necessary and are prohibited from
making alterations without client approval.
4.1.3 Developer's Responsibilities Overview
The developer is responsible for

4.2. GENERAL DESCRIPTION


4.2.1 Product Function Overview
The layout of this project is outlined below:
• User Authentication (Login/Logout)
• Accommodation Search and Filtering (Location, Price, Amenities)
• Booking Management (Reservation, Cancellation, Modification)
• User Profile Management (View/Edit Personal Info)
• Host Dashboard (Manage Listings, View Bookings)
• Payment Processing (Booking Payments, Refunds)
• Admin Dashboard
• User Reviews and Feedback

4.2.2 User Characteristics

28
The system is designed to be user-friendly, catering to individuals familiar with web applications. User
roles include:
• Administrator: Has full control over the system, including user and listing management, booking
oversight, and system configuration.
• Host: Users who list accommodations on the platform, manage bookings, and handle guest
communications.
• Guest: Users who search, book accommodations, and manage their reservations.
4.2.3 General Constraints
The system should be accessible via any modern web browser on devices running Windows, macOS,
or Linux operating systems.
4.3 SPECIFIC REQUIREMENTS
4.3.1.1 User Interfaces
The platform should be accessible via any modern web browser on devices running Windows, macOS,
Linux, iOS, or Android.
4.3.1.2 Software Interfaces
Users can search for accommodation by location, price, amenities, and availability. The system retrieves
data from the accommodation database and third-party APIs.
4.3.1.2.2 Booking Management
The system allows users to reserve, modify, or cancel bookings. It interacts with the accommodation
and user databases to ensure accurate availability and pricing.
4.3.1.2.3 User Reviews
Guests can submit reviews after their stay. These reviews are linked to both the user profile and the
accommodation listing.
4.3.1.2.4 Payment Processing
This interface processes payments for bookings and handles refunds, interacting with secure payment
gateways.
4.3.1.2.5 Admin Tools:
Administrators can manage user accounts, accommodation listings, and system settings through a
dedicated interface.
4.3.2 Functional Requirements
1) Error Handling:
If a user enters incorrect credentials, the system should provide an option to re-enter the information.
29
2) User Login:
• Users submit their credentials.
• If credentials are valid, they gain access to system features.
4.3.3 Performance Constraints
The platform must be hosted on a cloud service capable of handling high traffic volumes, ensuring
smooth functionality for multiple concurrent users.
4.3.4 Design Constraints
4.3.4.1 Software Constraints
The application is developed using ReactJS for the frontend and Node.js for the backend. It interacts
with MongoDB for data storage and uses Stripe for payment processing.
4.3.4.2 Hardware Constraints
As a cloud-based platform, the system requires minimal hardware on the user’s end, primarily a device
with internet access.
4.3.4.3 Network Connections
A stable internet connection is necessary for optimal performance and access to TravelNest’ s services.
4.3.5 Security
Security is crucial in the TravelNest platform. Access controls are implemented, ensuring that only
authorized users can modify critical data. Sensitive user information, such as payment details, is
encrypted during transmission.
4.3.6 Maintainability
The system must be updated regularly to incorporate changes in user preferences, third-party API
updates, and technological advancements. The administrator will monitor user feedback and system
performance to ensure the platform meets evolving needs.
4.3.7 Acceptance Criteria
Before the system is accepted, the developer must demonstrate that all functionalities work as intended.
This will include presenting test cases and user feedback that confirms the system meets the specified
requirements.
4.4 MODULE DECOMPOSITION
The project is divided into two primary modules: Host Module and Guest Module.
• Host Module: Manage Listings (Add/Edit/Remove Properties)
• View Bookings and Reservation History
• Manage Reviews and Ratings
30
• Update Profile Information
• Respond to Guest Inquiries

• Guest Module: Search for Accommodations
• Book/Cancel Accommodations
• View Booking History
• Submit Reviews and Feedback
• Update Profile Information

4.5 DATA DECOMPOSITION


• Login Table: Stores usernames, hashed passwords, and user roles (Host/Guest/Admin).
• Accommodation Table: Contains details about the listed properties, such as name, location,
price, availability, and amenities.
• Booking Table: Stores booking information, including guest details, booking date, check-
in/check-out dates, and total cost.
• Review Table: Holds guest reviews, including review content, ratings, and submission date.
• User Table: Stores user profile information, including name, contact details, and role.

4.6 DEPENDENCY DESCRIPTION


This section details the inter-module dependencies within the TravelNest platform. It highlights how
data flows between modules to support various workflows.
Interface Description
• Accommodation Management: Hosts can add or remove listings through an interface that
updates the accommodation details in the system database.
• Booking Management: Guests can book or cancel reservations through an interface that interacts
with both the accommodation and user databases.
• User Reviews: Guests can submit reviews, which are linked to both their profile and the specific
accommodation.
• Messaging: Hosts and guests can send messages through an in-platform messaging system.
• Payment Processing: The system processes payments via a secure payment gateway, storing
transaction records in the booking database.
31
CHAPTER 5 SCREENSHOTS OF PROJECT

Figure 5.1: Home Page

Figure 5.2: Exploration Page

32
Figure 5.3: Signup Uploading

Figure 5.4 : Price With GST

33
Figure 5.5: Location Info

Figure 5.6: Upload alert

34
CONCLUSION

The comprehensive training program on Backend Development at Learn and Build has been an
invaluable experience, equipping me with a strong foundation in the essential technologies of
MongoDB, Express.js, React, and Node.js. Through hands-on projects and guided learning, I have
developed proficiency in crafting robust and scalable backend solutions. This training has not only
sharpened my technical skills but has also fostered a deep understanding of the interconnectedness
between frontend and backend development.

While my focus has been on backend development, I am confident in my ability to contribute


effectively to full-stack projects. The knowledge gained from this training has provided me with a
solid framework for understanding and collaborating with frontend developers, ensuring a
seamless and integrated user experience.

I am excited to apply the skills and insights acquired from this training to real-world projects. I am
particularly interested in exploring opportunities to develop innovative backend solutions that
address complex challenges and deliver tangible value to users.

35
FUTURE SCOPE

The future scope of back-end development using the MERN (MongoDB, Express.js, React,
Node.js) stack is highly promising, driven by ongoing trends in web development. As businesses
prioritize scalable and efficient back-end solutions, the demand for developers proficient in
backend technologies is expected to grow.

Key trends include the rise of serverless architectures. Node.js, with its non-blocking, event-driven
model, is well-suited for serverless environments, offering flexibility in deployment and dynamic
scaling. Microservices and containerization, integral to modern application development, are also
gaining traction. MERN's back-end, particularly Node.js and Express.js, facilitates modular
application development, while tools like Docker and Kubernetes enhance microservice
orchestration.

Additionally, NoSQL databases like MongoDB are evolving to meet growing needs for scalability
and performance. MongoDB’s schema flexibility allows back-end developers to adapt to complex
data requirements. The continuous development of Node.js, Express.js, and MongoDB ensures
regular updates, bug fixes, and performance improvements, keeping the stack relevant.

In summary, the MERN stack is positioned to remain a popular choice for scalable, modular, and
efficient back-end development.

36
REFERENCES

MongoDB: -https://www.mongodb.com/docs/

Express: -www.npmjs.com/package/express

GeeksforGeeks: -www.geeksforgeeks.org/mern-stack/

JavaTPoint: -www.javatpoint.com/mern-stack

NodeJs:- https://nodejs.org/en/docs

37

You might also like