0% found this document useful (0 votes)
26 views70 pages

Final Report of IMS

The document is a final year project report on the development of an Inventory Management System using the MERN stack, aimed at improving efficiency and accuracy in inventory management for businesses. It details the project's objectives, methodologies, and features such as fuzzy search and quick sort algorithms, which enhance data handling and retrieval. The report includes acknowledgments, a letter of approval, and a structured outline of the project's components, including system design and testing methodologies.

Uploaded by

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

Final Report of IMS

The document is a final year project report on the development of an Inventory Management System using the MERN stack, aimed at improving efficiency and accuracy in inventory management for businesses. It details the project's objectives, methodologies, and features such as fuzzy search and quick sort algorithms, which enhance data handling and retrieval. The report includes acknowledgments, a letter of approval, and a structured outline of the project's components, including system design and testing methodologies.

Uploaded by

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

Tribhuvan University

Academia International College

Final Year Project Report


On
Inventory Management System
Using Fuzzy Search
[CSC 412]

Under the supervision of


“Mr. Ashish Shrestha”
“Lecturer”

Submitted by
Aathiti Shakya [T.U. Exam Roll No: 23992]
Mibija Singh [T.U. Exam Roll No: 24011]
Nirvik Shakya [T.U. Exam Roll No: 24013]

Submitted to
Department of Computer Science and Information Technology
Academia International College
Institute of Science and Technology
Tribhuvan University
March 2024
Tribhuvan University
Academia International College

Final Year Project Report


On
Inventory Management System
Using Fuzzy Search
[CSC 412]

A final year project submitted in partial fulfillment of the requirement for


the degree of Bachelor of Science in Computer Science and Information
Technology awarded by Tribhuvan University

Submitted by
Aathiti Shakya [T.U. Exam Roll No: 23992]
Mibija Singh [T.U. Exam Roll No: 24011]
Nirvik Shakya [T.U. Exam Roll No: 24013]

Submitted to
Department of Computer Science and Information Technology
Academia International College
Institute of Science and Technology
Tribhuvan University
March 2024
Tribhuvan University
Faculty of Computer science Information Technology

Academia International College

LETTER OF APPROVAL
This is to certify that this project prepared by Aathiti Shakya, Mibija Singh and
Nirvik Shakya entitled “Inventory Management System” in partial fulfillment of the
requirement for the degree of B.Sc. in Computer Science and Information Technology
has been well studied. In our opinion it is satisfactory in scope and quality as a project
for the required degree.

……………………….. ………………………..
Ashish Shrestha, Lecturer Santosh Rijal
Project Supervisor HOD/Coordinator
Department of Computer Science and IT Department of Computer Science and IT
Academia International College Academia International College

……………………….. ………………………..
Internal Examiner
External Examiner
Academia International College

i
Tribhuvan University
Institute of Science and Technology
Academia International College
Department of Computer Science and Information Technology
Email: mail@academiacollege.edu.np

SUPERVISOR’S RECOMMENDATION

The project work report entitled ‘Inventory Management System’ submitted by


Aathiti Shakya(23992/076), Mibija Singh(24011/076), and Nirvik Shakya
(24013/076), of Academia International College, is prepared under my supervision
as per the procedure and format requirements laid by the Faculty of B.Sc. CSIT,
Tribhuvan University, as partial fulfillment of the requirements for Bachelor of
Science in Computer Science and Information Technology (B.Sc. CSIT). We,
therefore, recommend the project work report for evaluation.

................................................
Ashish Shrestha
Project Supervisor
Lecturer
Department of Computer Science and IT
Academia International College
Gwarko,Lalitpur

ii
Acknowledgement
We would like to express our sincere gratitude to all those who contributed to the
successful completion of this project.
First and foremost, we extend our deepest appreciation to our supervisor Mr. Ashish
Shrestha for his immense guidance, support, and encouragement throughout the
development of this Inventory Management System. His insights have been very
helpful in shaping the project and ensuring its quality.
We are also immensely thankful to Academia International College, particularly
Mr. Santosh Rijal, for providing us with the resources, infrastructure, and
opportunity to undertake this project. The continuous assistance and cooperation
from the staff and management have been crucial in overcoming challenges and
achieving our objectives. Additionally, we would like to acknowledge the valuable
feedback and support received from friends and teachers. Their encouragement and
understanding have been a source of motivation during the project's journey.
Finally, we express our gratitude to all the individuals, organizations, and resources
that have directly or indirectly contributed to the completion of this project. Your
involvement has been deeply appreciated.

Regards,
Aathiti Shakya(23992/076)
Mibija Singh(24011/076),
Nirvik Shakya(24013/076).

iii
Abstract
The project proposes the development of an inventory management system using
the MERN (MongoDB, Express.js, React.js, Node.js) stack to address challenges in
traditional inventory management practices. It is a web application tailored to
address the specific needs and challenges faced by the company in managing its
inventory. It offers functionalities such as inventory tracking, stock level
monitoring, order management, and reporting tools, all integrated into a user-
friendly interface. We used Quick Sort and Fuzzy Search Algorithms for
incorporating dynamic sorting and expanding search capabilities. Additionally,
robust data deduplication techniques and optimize stock and order organization are
performed. Through the adoption of modern inventory management solutions built
on the MERN stack, organizations can realize significant improvements in
efficiency, cost savings, and competitive advantage in today's dynamic market
environment.
Keywords: Digital Platform, Fuzzy Search, Inventory Management System, MERN,
Track Product.

iv
Table of Contents

LETTER OF APPROVAL....................................................................................................i

SUPERVISOR’S RECOMMENDATION..........................................................................ii

Acknowledgement...............................................................................................................iii

Abstract...............................................................................................................................iv

List of Figures......................................................................................................................v

List of Tables.......................................................................................................................vi

List of Abbreviations..........................................................................................................vii

Chapter 1: Introduction.........................................................................................................1

1.1. Introduction...........................................................................................................1

1.2. Problem Statement.................................................................................................2

1.3. Objectives:.............................................................................................................2

1.4. Scope and Limitation:............................................................................................2


1.4.2. Scope:.............................................................................................................2

1.5. Development Methodology:...................................................................................3


1.5.1. Incremental Model.........................................................................................3

1.6. Report Organization..............................................................................................5

Chapter 2: Background Study and Literature Review..........................................................6

2.1. Background Study:................................................................................................6

2.2. Literature Review:.................................................................................................6

Chapter 3: System Analysis..................................................................................................9

3.1. System Analysis....................................................................................................9


3.1.1. Requirement Analysis....................................................................................9
3.1.2. Feasibility Analysis......................................................................................13
3.1.3. Analysis........................................................................................................17

Chapter 4: System Design..................................................................................................22

v
4.1. Architectural Design:...........................................................................................22
4.1.1. System Architecture:....................................................................................22
4.1.2. Application Architecture:.............................................................................23
4.1.3. Refinement of Class and object diagram......................................................24
4.1.4. Component Diagram....................................................................................25
4.1.5. Deployment Diagram...................................................................................26

4.2. Algorithm Details:...............................................................................................27


4.2.1. Quick Sort:...................................................................................................27
4.2.2. Fuzzy Search:...............................................................................................28
4.2.3. JWT..............................................................................................................30

Chapter 5: Implementation and Testing..............................................................................31

5.1. Implementation:...................................................................................................31
5.1.1. Tools Used:...................................................................................................31
5.1.2. Implementation of modules:........................................................................32

5.2. Testing:................................................................................................................33
5.2.1. Test Cases for Unit Testing:.........................................................................34
5.2.2. Test Cases for System Testing:....................................................................36

5.3. Result Analysis:...................................................................................................39

Chapter 6: Conclusion and Future Recommendation.........................................................40

6.1. Conclusion:..........................................................................................................40

6.2. Future Recommendations:...................................................................................40

References..........................................................................................................................41

Appendix............................................................................................................................44

vi
List of Figures
Figure 1.1: Incremental Model....................................................................................4
Figure 3.1: Use Case of Super Admin…...................................................................11
Figure 3.2: Use case of User.....................................................................................12
Figure 3.3: Gantt Chart..............................................................................................15
Figure 3.4: State Diagram of Inventory Management System..................................16
Figure 3.5: Class diagram of Inventory Management System...................................17
Figure 3.6: Object diagram of Inventory Management System.................................18
Figure 3.7: Sequence diagram of Inventory Management System............................19
Figure 3.8: Activity Diagram for Inventory Management System............................20
Figure 4.1: 3-tier Architecture....................................................................................21
Figure 4.2: MVC Architecture...................................................................................22
Figure 4.3: Refinement of class diagram...................................................................23
Figure 4.4: Refinement of object diagram.................................................................24
Figure 4.5: Component Diagram of Inventory Management System........................25
Figure 4.6: Deployment Diagram of Inventory Management System.......................26

v
List of Tables
Table 3.1: MERN Package Table.......................................................................................14
Table 3.2: Economic Feasibility Table..............................................................................15
Table 5.1: Test Environment Table....................................................................................35
Table 5.2: Test Environment for Creating New Account Table........................................37
Table 5.3: Test Environment for Updating Account Table................................................37
Table 5.4: Authentication and Verification of User Table................................................38
Table 5.5: Test to add new items Table.............................................................................38
Table 5.6: Test to updating items Table..............................................................................39
Table 5.7: Test to deleting items Table..............................................................................39
Table 5.8: Test to search item Table..................................................................................39
Table 5.9: UI testing Table................................................................................................40
Table 5.10: Integrity test of data Table..............................................................................40
Table 5.11: Authentication test of user Table.....................................................................41
Table 5.12: Error handling test Table................................................................................41
Table 5.13: Report bug testing Table.................................................................................41

vi
List of Abbreviations
AI - Artificial Intelligence
API - Application Programming Interface
BSON - Binary JavaScript Object Notation
CRUD - Create, Read,Update, Delete
DB - Database
DOM - Document Object Mode
HTTP - Hypertext Transfer Protocol
I/O - Input/Output
IMS - Inventory Management System
JS - JavaScript
JSON - JavaScript Object Notation
JWT - JSON Web Token
MERN - MongoDB, Express.js, React, Node.js
ML - Machine Learning
NoSQL - No Structured Query Language
REST - Representational State Transfer
SCSS - Sassy Cascading Style Sheets
SDLC - Software Development Life Cycle
SKU - StockKeeping Unit
SPA - Single Page Application
UI - User Interface
UML - Unified Modeling Language
URL - Uniform Resource Locator

vii
Chapter 1: Introduction
1.1. Introduction
Inventory Management System is a web-based system which is built to maintain an
inventory catalog for dealing with the supplies. This system provides a platform
where there are various features which a client in need of an inventory must have.
Inventory management system is used for adding the information in digital form
which are collected by the owner in the form of hard copies or spreadsheets. To
manage the client’s account accurately, an owner is required to implement precise
information about them into the management system.
Our system is created to help new businesses, especially startups, which often face
challenges due to limited budgets and resources. It provides affordable solutions and
streamlined processes, making it easier for these businesses to operate smoothly and
grow. Our system includes a product management feature, making it easier for
startups in business to handle transactions efficiently. The goal of this project is to
improve efficiency, reduce errors, and enhance overall inventory control. This
inventory management system software provides simple inventory control in a
particular format for the convenience of the client for the management of their
inventory. [1]
Inventory Management System Software is built with the help of MERN stack and
SCSS where the whole program is built using React.JS. React.JS is chosen for its
library that ensures a better user experience with faster loading time as it is an SPA
framework provided by JavaScript. SCSS is used for the better and unique designing
of the website which is further enhanced by Node.JS and Express.JS which is used as
backend, providing features such as database management and APIs. MongoDB
which is a NoSQL database is used to store the dataset which is utilized during the
development of this system.

In the context of an inventory management system, the implementation of quick sort


and fuzzy search algorithms has significantly enhanced the efficiency of handling
and retrieving data. Quick sort, a highly efficient sorting algorithm, is used to
organize the inventory data based on various parameters such as item_ID or name.
This ensures that the inventory remains consistently sorted, facilitating faster search
operations. Fuzzy search, an intuitive and versatile search algorithm, offers
invaluable functionality in efficiently locating approximate matches within a
1
dataset. Similar to binary search's logarithmic efficiency, fuzzy search employs
intelligent techniques to rapidly narrow down potential matches, even in cases where
exact matches are not available or feasible. By intelligently comparing patterns and
similarities, fuzzy search drastically reduces the time and effort required to pinpoint
relevant items, thereby enhancing the responsiveness and effectiveness of the search
process. Through its efficient and flexible approach, fuzzy search enhances overall
performance, making it an indispensable tool for modern information retrieval tasks.
[2]

1.2. Problem Statement


There are significant issues with the current inventory management system that limit its
accuracy and efficiency. Errors in manual data entry plague the system, causing
inequality between reported inventory levels and real goods on hand. The consistency
of the inventory data is compromised by this variance, which also makes decision-
making more difficult. Additionally, the previous inventory management system was
burdened with high price points, which compounded the challenges faced. This
financial strain further underscored the urgency for a more efficient and cost-effective
solution to maximize operational effectiveness and fiscal prudence. It also takes a
while for users to find specific things in the inventory due to the lack of a strong
sorting and search tool. Hence, there's a critical need for a modern system that can data
entry effortlessly, reduce errors, and incorporate advanced sorting and searching
methods to streamline operations.

1.3. Objectives:
The project attempts to fulfill the following objectives:
 Fuzzy search implementation for approximate matching, improving accuracy and
saving time for users.
 Minimizing costs.
 Better organization of stocks by using quick sort.
 Preventing stock outs.

1.4. Scope and Limitation:


1.4.2. Scope:
These are the scope that this project is attempting to fulfill:
 Efficient Sorting
2
 Enhanced User Experience
 Enhanced searching in vendor and product list.

1.4.3. Limitation:
This project cannot overcome these points with are listed below:
 Absence of sales and purchase section.
 Lack of integration for invoice and report generation.
 No demand prediction for market trends are done.
 Absence of multi-level users.

1.5. Development Methodology:


There are several software development methodologies to choose depending on the
project goals, requirements, size, timeline, team members involved, project
management tools used, etc.

1.5.1. Incremental Model


In the incremental model, software requirements are divided or broken down into
several stand- alone modules or increments in the SDLC. Each development phase
focuses on refining a certain increment in a phased and sequential manner. The
capability of our IMS evolves incrementally as the system progresses, with new
features effortlessly incorporated and existing ones strengthened. This development
method is iterative, which allows for ongoing improvements based on vital user
feedback and testing insights. The model's repetition enables continuous refinement,
ensuring that our IMS is flexible and sensitive to changing business requirements. The
finished product will include a fully functional Inventory Management System that is
suited to specific business requirements. The bespoke Incremental Development Model
for this project enables early completion of essential inventory functionalities, regular
user feedback, and the flexibility to react to the changing landscape of our business
requirements. [3]
The iterations that this software has gone through are as follows:

Increment 1:
Authentication and Verification Module: During this phase, the system validates user
credentials by comparing the provided username and password with those stored in the
database. If the input matches the records, the user gains access to the system.

3
Conversely, the system generates error messages to notify users of incorrect input.

Increment 2:
Product Module: In this increment, we checked for the adding, updating, viewing and
deleting of products. Using quick sort, data is organized in a better manner and using
fuzzy search slightly incomplete or incorrect data can give correct output as the user
required.
Increment 3:
Categorization Module: The product can be list down using a category drop down box
for quicker sorting.
Increment 4:
Vendor Module: A vendor list is also implemented to track the vendor's information
which makes it easier for the user.

Figure 1.1: Incremental Model

4
1.6. Report Organization
Chapter 1: Highlights in brief the project's background, summary, problem statement,
objectives, scope, and limitations. The problem statement focuses on the issue that
motivated the project's development; it is a theoretical and research-based component.
Next, the project's goals, parameters, and constraints are spoken about.

Chapter 2: provides an overview of the current system, including its benefits and
drawbacks, as well as a background study and literature analysis.

Chapter 3: Requirement and feasibility analysis are included in the presentation of the
system analysis. Feasibility analysis describes why and how the project is implemented,
while requirement analysis defines the project's functional and non-functional
requirements.

Chapter 4: Design of the system is explained in detail with all necessary diagrams and
brief functionality.

Chapter 5: Implementation and Testing are presented. The process for the system
is explained, along with the tools and platforms that were used during implementation.

Chapter 6: It consists of Conclusion and future scope of the applications.

5
Chapter 2: Background Study and Literature Review
2.1. Background Study:
The evolution of inventory management technologies has progressed from manual
reporting to integrated Information Systems (IS). Need of inventory management
systems has increased as many companies and organizations demand digital platforms
for maintaining accurate and smooth business operations. As manual methods were
time- consuming and error-prone, integrated IS were brought into practice. Integrated
IS contributed to cost reduction, supplier collaboration, and scalability, ultimately
enhancing service levels and reducing costs for businesses.
Terminologies related to our project:

● Inventory: The total quantity of goods, materials, or products a business holds.

● Stock: Referring to the items or products a business keeps on hand.

● SKU: A unique identifier assigned to each distinct item or product in


inventory for tracking and management purposes.
● Total valuation: The combined monetary value of all items present in
the inventory.

● Total quantity: The total quantity of each product present in the inventory.

● Categorization: The total number of categories present in the inventory


is highlighted.

● Out of Stock: The number of unavailable products is highlighted.

● Vendor Management: The system helps in managing vendors.

● Report Bug: There is a bug reporting functionality.

2.2. Literature Review:


Products are regarded as the most important asset for a business to run in a profitable
manner. The Inventory Management System looks after those assets by managing in a
computerized pattern which makes a business more efficient. There are a number of
Inventory Management Systems that already exist in the market. But after doing some
research on them, we have come to know that most of them are expensive and are
made for large organizations. Every small or large business has a subscription or

6
ownership of their own custom Inventory Management System according to the needs
of their business, but as not all businesses have the same resources.

This research highlighted the scope of inventory management that covers many topics,
such as replenishment scheduling, managing costs of storage and inventory, asset
management, inventory forecasting, inventory valuation, inventory visibility, future
inventory price forecasting, physical inventory, available physical space, quality
management, replenishment, returns and defective goods, and demand forecasting. [4]

In this research report, they highlighted the major requirement for small/medium-sized
businesses of Inventory Management since a lot of money and skilled labor has to be
invested to do so. Demand forecasting is a crucial part of all businesses. They used
Machine Learning models to maintain their inventory based on demand for a particular
item. [5]

This research using a Computerized Maintenance Management System (CMMS)


minimizes costs by helping facilities managers know when to purchase more inventory
based on normal usage rates. With CMMS Inventory Management software, they have
set minimum and maximum inventory stock levels, so that when the minimum quantity
is reached a Purchase Order will automatically be generated and sent to vendors for
replenishment. [6]

This research contains the correct management of inventories has become a


fundamental pillar for achieving success in enterprises. Unfortunately, studies
suggesting the investment and adoption of advanced inventory management and
control systems are not easy to find. In this context, this article aims to analyze and
present an extensive literature concerning inventory management, containing multiple
definitions and fundamental concepts for the retail sector. A systematic literature
review was carried out to determine the main trends and indicators of inventory
management in Small and Medium-sized Enterprises (SMEs). This research covers
five years, between 2015 and 2019, focusing specifically on the retail sector.[7]

Materials management is a critical component of the construction industry. As such,

7
organizations need to understand the effects of proper materials management techniques
on the effectiveness of project execution. A properly implemented materials
management program can achieve the timely flow of materials and equipment to the
jobsite, and thus facilitate improved work face planning, increased labor productivity,
better schedules, and lower project costs. Materials represent a major expense in
construction, so minimizing procurement cost improves opportunities for reducing the
overall project cost. This paper deals with identification of selective inventory control
techniques and developing a framework for assessing the various material management
techniques. In the end, a framework has been developed which can be used for future
research in this area. [9]

Inventories in a factory acts like a buffer to avoid disruption in the production or


assembly lines. In this work a fuzzy interface-based system is developed to take
inventory decisions like inventory level, reorder point, reorder quantity etc. Input
variables were demand, stock quantity-on-hand, lead time and the price of the raw
material. Here output of is the decision on how to replenish the inventory level. These
inputs and output are divided different categories. Several rules are also developed for
each input variables combinations and corresponding output decisions based on the
opinion of experts. [10]

Agricultural Inventory Management System makes agricultural production pattern


accessible to the detail of agricultural parcel and farmer. Moreover, animal and
agricultural mechanization assets and their details are recorded at village and farmer
level. It becomes possible to produce agricultural statistics which leads national
agricultural policies and strategies by using reliable data and support national
commerce policies by annually, semi- annually, quarterly and monthly periods. In
addition, with online upto-date data warehouse and data mining services, on-field
checks of agricultural supports, monitoring agricultural activity seasonally; planning
and timing activities like expropriation and land consolidation that can harm the crops;
detection of production and farmers that are affected by natural disaster are made
possible. System is controlled and managed by Control Center. [11]

8
Chapter 3: System Analysis
3.1. System Analysis
System analysis for an Inventory Management System (IMS) involves understanding
current processes, gathering user requirements, creating models, and conducting a
feasibility study. The purpose is to set objectives, determine system boundaries, and
record specific requirements for the creation of an efficient and effective IMS.

3.1.1. Requirement Analysis


Requirement analysis is the process of gathering, documenting, and analyzing the
needs and objectives of a system or project in order to define the features, functions,
and specifications of the system.
a) Functional Requirement
Functional requirements are specifications that outline the fundamental capabilities and
characteristics that a system or product must have in order to meet its goal. These
requirements define what the system should do and form the basis for design,
development, and testing.
 User Management:
Actors: Administrator,System User
Requirements:
1. The system should allow administrators to create, modify, and delete user
accounts from the database.
2. System users should be able to log in securely with unique credentials(token).
3. System users should be able to edit their profile such as contact, name,
password, bio and image excluding email.

 Product Management
Actors:SystemUser
Requirements:
1. System users should be able to add new products with details such as name,
description, image, quantity and category.
2. System users should support updating products and deleting products.
3. System users should be able to track stock levels from the database.

9
 Inventory Tracking:
Actors: System user
Requirements:
1. The system should track product levels.
2. Users should be able to conduct stock takes and update inventory quantities
manually.

 Reporting bugs:
Actor: System User
Requirements:
1. The system should be able to support reporting bug mechanisms.

 Security:
Actor: System User
Requirement:
1. The system should enforce secure authentication and authorization
mechanisms while signup or login.
2. Every individual will have their own unique token.

3.1.1.1. Use Case Diagram


A use case diagram is a type of behavioral diagram defined by the UML whose aim is to
present a graphical overview of the functionality provided by a system in terms of
actors, their goals (represented as use cases), and any dependencies between those use
case.

10
3.1.1.1.1. Use case for Super Admin

Figure 3.1: Use Case of Super Admin


Actor: Super Admin
Use cases:
1. Login
2. User Management
3. Data Management
4. Bug monitoring

11
3.1.1.1.2. Use case for User

Figure 3.2: Use case of User

Actor: User
Use cases:
1. Register
2. Product
3. Categorization
4. Vendors
5. Stock Listing
6. Report

12
b) Non-Functional Requirement
Following are Non-functional requirements that are not directly concerned with
specific function delivered by the system to its user but they concern with emergence
system properties such as reliability availability, response time security, safety etc.
Non-functional requirements place or put constraints on how the system will do to
achieve the functional requirement and elaborates a performance characteristic of the
system.

● User better user experience.

● There is input validation while implementing an item.

● Security availability for the customer’s details.

● Proper detailing of product

3.1.2. Feasibility Analysis


A feasibility Analysis is a process of assessing the practicality and viability of a
proposed project or initiative. It is conducted to determine whether a project is
technically feasible, financially viable, and sustainable. Here are some of the key
factors to consider in a feasibility study:

3.1.2.1. Technical Study:


The project is technically feasible and complies with current technology, including
both the hardware and the software. The project is an open-source web-based system
using the programming language JavaScript. React.JS is used as front-end which is a
single page application framework of JavaScript. Furthermore, NodeJS and Express.JS
for the management of back-end where the data is stored in MongoDB as a database.

Table 3.1: MERN Package Table

Package Version Compatibility Last Communit


Updated y

React-scripts/UI 5.0.1 React.JS>=17.0 January, 134


2022
JavaScript>= ES6

13
Nodemon/Server 3.1.0 Node.JS>= 6.0.0 February, 248
2024

Express/Server 4.18.1 Node.JS>=0.10.x January, 270


2023
JavaScript>=ES6

Mongoose/Database 6.6.1 Node.JS>=12.x February, 843


JavaScript=>ES2015 2024

3.1.2.2. Operational Study:


A successful project must be versatile and responsive to meet business challenges and
user needs effectively. Our project demonstrates operational feasibility across major
web browsers such as Google Chrome, Microsoft Edge, and Mozilla Firefox.With a
user-friendly interface, our system is easily navigable for inexperienced users,
requiring only basic login knowledge to perform actions. By addressing issues like
manual product tracking and evaluation, our system delivers valuable outcomes,
making it readily embraced by users seeking efficient solutions.

3.1.2.3. Economic Feasibility:


The system is made in the most cost-effective manner by using personal computers and
the services which are free of cost and also the implementation of the database was not
done in huge amounts adding in the memory resources. It is a practically low budget
system.
 Development and purchasing costs
o Hardware (currently our own hardware systems)
Software
o Operating System (Already installed and no need to change)
(Main software needed to build the system is open source)

14
 Installation and data entry costs
o Server Hosting
o Training the staff
o Enter the precious data into the system
 Operational Costs
o Maintenance cost
o Upgrading the software

For practical purposes, the cost for our project implementation is shown as:
Table 3.2: Economic Feasibility Table

Programmers 40000

Subscription 1000

Web Designer 15000

Power Backup 25000

Server Hosting 30000

Internet Setup 18000

Computer System 150000

Total 2,79,000

As per the cost analyzed from above table, we can obtain benefits by
addingsubscription, premium subscription, advertisement and affiliate marketing.

3.1.2.4. Schedule:
Schedule feasibility shows whether our project can be completed within the specified
time frame or not. The schedule of our project is shown from the Gantt chart.

15
Figure 3.3: Gantt Chart

16
3.1.3. Analysis

3.1.3.1. State Diagram


A state diagram is a visual representation of an object or system's states and transitions
between them. It gives an abstract description of the behavior of the system. The
diagram consists of states, transitions and events.

Figure 3.4: State Diagram of Inventory Management System

17
3.1.3.2. Class and Object diagram

Class Diagram:
A class diagram is a type of UML diagram that represents the classes, their properties,
methods, and the relationships between them to describe the static structure of a
system. It is a key tool in object- oriented modeling and design.

Figure 3.5: Class diagram of Inventory Management System

18
Object Diagram:
An object diagram is also a type of UML that provides a view of an object and their
relationships within a system at a particular point in time. It is used to illustrate the
real- world instances of classes and their interactions.

Figure 3.6: Object diagram of Inventory Management System

19
3.1.3.3. Sequence Diagram
A sequence diagram is a type of interaction diagram which describes how and in what
order a group of objects work together. These diagrams are used by software
developers and experts to understand the requirements of a new system or document an
existing process.

Figure 3.7: Sequence diagram of Inventory Management System

20
3.1.3.4. Activity Diagram
Activity diagrams show the flow from one activity to another within a system or
process. Even complex systems can be visualized using activity diagrams. It is used in
organizations to model the customer journey, represent the process from receiving an
order to delivering it to the customer, and model the sales process.

Figure 3.8: Activity Diagram for Inventory Management System

21
Chapter 4: System Design
4.1. Architectural Design:
4.1.1. System Architecture:
Our system follows a 3-Tier architecture model, which divides the functional process
logic, data access, data storage, and user interface into separate modules on distinct
platforms.
 The Presentation tier is the user-visible part of the application, facilitating input
of requirements and presentation of results. It is platform-dependent, varying
across devices or platforms such as web applications.
 The Application tier, also known as middleware, serves as the middle layer
responsible for handling calculations and operations between input-output
requirements and data. It functions as an application server.
 The Data tier, positioned at the lowest layer of the model, manages all data-
related operations, including database management system functionalities and
fundamental database operations for storing, selecting, aggregating, processing,
ensuring integrity, and auditing data. [12]

Figure 4.1: 3-tier Architecture

22
4.1.2. Application Architecture:
The Application Architecture of our system employs the Model-View-Controller
(MVC) design pattern, which divides the application into three main components:
Model, View, and Controller.
 The Model interacts with the database, handling data logic such as retrieval,
creation, authentication, and validation.
 The View manages the user interface of the application.
 The Controller handles user requests and dictates the application's actions
accordingly.
In the MVC architecture, when a client requests a page from the server, the server
forwards all request information to the Controller. The Controller then communicates
with the Model to retrieve appropriate data from the database. Subsequently, the View
combines this data with the layout and generates a user interface, which is then sent
back to the Controller. Notably, the Model and View do not interact directly; instead,
the Controller serves as a mediator between them. Finally, the Controller responds to
the client with the rendered page. [12]

Figure 4.2: MVC Architecture

23
4.1.3. Refinement of Class and object diagram
4.1.3.1. Refinement of class diagram:

Figure 4.3: Refinement of class diagram

24
4.1.3.2. Refinement of object diagram:

Figure 4.4: Refinement of object diagram

4.1.4. Component Diagram


A component diagram is a type of diagram that depicts the components of a system,
their interactions, dependencies, and relationships. It is part of the UML and is
commonly used during the design phase of software development to provide a clear
and concise way to visualize the structure of a software system, aiding in
understanding, communication, and maintenance of the system. They are particularly
useful for visualizing the high-level architecture of a system.

25
Figure 4.5: Component Diagram of Inventory Management System

4.1.5. Deployment Diagram


A deployment diagram is a type of diagram in UML that illustrates the physical
deployment of software components (artifacts) on hardware nodes (devices). Both
nodes and artifacts of the system take part in the final execution of the system.
Deployment diagrams are closely related to the component diagrams. Component
diagrams are used to describe the components of the system, and deployment diagrams
show how these components are deployed to the hardware.

26
Figure 4.6: Deployment Diagram of Inventory Management System

4.2. Algorithm Details:


4.2.1. Quick Sort:
Quick sort is the widely used sorting algorithm that makes n log n comparisons in the
average case for sorting an array of n elements. It is a faster and highly efficient sorting
algorithm. This algorithm follows the divide and conquer approach.
 Divide: In Divide, first pick a pivot element. After that, partition or rearrange
the array into two sub-arrays such that each element in the left sub-array is less
than or equal to the pivot element and each element in the right sub-array is
larger than the pivot element.
 Conquer: Recursively, sort two subarrays with Quicksort.
 Combine: Combine the already sorted array.

Time Complexity:
❖ Best Case: Ω (N log (N))
Efficient sorting when pivot divides array into equal halves.
❖ Average Case: θ (N log (N))
Typically very fast, making it one of the fastest sorting algorithms.

27
❖ Worst Case: O(N2)
Occurs with consistently unbalanced partitions, especially with already sorted arrays.
❖ Auxiliary Space: O(1)
Except for recursive stack space, which could be O(N) in worst-case scenarios.

Algorithm:
1. QUICKSORT (array A, start, end)
2. {
3. 1 if (start < end)
4. {
5. p = partition(A, start, end)
6. QUICKSORT (A, start, p - 1)
7. QUICKSORT (A, p + 1, end)
8. }
9. } [13]

4.2.2. Fuzzy Search:


A fuzzy search is a technique that uses search algorithms to find strings that match
patterns approximately. It is performed using a fuzzy matching algorithm, which
returns a list of results based on likely relevance even though search argument words
and spellings may not be an exact match. A fuzzy matching algorithm can compensate
for common input typing errors for product lookups which have exact and highly
relevant matches that appear near the top of the list. A fuzzy matching algorithm can
operate like a spell checker and spelling-error corrector. For example, if a user types
"Reddragon" into a search bar, both of which use fuzzy matching, a list of hits is
returned, "Redragon?". Alternative spellings and words that sound the same but are
spelled differently are given.

Algorithm:
1. Receive two strings or sequences of characters to compare.
2. Normalize the strings (e.g., convert to lowercase, remove punctuation).
3. Break the strings into smaller units (e.g., characters, words).
4. Calculate similarity scores between corresponding tokens using a chosen
method (e.g., Levenshtein distance, Jaccard similarity).

28
5. Combine individual scores to get an overall similarity score for the entire
strings.
6. Set a threshold above which the strings are considered a match.
7. Compare the overall similarity score with the threshold to determine if the
strings match.
8. Return the result of the fuzzy matching algorithm (match or no match).
9. Fine-tune parameters (e.g., threshold, scoring method) based on
specific requirements or application needs.

Levenshtein Distance Algorithm:


 Initialization: Create a matrix M with dimensions (m+1) x (n+1), where m and
n are the lengths of the two strings s1 and s2.
 Base Case: Set the first row of M to be [0, 1, 2, ..., n] and the first column to be
[0, 1, 2, ..., m].
 Compute Distances: Iterate over each cell of M, excluding the first row and
column. For each cell M[i][j]: If s1[i-1] equals s2[j-1], set M[i][j] to the value
of M[i-1][j- 1]. Otherwise, set M[i][j] to the minimum of the values:
o M[i-1][j] + 1 (deletion)
o M[i][j-1] + 1 (insertion)
o M[i-1][j-1] + 1 (substitution)
 Return Distance: The Levenshtein Distance between s1 and s2 is the value in
the bottom-right cell of the matrix, i.e., M[m][n].

Damerau-Levenshtein Distance Algorithm:


 Initialization: Create a matrix M with dimensions (m+1) x (n+1), where m and
n are the lengths of the two strings s1 and s2.
 Base Case: Set the first row of M to be [0, 1, 2, ..., n] and the first column to be
[0, 1, 2, ..., m].
 Compute Distances: Iterate over each cell of M, excluding the first row and
column. For each cell M[i][j]: If s1[i-1] equals s2[j-1], set M[i][j] to the value
of M[i-1][j- 1]. Otherwise, set M[i][j] to the minimum of the values:
o M[i-1][j] + 1 (deletion)
o M[i][j-1] + 1 (insertion)

29
o M[i-1][j-1] + 1 (substitution)
Additionally, if i > 1, j > 1, and s1[i-1] equals s2[j-2] and s1[i-2] equals s2[j-1],
consider the possibility of transposition: Set M[i][j] to the minimum of its
current value and M[i-2][j-2] + 1.
 Return Distance: The Damerau-Levenshtein Distance between s1 and s2 is the
value in the bottom-right cell of the matrix, i.e., M[m][n]. These step-by-step
algorithms outline the process of calculating Levenshtein and Damerau-
Levenshtein distances between two strings. They provide a clear understanding
of the operations involved in each approach.

4.2.3. JWT
JWT stands for JSON Web Token. It is a compact and self-contained way of
transmitting information between two parties in the form of a JSON object. JWTs are
commonly used for authentication and authorization purposes in web applications.
Here's a breakdown of its components:
 Header
 Payload
 Signature
JWTs are often used in authentication flows, where a user logs in and receives a JWT
token, which is then sent with subsequent requests to access protected resources. The
server can validate the token to authenticate the user and authorize access to the
requested resources based on the claims within the token. [14]

30
Chapter 5: Implementation and Testing
5.1. Implementation:
5.1.1. Tools Used:
The following technologies and tools were used for the development of the system:
 Draw.io
 Gantt Pro

5.1.1.1. React:
React.js forms an integral component of the MERN stack, offering a robust front-end
framework suitable for crafting user-friendly interfaces within an inventory
management system. React's virtual DOM efficiently manages UI updates, ensuring
optimal performance even with dynamic data interactions typical in inventory systems.
It provided access to various libraries and tools for tasks such as state management
(e.g., Redux), routing (e.g., React Router), and UI design (e.g., Material-UI), which
helped us in creating visually appealing and feature-rich inventory interfaces. React's
declarative approach simplifies UI synchronization with data stored in MongoDB,
enabling seamless integration with the back-end API powered by Node.js and
Express.js. [15]

5.1.1.2. MongoDb:
MongoDB functions as the backend database in a MERN stack for an inventory
management system, provides a flexible and scalable way to store and handle inventory
data. The system effectively manages large volumes of data and adjust to changing
inventory item properties due to MongoDB's document-oriented structure. Express.js
makes it easier to create RESTful APIs that communicate with MongoDB, allowing
front- end and back-end applications to work together seamlessly. On the client side,
React.js offers an intuitive and dynamic inventory management interface with real-time
updates and responsive interactions. The backend server is powered by Node.js, which
enables quick and asynchronous request processing. The MERN stack, which uses
MongoDB to ensure flexibility, scalability, performance, and ease of development that
creates a reliable and contemporary inventory system.[16]

31
5.1.1.3. Node.JS:
A key component of the MERN stack used to create an inventory management system is
Node.js. The backend runtime environment in this design is Node.js, which allows the
frontend React.js application and the MongoDB database to communicate with each other
without any problems. As Node.js is good at managing asynchronous activities it helps in
real-time updates and interactions, like order processing and notifications. Node.js's event-
driven, non-blocking I/O approach guarantees effective use of system resources, producing
high-performance backend operations that are essential for managing several concurrent user
requests and massive volumes of inventory data. Additionally, Node.js has a vibrant
ecosystem of packages and modules through npm (Node Package Manager), which makes it
simple to integrate different libraries for tasks like data validation, authentication, and
authorization. Overall, Node.js improves a MERN-based inventory management system's
scalability, reactivity, and flexibility, makes it an appealing option for companies looking to
develop reliable and effective inventory solutions. [17]

5.1.1.4 Express.JS:
Express.js is an essential component of a MERN stack for an inventory management
system since it serves as the backend framework. Express.js provides a lightweight,
flexible, and efficient web application framework for building the server-side logic
and APIs required to manage inventory data. We can quickly and simply establish
RESTful APIs to carry out CRUD operations on inventory items stored in MongoDB
by utilizing Express.js. Express.js streamlines request handling, middleware
integration, and routing, making it easier to design and maintain backend
components. [16]

5.1.2. Implementation of modules:


The Inventory Management System comprises several distinct modules, including the
user module, admin module, and login module. Within the user module, individuals
have the ability to register and log in to the system. They can submit product requests
and subsequently log out. Similarly, administrators possess the capability to log in,
review and improve on report bug initiated by users, and then log out. The login
module specifically permits access for registered users to log in to the system.

User Module:
Within the user module of the inventory management system, an account creation
process is initiated through a registration form. This form requires users to input
32
their name, email address, phone number, password, and a user image. It's essential
for users to fill all input fields accurately to avoid encountering error messages. Upon
completion of the registration form with correct details, user data is stored in the
MongoDB directory. Subsequently, users can log in to the system once their account
has been successfully created.

Admin Module:
Authentication within the Admin Module relies on email and password credentials
stored in MongoDB. Upon entering the correct email and password, the admin gains
access to their dashboard. Within this dashboard, the admin can perform various tasks,
including adding products to the system and reviewing. Additionally, the admin can
log out of the system by selecting the logout button.

Login Module:
In the Login Module, users gain access to the system upon successful creation of an
account. This module comprises two essential fields: an email field and a password
field. User authentication occurs through MongoDB, where the entered email and
password must match the stored credentials for login to be successful. Users
exclusively utilize their email and password for login. It is imperative that users input
the correct email and password combination for system access. In case of incorrect
input, an error message is generated, prompting users to enter the correct credentials
for login.

5.2. Testing:
Test Environment
Table 5.1: Test Environment Table

Operating System Windows 11


Browser Google Chrome, Microsoft Edge,
Opera GX
Database MongoDB (Atlas)
Application Server Node.JS/Express.JS
CPU Intel(R) i7

33
5.2.1. Test Cases for Unit Testing:
Test creating a new user account:
Test case: Create a new account
Test objective: To register into the system
Test description: To create new user to perform task
Requirements verified: New user
Test setup:
Table 5.2: Test Environment for Creating New Account Table

Action Expected Result

Create new account by entering new email, Account created


password and username

Create new account by user with old email Generates an error message
but
new password and username

Test updating user account details:


Test case: Updating an old account
Test objective: To update account in the system
Test description: To update old account as per the users need.
Requirements verified: Valid user
Test setup:
Table 5.3: Test Environment for Updating Account Table

Action Expected Result

Update password, username, phone, bio and Account updated


photo

Update email Cannot be updated

34
Authentication and verification:
Test case: Validation of the username and password
Test objective: To check the name of the user
Test description: To check whether the username and password of the user is valid or
not
Requirements verified: Valid user

Test setup:
Table 5.4: Authentication and Verification of User Table
Action Expected Result

Correct email and password entered User will be logged in

Wrong email or password Generates an error message

Test adding a new item to the inventory:


Test case: Add new item into the inventory
Test objective: Add new item
Test description: To add brand new item
Requirements verified: Valid user/ New item
Test setup:
Table 5.5: Test to add new items Table

Action Expected Result

Create item with name, category, quantity, Item created


price and photo

Wrong data type entered in respective fields Generates an error message

Test updating an existing item's details:


Test case: Edit item in the
inventory Test objective: Edit item
Test description: To edit item
Requirements verified: Valid user/ old
item

35
Test setup:
Table 5.6: Test to updating items Table
Action Expected Result

Edit item with name, category, quantity, Item edited.


price
and photo
Wrong data type entered in respective fields Generates an error message

Test deleting an item from the


inventory: Test case: Delete item from
the inventory Test objective: Delete item
Test description: To delete item
Requirements verified: Valid user/
item Test setup:
Table 5.7: Test to deleting items Table

Action Expected Result

Delete item Item deleted.

5.2.2. Test Cases for System Testing:


Test searching for items:
Test case: Searching item in the
inventory Test objective: searching item
Test description: To search item
Requirements verified: Valid user/
item Test setup:
Table 5.8: Test to search item Table
Action Expected Result
Search item present in system Item shown
Wrong data entered in search bar Blank list is shown

Test UI responsiveness and performance:


Test case: UI responsiveness test
Test objective: check UI responsiveness and performance of software

36
Test description: To check the Page Load Time, Data Rendering Time, User Interaction
Responsiveness, Scrolling Performance and Sorting Performance
Requirements verified: System

Test setup:
Table 5.9: UI testing Table

Action Expected Result

The system is page is loaded The page is loaded in acceptable


timeframe

The data is rendered from database to the The data is loaded as soon as the
system page is loaded

Buttons, links, and input fields is checked Buttons, links and input field works
as their designated workflow

Product list and vendor list is sorted The list is presented alphabetically

Test data integrity by verifying that data is stored, retrieved, and updated
correctly in the database:
Test case: Integrity test of data
Test objective: Verify the data entered by user
Test description: To check whether the data is same as the user entered or not
Requirements verified: Valid user/ data
Test setup:
Table 5.10: Integrity test of data Table

Action Expected Result

Product is created in the system Product is created in both the


database
and product list
Integrity of product data is checked The product data is same as the user
entered in both the system and the
database

37
Test authentication and authorization mechanisms to ensure that only authorized
users can access the system:
Test case: Authentication of user
Test objective: authentication mechanism for user
Test description: To check credentials of user for authentication
Requirements verified: Valid user
Test setup:

Table 5.11: Authentication test of user Table

Action Expected Result


Correct email and password entered Login successful.
The unique token is compared by the system Token match, Login successful.
from database
Wrong email or password is entered Invalid email or password
Email and password entered whose account User not found, please sign up
is not register

Test error handling mechanisms to ensure that appropriate error messages are
displayed to users:
Test case: Test for error handling
Test objective: Error messages for inappropriate details
Test description: To check the error messages for in appropriate details
Requirements verified: Valid user
Test setup:
Table 5.12: Error handling test Table

Action Expected Result


Wrong email or password entered Invalid email or password

The unique token is compared by the system Token match, Login successful.
rom database

Wrong email or password is entered Credentials not matched

38
Test report bug functionality to send mail for feedback:
Test case: Test for report bug
Test objective: Report bug functionality test
Test description: To check the report bug functionality for user to send mail
Requirements verified: Valid user

Test setup:

Table 5.13: Report bug testing Table

Action Expected Result

Feedback is given by the fields of subject The feedback is sent by gmail to the
and super admin.
message is entered by user

5.3. Result Analysis:


Result analysis is a crucial phase in software development, occurring post-testing. It
involves thoroughly reviewing and evaluating test outcomes to pinpoint any
identified issues, defects, or bugs.
All components within the system are functioning as anticipated, delivering
outcomes that meet expectations. The quick sort algorithm is integrated into the
project, aiding in product listing to users based on their name and category.
Considerable emphasis is placed on crafting a user-friendly interface to ensure
seamless navigation for users. They can effortlessly manage listed items in their
product list, as well as edit their profile information via the profile section. The
dashboard offers various options, including item search, stock filtering, and
browsing product categories.
Upon selecting a product, users are provided with detailed descriptions, the option
to add items to their product list, and logout functionality.

39
Chapter 6: Conclusion and Future
Recommendation
6.1. Conclusion:
In conclusion, this system solves the issues of static sorting criteria, a lack of search
fields and handles duplicate entries of users. By implementing dynamic sorting
algorithms and expanding search capabilities, organizations enhance stock decisions
and improve overall inventory management efficiency. Furthermore, implementing
methods to remove redundant data will make operations faster, resulting in improved
organization of stock management. Overall, investing in modern inventory
management solutions that address these issues paves the way for improved
efficiency, cost savings, and competitive advantage in today's dynamic market
landscape. This project is successfully implemented with all the features mentioned
in the system requirements specifications that provide appropriate information to
users according to the chosen service.

6.2. Future Recommendations:


As our system has significant room to grow, we can add many functionalities in our
system such as invoice generation, report of sales, payment gateway, reduction in
dead stock and reduction of redundancy. A sales and purchase section will also be
added in the inventory management system which will further help a user for more
clarification. It will dynamically analyze historical data and market trends to predict
demand, thereby minimizing dead stock and optimizing stock organization. The
system will enable real- time adjustments based on evolving customer preferences
and market conditions. Moreover, transitioning towards a flexible system also
capable of handling unstructured data will future-proof the system against evolving
data sources and formats, which will promote adaptability and scalability. By
embracing these recommendations, organizations can revolutionize their inventory
management processes, optimizing resource utilization, and driving sustainable
growth in the dynamic market landscape.

40
References

[1] "freeProjectz," [Online]. Available: https://www.freeprojectz.com/project-


report/6777?
fbclid=IwAR2cMitZFhzLHwBOgYlnmpjzCem_VDunCSJSFSVg_1is-
nok0d6x_ifyG4A.

[2] P.Brans,"fuzzysearch,"[Online].Available:https://www.techtarget.com/whatis/
definiti on/fuzzy-search?
fbclid=IwAR1jxCydDTSJZayrTbvaiMsAT30eW7z7lYKgz-
5GH_2VdH7cvojwRw_dyq8#:~:text=A%20fuzzy%20search%20is
%20performed,the%20top%20of%20the%20list.
[3] "Plutora," [Online]. Available: https://www.plutora.com/blog/incremental-
model- what-and-how-to-implement-it.

[4] O. A.T. a. F. T. I. Md. Kausar Alam, "Inventory management systems of small


andmediumenterprisesinBangladesh,"2023.[Online].Available:https://
www.emerald.com/insight/content/doi/10.1108/RAMJ-09-2022-0145/full/html?
fbclid=IwAR0LORExnC 5G2Lz8LxGMIe6A9fFIA-
zqzzu6Y4kXGVZD1rq_EsSNP1tJmNY#ref040.

[5] P. K. B, "Inventory Management using Machine Learning," 2020. [Online].


Available:https://www.researchgate.net/publication/342488790_Inventory_Mana
gement_using_Machine_Learning?
fbclid=IwAR0qeU0LBubl1gKv3gWh93bnw3VfvHkju
hVtJx9ieo7ozPy7Rar68sNr0eU.
[6] J. Roscher, "Real World Examples of Inventory Management," 2022. [Online].
Available:https://www.reliabilityconnect.com/real-world-examples-of-inventory-
management/?
fbclid=IwAR209kkgpd4Enw_D0n9zMTgUOS8wB4fC635FvGiZ9
5bkfJHfNsyRGeV2b4.

[7] C.V.M.Macas,J.A.E.Aguirre,R.Arcentales-CarriónandM.Peña,"Inventory
managementforretailcompanies: A literature review and current trends," 2021.
[Online].Available: https://ieeexplore.ieee.org/document/9447350/authors#authors.

41
[9] D. J. P. P. J. Harsh Soni, "ANALYZING INVENTORY MATERIAL," 2016.

[Online].Available:https://ijariie.com/AdminUploadPdf/
ANALYZING_INVENTORY_MATERIALMANAGEMENT_CONTROLTEC
HNIQUE_ON_RESIDENTIALCONSTRUCTION_PROJECT_ijariie2221.pdf?
fbclid=IwAR2_0ccHDL1ue_yH6k
ac5mKXxlW293ZFWiYZH9ykkyGOghJPL6_Mgfehe8.

[10] M. S. J. H. Nafis Ahmad, "FUZZY BASED INVENTORY MANAGEMENT

SYSTEM,"2012.[Online].Available:https://www.researchgate.net/publication/
280311103_FUZZY_BASED_INVENTORY_MANAGEMENT_SYSTEM?
fbclid=IwAR3vu66xWJLpcJ5OK6bdBG1-KBv_6pBzf YLy56Rh7 1qnqovm9X
3w9q i3c.
[11] H. Erden, "Agricultural Inventory Management System," 2015. [Online].
Available: https://ieeexplore.ieee.org/document/7248152/authors#authors.

[12] P.C.S.K.S.C. Aarohan Nakarmi, "College Information Management System,"


2021.

[13] "QuickSort – Data Structure and Algorithm Tutorials," [Online]. Available:


https://www.geeksforgeeks.org/quick-sort/?fbclid=IwAR3ejm81x-vpsEllDF6E5
vKw YYDjt3GMgnFQLDbNFaZRvfUAVazOhBoilZ8.

[14] "JSON Web Token (JWT)," 2024. [Online]. Available:


https://www.ibm.com/docs/en/cics-ts/6.1?topic=cics-json-web-token-jwt.
[15] "LearnReactJS Tutorial,"[Online]. Available: https://www.javatpoint.com/reactjs-
tutorial?fbclid=IwAR0L3BYMcIGeHXk_PxDlB8eiCRe_tq6VUHFnf0nQisQ8ezCX
Cybc zwKvR8U.

[16] simplilearn, "MongoDB Tutorial for Beginners," [Online]. Available:


https://www.simplilearn.com/tutorials/mongodbtutorial?
fbclid=IwAR1pUvD6BdFX
VSNVUWKG5mSatzlb1CHlVYY_veyoli0_xmZo7liUjAwBhl8.
[17] T. Sufiyan, "What is Node.js: A Comprehensive Guide," [Online].
Available: https://www.simplilearn.com/tutorials/nodejs-tutorial/what-is-
nodejs.

[18] "Scribd,"2009.[Online].Available:https://www.scribd.com/doc/22286019/

42
project-report-on-sales-andinventorymanagementSystem?
fbclid=IwAR3PRH1Dz9YzTa7 a-
GADjj5eoyCTNhZgnKqEWHH5m09zqagF16TD_BAO8R4.

[19] K. Wong, "Sales and Inventory System Documentation Chapter 2," 2019.
[Online]. Available: https://itsourcecode.com/fyp/computerized-sales-and-
inventory-system-thesischapter2/?fbclid=IwAR2oyB2C aWCYa4Eg91e22 VFBh
ogq5_C2k9MaexRuoh cO199UAFnJz0GBLtE#google_vignette.

[20] C. Deshpande, "The Best Guide to Know What Is React," [Online].


Available: https://www.simplilearn.com/tutorials/reactjs-tutorial/what-is- reactjs?
fbclid=IwAR0La7HWnWaPrpZv4DZFKrnCuUE1dgk_DoXMmX4QhK1Tl_
u8J2yWy7P2qgU.

[21] "Express.jsTutorial,"[Online].Available:https://www.geeksforgeeks.org/
express-js/?
fbclid=IwAR24Xe0Jw2lzVJsamSmBxTrUGkwOKkZW6JsGGY3wkpZ8Y XX49
TsRl e_uRUk.

43
Appendix

44
45
46
47
48
Quick Sort:

const quickSort
= (arr) =>
{ if
(arr.length
<= 1)
{ return arr;
}

const pivot =
arr[arr.length - 1].name;
const left = []; const
right = [];

for (let i = 0; i <


arr.length - 1; i++) { if
(arr[i].name <
pivot) { left.push(arr[i]);
} else {
right.push( a

49
rr[i]);
}

return [...quickSort(left), arr[arr.length - 1], ...quickSort(right)];

};

Fuzzy Search:

const fuseOptions = { keys: ['name', 'product'], includeScore: true, threshold: 0.3,

};

const fuse = new Fuse(sortedVendorList, fuseOptions); useEffect(() => {

if (searchTerm.trim() === '') { setSortedVendorList(quickSort(vendorList));

} else {

const result = fuse.search(searchTerm);

const searchResults = result.map((res) => res.item);


setSortedVendorList(searchResults);

}, [searchTerm, vendorList]);

Add product:

import React, { useState } from "react";

import { useDispatch, useSelector } from "react-redux"; import { useNavigate }


from "react-router-dom"; import Loader from "../../components/loader/Loader";

import ProductForm from "../../components/product/productForm/ProductForm";


import {

50
createProduct, selectIsLoading,

} from "../../redux/features/product/productSlice";
const initialState = {

name: "",

category: "",

quantity: "",

price: "",

};

const AddProduct = () => { const dispatch = useDispatch(); const navigate =


useNavigate();

const [product, setProduct] = useState(initialState); const [productImage,


setProductImage] = useState("");

const [imagePreview, setImagePreview] = useState(null); const [description,


setDescription] = useState("");
const isLoading = useSelector(selectIsLoading);

const { name, category, price, quantity } = product; const handleInputChange = (e) =>
{

const { name, value } = e.target; setProduct({ ...product, [name]: value });

};

const handleImageChange = (e) => { setProductImage(e.target.files[0]);


setImagePreview(URL.createObjectURL(e.target.files[0]));

};

const generateKSKU = (category) => {

const letter = category.slice(0, 3).toUpperCase(); const number = Date.now()

51
const sku = letter + "-" + number; return sku;

};

const saveProduct = async (e) => { e.preventDefault();

const formData = new FormData(); formData.append("name", name);


formData.append("sku", generateKSKU(category)); formData.append("category",
category); formData.append("quantity", Number(quantity));
formData.append("price", price); formData.append("description", description);
formData.append("image", productImage);

console.log(...formData);

await

dispatch(createProduct(formdata));

navigate("/dashboard");

};

return (

<div>

{isLoading && <Loader />}

<h3 className="--mt">Add New Product</h3>

<ProductForm product={product}

productImage={productImage} imagePreview={imagePreview}
description={description}

setDescription={setDescription} handleInputChange={handleInputChange}
handleImageChange={handleImageChange} saveProduct={saveProduct}

/>

</div>
);

};
export default

AddProduct;
52
Login:

import React, { useState } from "react"; import styles from "./auth.module.scss";


import { BiLogIn } from "react-icons/bi";

import Card from "../../components/card/Card";

import { Link, useNavigate } from "react-router-dom"; import { useDispatch }


from "react-redux";

import { toast } from "react-toastify";

import { loginUser, validateEmail } from "../../services/authService";

import { SET_LOGIN, SET_NAME } from "../../redux/features/auth/authSlice";


import Loader from "../../components/loader/Loader";

const initialState = { email: "",

password: "",

};

const Login = () => {

const dispatch = useDispatch(); const navigate = useNavigate();

const [isLoading, setIsLoading] = useState(false); const [formData, setformData] =


useState(initialState);

const { email, password } = formData;

const handleInputChange = (e) => { const { name, value } = e.target;

setformData({ ...formData, [name]: value });

};

const login = async (e) => {

e.preventDefault(); if (!email || !password) {

return toast.error("All fields are required");

if (!validateEmail(email)) {

53
return toast.error("Please enter a valid email");

const userData = {

email, password,

};

setIsLoading(true); try {

const data = await loginUser(userData); console.log(data);

await dispatch(SET_LOGIN(true)); await dispatch(SET_NAME(data.name));


navigate("/dashboard"); setIsLoading(false);

} catch (error) {

setIsLoading(false);

};

return (

<div className={`container ${styles.auth}`}>

{isLoading && <Loader />}

<Card>

<div className={styles.form}>

<div className="--flex-center">

<BiLogIn size={35} color="#999" />

</div>

<h2>Login</h2>
<form onSubmit={login}>

<input type="email"

placeholder="Email" required name="email" value={email}

54
onChange={handleInputChange}

/>

<input type="password"

placeholder="Password" required name="password" value={password}

onChange={handleInputChange}

/>

<button type="submit" className="--btn --btn-primary --btn-block"> Login

</button>

</form>

<Link to="/forgot">Forgot Password</Link>

<span className={styles.register}>

<Link to="/">Home</Link>

<p> &nbsp; Don't have an account? &nbsp;</p>

<Link to="/register">Register</Link>

</span>

</div>

</Card>

</div>

);

};
export default
Login;

Register:
import React, { useState } from "react"; import styles from "./auth.module.scss";

import { TiUserAddOutline } from "react-icons/ti";


import Card from "../../components/card/Card";
import { toast } from "react-toastify";

55
import { registerUser, validateEmail } from "../../services/authService";
import { useDispatch } from "react-redux";
import { Link, useNavigate } from "react-router-dom";
import { SET_LOGIN, SET_NAME } from "../../redux/features/auth/authSlice";
import Loader from "../../components/loader/Loader";
const initialState = { name: "",
email: "",
password: "",

password2: "",

};

const Register = () => {

const dispatch = useDispatch();

const navigate = useNavigate();

const [isLoading, setIsLoading] = useState(false);


const [formData, setformData] = useState(initialState);

const { name, email, password, password2 } = formData;

const handleInputChange = (e) => { const { name, value } = e.target;

setformData({ ...formData, [name]: value });

};
const register = async (e) => {

e.preventDefault(); if (!name || !email || !

password) {

return toast.error("All fields are required");

if (password.length < 6) {

56
return toast.error("Passwords must be up to 6 characters");

if (!validateEmail(email)) {

return toast.error("Please enter a valid email");

if (password !== password2) {

return toast.error("Passwords do not match");

const userData = { name, email,

password,

};

setIsLoading(true); try {

const data = await registerUser(userData);

// console.log(data);

await dispatch(SET_LOGIN(true)); await dispatch(SET_NAME(data.name));


navigate("/dashboard"); setIsLoading(false);

} catch (error) { setIsLoading(false);

};

return (

<div className={`container ${styles.auth}`}>

{isLoading && <Loader />}

<Card>

<div className={styles.form}>

<div className="--flex-center">

57
<TiUserAddOutline size={35} color="#999" />

</div>

<h2>Register</h2>

<form onSubmit={register}>

<input type="text"

placeholder="Name" required name="name" value={name}

onChange={handleInputChange}

/>

<input type="email"

placeholder="Email" required name="email" value={email}

onChange={handleInputChange}

/>

<input type="password"

placeholder="Password" required name="password" value={password}

onChange={handleInputChange}

/>

<input type="password"

placeholder="Confirm Password"

required name="password2"

value={password2} onChange={handleInputChange}

/>

<button type="submit" className="--btn --btn-primary --btn-block"> Register

</button>

</form>

58
<span className={styles.register}>

<Link to="/">Home</Link>

<p> &nbsp; Already have an account? &nbsp;</p>

<Link to="/login">Login</Link>

</span>

</div>

</Card>

</div>

);

};

export default Register;

59

You might also like