You are on page 1of 39

Tribhuvan University

Bachelor in computer science and information technology

A PROJECT REPORT ON
KISAN: An E commerce platform to buy/sell fruits and vegetables
In partial fulfillment of the requirements for the Bachelor’s Degree in
Computer Science and Information Technology
Under the Supervision of:
Suvash Khadka
Department of Computer Science and Information Technology
Vedas College
Jawalakhel, Lalitpur
Submitted by:

Gitindra Chapagain (23694\076)

Hritik Subedi (23697\076)

Sudhir Lohani (23725\076)


Submitted to:
Tribhuvan University
Institute of Science and Technology

VEDAS COLLEGE
Affiliated to Tribhuvan University
Supervisor’s Recommendation

I hereby recommend that this project prepared under my supervision by GITINDRA CHAPAGAIN ,
HRITIK SUBEDI and SUDHIR LOHANI entitled “Kisan” in partial fulfillment of the requirements degree
of Bachelor’s in Computer Science and Information Technology (BSc. CSIT) be processed for evaluation.

Mr. Suvash Khadka

SUPERVISOR

Lecturer

Department of Computer Science and Information Technology


Vedas College,
Jawlakhel ,Lalitpur

i
VEDAS COLLEGE
Affiliated to Tribhuvan University

LETTER OF APPROVAL

This is to certify that this project prepared by Gitindra Chapagain [23694/076], Hritik Subedi [ 23697/076],
Sudhir Lohani [23725/076] entitled “Kisan An ecommerce platform to buy and sell fruits and vegetables”
in partial fulfillment of the requirements for the degree of BSc. CSIT has been well studied. In our opinion,
it is satisfactory in the scope and quality of the required degree.

Director Supervisor
Mr.Prashant Thakur Mr. Suvash Khadka
Vedas College Vedas College

Internal Examiner External Examiner


Vedas College IOST, Tribhuvan University

ii
Abstract

KISAN is an application that connects farmers and consumers, enabling direct sales of locally sourced fresh
produce. By facilitating this connection, KISAN ensures fair trade for both parties. The application offers a
wide variety of sustainably grown vegetables, fruits, cereals, nuts, dairy, and meat, providing customers with
high quality products. Users can easily browse categories or search for specific items, supported by detailed
farmer profiles showcasing the food sources. With online shopping and doorstep delivery, KISAN
streamlines grocery shopping, supports local farmers, and promotes healthier eating habits. This direct
farmer to customer model boosts farmers' income and offers consumers fresh produce at competitive prices.
Additionally, KISAN reduces food waste by optimizing processes and transportation. With a user friendly
interface and a focus on sustainability, KISAN provides a new way to access fresh, locally sourced groceries.

iii
ACKNOWLEDGEMENT

We express our sincere thanks to Supervisor Mr. Suvash Khadka for his valuable guidance and support in
completing this project. We are also grateful to our college and professors for providing us with the
opportunity to work on "KISAN." Their support and suggestions were instrumental in completing this
project, and we are truly thankful for their assistance. We affirm that this project was entirely our own work
and not copied.

Feb 10, 2024

Gitindra Chapagain

Hritik Subedi

Sudhir Lohani

iv
Table Of Content
Supervisor’s Recommendation ........................................................................................................................... i
LETTER OF APPROVAL .................................................................................................................................ii
Abstract .............................................................................................................................................................iii
ACKNOWLEDGEMENT ................................................................................................................................ iv
List of Abbreviations........................................................................................................................................vii
List of Figures .................................................................................................................................................viii
List of Tables .................................................................................................................................................... ix
Chapter 1: Introduction ...................................................................................................................................... 1
1.1 Introduction .............................................................................................................................................. 1
1.2 Problem Statement ................................................................................................................................... 1
1.2.1 Problem Statement : ......................................................................................................................... 1
1.2.2 Kisan A Solution :.............................................................................................................................. 1
1.3 Objectives ................................................................................................................................................ 2
1.4 Scope and Limitation ............................................................................................................................... 2
The functions of Kisan encompass the following key areas: ..................................................................... 2
The limitations of kisan include:................................................................................................................ 3
1.5 Development Methodology ..................................................................................................................... 3
1.6 Target Audience ....................................................................................................................................... 4
1.7 Report Organization ................................................................................................................................. 4
Chapter 2: Background Study and Literature Review ....................................................................................... 6
2.1 Background Study .................................................................................................................................... 6
2.1.1 Agricultural Challenges .................................................................................................................... 6
2.2 Role of Technology in Agriculture .......................................................................................................... 7
2.3 Review of Existing Solutions................................................................................................................... 7
2.4 Literature Review..................................................................................................................................... 7
Chapter 3: System Analysis and Design .......................................................................................................... 10
3.1 System Analysis ..................................................................................................................................... 10
3.1.1 Requirement Analysis ..................................................................................................................... 10
3.2 Feasibility Study .................................................................................................................................... 11
i. Technical Feasibility: .................................................................................................................................... 11
ii. Operational Feasibility: ............................................................................................................................... 11
iii. Economic Feasibility: ................................................................................................................................. 11
Chapter 4: Kisan System Flow Chart............................................................................................................... 16
4.1 System Design ....................................................................................................................................... 16
4.1.1 Architectural Design ....................................................................................................................... 16
4.2.1 Database Schema Design ................................................................................................................ 17
4.3.1 Interface Design .............................................................................................................................. 18
4.4.1 Algorithm ........................................................................................................................................ 19
v
Chapter 5: Implementation and Testing ........................................................................................................... 20
5.1 Implementation ...................................................................................................................................... 20
5.1.1 Frontend Tools ................................................................................................................................ 20
5.1.3Algorithm Implementation............................................................................................................... 21
5.2 Testing.................................................................................................................................................... 22
5.2.1Test Cases for Unit Testing.............................................................................................................. 22
Chapter 6: Conclusion and Future Recommendations..................................................................................... 25
6.1 Conclusion ............................................................................................................................................. 25
6.2 Lessons Learned/Outcomes ................................................................................................................... 25
Appendices ....................................................................................................................................................... 26

vi
List of Abbreviations

The following table describes the significance of various abbreviations and acronyms used throughout the
report.

Abbreviation Meaning
CSS Cascade Style Sheet
DFD Data Flow Diagram
ERD Entity Relationship Diagram
HTML Hyper Text Markup Language
JS JavaScript
NFR Non Functional Requirement
UI User Interface
UX User Experience

vii
List of Figures
Figure 1 Agile Methodology .............................................................................................................................. 4
Figure 2 Use Case Diagram ............................................................................................................................. 11
Figure 3 ERD of Kisan .................................................................................................................................... 12
Figure 4 Context Diagram of Kisan ................................................................................................................. 13
Figure 5 Process Modeling DFD .................................................................................................................... 13
Figure 6 Level 1 DND of Kisan ....................................................................................................................... 14
Figure 7Architectural Design of Kisan ............................................................................................................ 17
Figure 8 Database Schema Design of Kisan .................................................................................................... 18
Figure 9 User Interface of Kisan ...................................................................................................................... 18

viii
List of Tables
Table 1 Test Case for Installation .................................................................................................................... 22
Table 2 Test Case for user login ...................................................................................................................... 23
Table 3 Test Cases for System Testing ............................................................................................................ 23

ix
Chapter 1: Introduction

1.1 Introduction

Let's explore what Kisaan is all about.


Imagine an online hub where and consumers effortlessly connect, transforming how we engage with fresh
produce. That's Kisaan a revolutionary platform in the agricultural industry.
We are all familiar with the challenges farmers encounter, right? From price fluctuations to excessive
wastage, the struggle is real. As for consumers, we often feel disconnected from the source of our food,
settling for convenience.
However, Kisaan is here to make a difference. We are more than just a middleman. We bridge the gap
between farmers and consumers, eliminating unnecessary layers and ensuring fair transactions for all.
For farmers, this translates to increased control. They no longer have to depend on traditional intermediaries.
With Kisaan, they can set their prices and directly reach out to customers, enhancing sustainability and
providing the economic support they deserve.
As for consumers, get ready to explore a new realm of locally grown, high quality produce. Bid farewell to
the mystery surrounding your groceries with Kisaan, you have full transparency on the origin of your food.
Whether you are a farmer seeking fair treatment or a consumer yearning for transparency and quality,
Kisaan is the ultimate solution for you. Join us in reshaping the way we perceive agriculture and food, one
transaction at a time.

1.2 Problem Statement

1.2.1 Problem Statement :


The agriculture sector faces multiple challenges, including reduced returns for farmers, increased
expenses for consumers, and the significant issue of food wastage. These challenges have negative effects on
both farmers and consumers. Farmers struggle with low profits from their produce, hindering profitability
and reinvestment in their agricultural activities. At the same time, higher costs for consumers create barriers
to accessing nutritious foods, potentially leading to health issues and rising obesity rates. The problem of
food wastage is a significant issue in agriculture, with large quantities lost during transportation and storage,
contributing to environmental degradation and compromising nutritional value.

1.2.2 Kisan A Solution :

To address these challenges, Kisan, a web application, bypasses traditional intermediaries to enable direct
transactions between farmers and consumers. This shift in approach allows farmers to receive better prices
for their produce, while customers gain access to fresh, locally sourced products at competitive prices. By
1
establishing direct relationships between farmers and customers, Kisan has the potential to mitigate many
long standing challenges in the industry. Its impact on the agricultural sector is significant, offering solutions
to the pressing issues faced by farmers and consumers. Through proactive measures, Kisan can help create a
more sustainable and fair food system.

1.3 Objectives

The core objectives of Kisan are as follows:

⚫ Empowering farmers by providing a platform for showcasing and selling their produce directly to
consumers, enhancing their economic viability.
⚫ Providing consumers with a reliable avenue for purchasing fresh, locally grown agricultural products,
promoting healthier dietary habits and sustainable farming practices.
⚫ Cultivating transparency and traceability in the agricultural supply chain to help consumers make
informed decisions about their food choices.
⚫ Reducing food waste through efficient distribution and consumption practices to minimize spoilage and
operational inefficiencies.
⚫ Fostering community involvement and collaboration by creating direct engagement between farmers
and consumers, building trust, accountability, and mutual appreciation.

1.4 Scope and Limitation

The functions of Kisan encompass the following key areas:

⚫ Farmer Enrollment and Profile Setup: Farmers can register on the platform, create detailed profiles, and
list their products for sale, providing consumers with information on product origin, quality, and
sustainability practices.
⚫ Consumer Exploration and Product Discovery: Consumers can explore a variety of agricultural products
based on type, origin, and availability. They can search for specific items according to their preferences.
⚫ Online Purchasing and Payment Processing: Consumers can place orders for products through the Kisan
platform, choose payment methods, and securely complete transactions.
⚫ Order Tracking: Both farmers and consumers can track orders, oversee deliveries, and communicate
effectively throughout the process.
⚫ Inventory Management: Farmers can monitor inventory levels, update listings, and manage stock
quantities for timely replenishment.
⚫ Community Interaction and Feedback: Kisan facilitates community engagement through features like
ratings, reviews, and feedback for improved trust and collaboration.

2
The limitations of kisan include:

⚫ 1. Reliance on User Input


⚫ 2. Varying Response Times
⚫ 3. Limited User Engagement

1.5 Development Methodology

We chose the Agile technique for the E Farm project because it enables us to break down our work into
smaller, more manageable pieces. This approach helps us to make continual progress and deliver value to
our clients at every stage. Agile facilitates effective communication and collaboration with all project
stakeholders, including farmers and buyers.

One of the primary advantages of Agile is its flexibility, which is essential in the dynamic agriculture market.
This methodology allows us to quickly adapt to new requirements or market changes.

By releasing functional components of the app early, we can gather user feedback and make enhancements
based on their needs. This iterative process not only aids in creating a superior product but also ensures
client satisfaction.

Overall, Agile fosters a culture of continuous improvement and a pursuit of excellence. It aligns well with E
Farm's goals by enabling efficient work and high-quality results that meet the expectations of our clients and
users.

3
Figure 1 Agile Methodology

1.6 Target Audience

Kisan caters to a diverse, including:

⚫ Farmers: Small-scale and independent farmers to expand their market reach, increase revenue, and
adopt sustainable farming practices.
⚫ Consumers: Health-conscious individuals, environmentally aware consumers, and supporters of local
agriculture seeking direct access to fresh, high-quality produce sourced from farmers.
⚫ Agricultural Organizations: NGOs, cooperatives, and industry associations committed to promoting
sustainable agricultural practices, enhancing rural development, and improving market access for
farmers.

1.7 Report Organization

⚫ Chapter 1: Introduction and Problem Statement: Provides an overview of the project, outlining
objectives, scope, and limitations while addressing the problem statement.
⚫ Chapter 2: Background Study and Literature Review: Delves into the project's background, offering
insights into functions and components. Includes a literature review to broaden understanding by
examining previous research and analyzing comparable systems.

4
⚫ Chapter 3: System Analysis and Design: Focuses on the analysis and design of the system,
incorporating charts and figures to illustrate key concepts. Outlines functional requirements using
techniques such as use cases, and details the database schema, interface design, and deployment
diagram.
⚫ Chapter 4: Tools and Techniques for Implementation: Explores the tools and techniques used for
implementing the project. Covers the creation of test cases to evaluate the system's performance
thoroughly.
⚫ Chapter 5: Lessons Learned and Future Recommendations: Reflects on the journey from project
inception to completion, highlighting lessons learned. Offers recommendations for future projects and
presents concluding remarks.

5
Chapter 2: Background Study and Literature Review

2.1 Background Study

During our investigation into novel inventory management systems in Nepal's agriculture, we have
discovered that top agricultural cooperatives have used the "AgroTrack" system. The "AgroTrack" system
effectively tracks and manages agricultural inventory by utilizing contemporary handheld devices with
RFID technology.

The "AgroTrack" system's capacity to offer extensive coverage and enable the tracking of several
agricultural products, such as seeds, fertilizers, and animal feed, is one of its main advantages. This broad
coverage makes it easier to manage inventories and gives farmers more effective means of keeping an eye
on the availability of critical inputs.

Inventory levels are immediately updated as products are used in the field thanks to integration with
agricultural equipment like tractors and seeders. Farmers can maximize their use of resources by avoiding
overstocking and stockouts as a result of this real-time tracking.

In addition, the "AgroTrack" system's smooth connection with mobile apps enables farmers to access
inventory information and place orders from a distance. This function improves accessibility and
convenience, especially for farmers in outlying locations who might have trouble getting to regular
marketplaces.

However, the initial cost of RFID technology and farmer training could pose a problem for the "AgroTrack"
system. Despite this, both individual farmers and agricultural cooperatives will find that the long-term
advantages of enhanced inventory management and higher output outweigh the initial outlay.

2.1.1 Agricultural Challenges

Economic Challenges: Farmers struggle with market price fluctuations, high production costs, and limited
financial support, posing significant obstacles.

Technological Challenges: The agricultural sector faces inefficiencies due to the insufficient adoption of
technology in production, distribution, and marketing processes.

Environmental Challenges: Climate change, water scarcity, and soil degradation threaten agricultural
sustainability and productivity.

6
2.2 Role of Technology in Agriculture

Technological Innovations: Digital solutions such as web platforms, mobile applications, and IoT
devices are revolutionizing farming practices, enabling precision agriculture and data-driven
decision-making.

Enhanced Market Connectivity: Online market platforms connect farmers directly with consumers,
reducing dependence on intermediaries and increasing profitability.

Emphasis on Sustainability: Technological advancements support the adoption of sustainable


farming practices like organic farming, conservation agriculture, and agroforestry, promoting
environmentally friendly approaches in agriculture.

2.3 Review of Existing Solutions

Comparative Analysis: Evaluating established agricultural platforms like Farm2Table, AgriMarket,


and Farmigo to identify common features, functions, and user interactions.

Case Studies: Examining successful direct-to-consumer strategies in agriculture to understand best


practices and potential challenges.

2.4 Literature Review

In Nepalese context, internet subscribers in Nepal reached 38.78% of whole population. More than two
dozen E-Commerce sites are active where Metrotarkari, Chizbiz, Agromart, Kaymu are some existing online
groceries from Kathmandu valley. As Nepal is agricultural nation, percentage contribution to GDP by
agriculture and forestry sector is 33% which indicates the increasing value of this sector in Nepalese
economy. Predominance of intermediaries, influence of Indian market, lack of master plan, poor storage,
processing and transportation facilities and weak market intelligence are few pitfalls of agricultural
marketing system where infrastructural-technical, social, cultural, agriculture state and educational factors
are relevant barriers to adapt E-Commerce in agriculture. On these backgrounds and contexts, this study was
carried out to find out the current challenges for implementing E-Commerce in agriculture in the scenario of
Kathmandu Valley, Nepal. [1]

E-commerce platform has a wide concept, but in simple terms can be referred to as a software with the help
of which people can buy and sell product or services online. Internationally, there is various e-commerce
platform marketplaces and some of them are Amazon, eBay, Walmart, Etsy, Alibaba. Also, there are
platforms such as Shopify, WooCommerce, Magento and these platforms can be considered as a solution as
7
they provide all the necessary tools to develop, deploy and host an e- commerce store. They provide all the
technical services required in cloud and can be accessed through medium of internet. In the context of Nepal,
we observe in ecommerce platform marketplaces like Daraz, Sastodeal, Hamrobazar, Nepabay, Foodmandu.
Some other big online e- commerce store we observed was Evo store, Olizstore who sell imported electronic
products such as Apple, Moshi, Bose, JBL. We have observed only big companies and stores having their
own dedicated online e-commerce store with the objective to promote their own brand and normal
merchants do not have their own online store, rather they turn to marketplaces such as Daraz, Sastodeal,
Hamrobazar. These marketplaces are less effective while promoting merchant’s brand. In a study conducted
in China the author mentioned, there are different cultures and business philosophies typically exist here,
limiting the application and transferability of western e-commerce methods There are various challenges for
these e-commerce platforms that includes security, payment methods, trust, internet connectivity, product
delivery. This paper will discuss about the challenges that is faced in e-commerce platforms in context of
Nepal. [2]

The e-commerce industry has been growing with the technological advancement and the expansion of
Internet facility. People in Nepal are also aware of the facility provided by the e-commerce which eases their
way of lifestyle as well as contribute in the digital economy of the country. There are many e-commerce
applications operating in Nepal such as daraz, sastodeal, gyapu.com and many more. With the growing e-
commerce applications and the growing internet and mobile users, the trend of online shopping seems to
increase at a faster pace. [3]
The impact of IT is more far-reaching than any one may have had imagined, encompassing all facets and
sectors of society. Economically, e-commerce generated more than $1.5 trillion in the US in 2004 and is
projected to be 30, 15 and 2.6% of the total manufacturing, whole sales and retail sales in the US in 2006
respectively. IT research in agriculture has so far been particularly applied to such fields as precision
farming and bioinformatics and in extension and farming practices. As such, its potential application in
agricultural e-commerce has only begun to be explored. The United States Department of Agriculture has
identified four different functions that e-commerce firms perform in the agricultural sector. They are: (1)
information distribution, (2) input supply, (3) commodity trading floor, and (4) logistics/supply chain
management. [4]
The internet is playing an increasing role in the development of rural areas. Farmers in particular, can benefit
from new opportunities concerning farm management decisions. Hence, the goal of this study was to
investigate German farmers’ willingness to accept (WTA) e-commerce. Primary data of 165 farmers was
collected by conducting a discrete choice experiment about the purchase of crop protection products. WTA
estimates show that farmers are willing to switch to an online merchant if they are offered a significantly
lower price. [4]

8
In recent years, the e-commerce industry has increasingly emphasized the importance of information sharing.
Some agricultural e-commerce companies have set up a formal information department to further integrate
information and systems (Meier et al., 2015). The blessing of Internet of Things technology and the effective
use of databases have led to the integration of existing information systems (Jekanowski et al., 2016).
According to the “Nolan model”, most of China’s agricultural products e-commerce enterprises are in the
control and integration stages . [4]

9
Chapter 3: System Analysis and Design

3.1 System Analysis

3.1.1 Requirement Analysis


i. Functional Requirements

⚫ User authentication and authorization


⚫ Farmer profile creation and product listing
⚫ Customer browsing and product search
⚫ Online ordering and payment processing
⚫ Order management and tracking
⚫ Inventory management and stock monitoring

ii. Non-functional Requirements

⚫ Usability: Intuitive user interface, responsive design, and easy navigation.


⚫ Performance: Scalability, reliability, and quick response times.
⚫ Security: Secure authentication, data encryption, and protection against cyber threats.
⚫ Accessibility: Compliance with web accessibility standards to ensure inclusivity for all users.

10
Figure 2 Use Case Diagram

3.2 Feasibility Study

i. Technical Feasibility:

⚫ Assessment of required technologies: Frontend framework (ReactJS), backend framework (Node.js),


database system (MongoDB), and hosting platforms (AWS, Google Cloud).
⚫ Evaluation of development resources: Availability of skilled developers, technical expertise, and
infrastructure requirements.
⚫ Compatibility and integration: Compatibility of chosen technologies, frameworks, ease of integration,
and interoperability with existing systems.

ii. Operational Feasibility:

⚫ Analysis of operational processes: Assessment of workflow efficiency, resource allocation, and


organizational readiness for system implementation.
⚫ Training and support: Identification of training needs, user support mechanisms, and change
management strategies.

iii. Economic Feasibility:

⚫ Cost-benefit analysis: Estimation of development costs, potential revenue streams, and return on
investment (ROI) over the project lifecycle.
11
⚫ Revenue model: Evaluation of subscription-based models, transaction fees, and other monetization
strategies.

Figure 3 ERD of Kisan


⚫ Market potential: Assessment of market demand, competition, and growth opportunities for the KISAN
platform.

12
Kisa
n

Figure 4 Context Diagram of Kisan

13

Figure 5 Process Modeling DFD


14
15
Chapter 4: Kisan System Flow Chart

4.1 System Design

4.1.1 Architectural Design

⚫ Client-server architecture: The Kisan system utilizes a client-server architecture. The client represents
the user interface, while the server manages data processing, storage, and responds to client requests.
Separating the frontend (client) and backend (server) components ensures scalability and maintainability.
Users access the platform through web browsers or mobile apps, with the server handling logic and
database management.
⚫ Microservices architecture: Kisan follows a microservices architecture, dividing functionalities into
smaller, independent services. Separate services are dedicated to user authentication, product
management, order processing, and payment integration. This design enables flexibility and simplified
development, as changes to individual services do not impact the entire system.
⚫ RESTful APIs: To facilitate communication between frontend and backend components, Kisan uses
RESTful APIs. These APIs act as intermediaries between the client-side interface and server-side
services. When a user interacts with the frontend to perform an action, such as placing an order or
updating their profile, the frontend sends a request to the relevant RESTful API endpoint on the server.
The server processes the request, communicates with the necessary services, and sends a response back
to the client. This standardized approach ensures smooth communication, interoperability, and efficient
data exchange within the application.

16
Figure 7Architectural Design of Kisan

4.2.1 Database Schema Design

⚫ Entity-relationship modeling: In Kisan's database schema, we organize data into relational databases
to store various information such as user profiles, product listings, orders, payments, and inventory
details. This helps us understand the relationships between different pieces of data and ensures efficient
storage and retrieval.
⚫ Normalization: We use normalization techniques to maintain data integrity and minimize redundancy
in the database. By organizing data into logical tables and removing duplicate information, we prevent
inconsistencies and ensure accurate and reliable data storage.
⚫ Database optimization: To enhance database performance and efficiency, we implement various
optimization strategies such as indexing, caching, and partitioning. Indexing speeds up data retrieval by
creating efficient access paths to specific data, while caching stores frequently accessed data in memory
for quicker access. Partitioning allows us to divide large tables into smaller, more manageable segments,
improving query performance and scalability. These optimization techniques guarantee smooth and
efficient operation of Kisan's database, even with large data volumes.

17
Figure 8 Database Schema Design of Kisan

4.3.1 Interface Design

Figure 9 User Interface of Kisan

⚫ Wireframing and prototyping: Sketching interface layouts and interactive prototypes to visualize user
journeys and screen flows.
⚫ Responsive design: Designing layouts for desktop, tablet, and mobile devices to guarantee optimal user
experience across all screen sizes.

18
⚫ Accessibility considerations: Incorporating accessibility features like alternative text
⚫ for images, keyboard navigation, and screen reader compatibility.

4.4.1 Algorithm

Algorithm

In the "KISAN", both bubble sort and merge sort algorithms are utilized for different functionalities:

◼ Merge Sort:

⚫ Merge sort is used in the inventory management module due to its efficiency and effectiveness in
sorting large datasets.
⚫ With a worst-case time complexity of O(n log n), merge sort ensures consistent performance, making it
ideal for sorting tasks with large amounts of data.
⚫ Utilizing a divide-and-conquer strategy, merge sort breaks down the sorting task into smaller
subproblems, sorts them individually, and merges the results. This simplifies implementation and
guarantees efficient sorting, particularly for large datasets.
⚫ The choice of merge sort over other sorting algorithms is justified by its stability, scalability, and
predictable performance, making it suitable for sorting and alphabetically listing products in the
inventory module.

◼ Bubble Sort:

⚫ Bubble sort is implemented in the search functionality of our system, enabling users to search for
specific elements within a sorted collection.
⚫ Despite its higher time complexity compared to merge sort, the simplicity and ease of implementation
of bubble sort make it ideal for real-time search operations.
⚫ Bubble sort works by comparing adjacent elements and swapping them if they are in the wrong order,
gradually moving the largest unsorted element to its correct position.
⚫ The decision to use bubble sort for search operations is based on its predictability and ease of
implementation, allowing users to quickly find specific products within the inventory module.
⚫ Furthermore, the search functionality typically deals with smaller datasets compared to sorting tasks in
the inventory management module, making bubble sort a practical choice for efficient real-time search
operations.

19
Chapter 5: Implementation and Testing

5.1 Implementation

5.1.1 Frontend Tools

For frontend development, we used ReactJS, HTML, CSS, JavaScript, Redux, and Next.js. Setting up the
development environment involved Node.js, npm, and webpack. Our architecture follows a component-
based approach, reusing components for various UI elements, layout structures, and interactive widgets.

Backend and Database

Technologies:

⚫ Node.js
⚫ Express.js
⚫ MongoDB
⚫ Mongoose
⚫ JSON Web Tokens (JWT)
⚫ Development of RESTful APIs: We implemented routing, middleware, request handling, and response
formatting for a robust backend system.
⚫ Managing Database Interactions: Our backend handles CRUD operations, data validation, and error
management.

Database Configuration:

⚫ Deploying MongoDB included installing, configuring, and setting up the server.


⚫ Designing Database Schema: Creating collections, specifying document structures, and establishing
connections.
⚫ Seeding Data: Adding initial datasets for testing and development.

5.1.2 Implementation Module Details

After completing the design phase and addressing any issues, we started the implementation process. While
detailing the entire implementation process is beyond this document's scope, we will discuss key aspects.
Some essential modules of Kisan include:

20
⚫ Registration Form: Allows new users to register by providing company name, username, and
password.
⚫ Login Form: Authenticates users using the registration data.
⚫ Logout: Allows users to log out anytime.
⚫ Dashboard: Provides users with a graphical representation of inventory details.
⚫ Buying: Enables users to add purchased products for record-keeping.
⚫ Selling: Allows users to sell their products.
⚫ Cart: Products can be added to the cart for later checkout.
⚫ Search Module: Users can search for products in the system, displaying details in a table.
⚫ Notification Module: Provides notifications about products nearing expiration.

5.1.3Algorithm Implementation

Inventory module // Bubble sort

export default function bubbleSort(array) {


let len = array.length;
for (let i = 0; i < len; i++) {
for (let j = 0; j < len - i - 1; j++) {
if (new Date(array[j].date) > new Date(array[j + 1].date)) {
let temp = array[j];
array[j] = array[j + 1];
array[j + 1] = temp;
}
}
}
return array;
}

Bubble sort: // Merge sort

export default function mergeSort(array) {


if (array.length < 2) {
return array;
}
21
const middle = Math.floor(array.length / 2);
const left = array.slice(0, middle);
const right = array.slice(middle);

return merge(mergeSort(left), mergeSort(right));


}

function merge(left, right) {


const sortedArray = [];

while (left.length && right.length) {


if (new Date(left[0].date) < new Date(right[0].date)) {
sortedArray.push(left.shift());
} else {
sortedArray.push(right.shift());
}
}

return sortedArray.concat(left.slice()).concat(right.slice());
}

5.2 Testing

5.2.1Test Cases for Unit Testing

Table 1 Test Case for Installation

S.N Input Test Data Expected Result Actual Result Remarks

1 Enter URL Open application Application Pass


with its home page executed with its
home page

22
Table 2 Test Case for user login

S.N Input User Expected Result Actual Result Remark


Data s

1 king658sub@gma Open Dashboard Dashboard Pass


il.com displayed
Hritik Subedi
2 hgf@gmail.com Show Error Error Displayed Pass
hgf123

Table 3 Test Cases for System Testing

S.N Input User Data Expected Result Actual Result Remarks

1 Enter URL Open application Application Pass


with its home page executed
with home
page

2 subedi658@gmail.com Open Dashboard Dashboard Pass


HritikSubedi displayed
3 Add Product Added Data showed on Pass
Successfully table

4 Edit Product details Edited Data showed on Pass


Successfully table

5 Delete Product details Deleted Data showed on Pass


Successfully table

6 Add to cart Added to cart Output Displayed Pass


successfully

23
7 Searching of Products Searched Product Data showed on Pass
Successfully table

24
Chapter 6: Conclusion and Future Recommendations

6.1 Conclusion

Completing this was a rewarding experience full of challenges and for growth. The goal of this project was
to create a tailored platform for managing orders within the tailoring. We used React.js, Next.js, MongoDB
and Node.js to develop the application, ensuring it met all the specified requirements. Throughout the
development process, we honed our skills in system analysis and design through interface diagrams,
database management techniques, and user-centric design principles. This project also provided valuable
insights into creating successful applications.

6.2 Lessons Learned/Outcomes

The primary objective of this project was to build a functional system capable of interacting with a database,
displaying content, and facilitating editing or deletion of information. A significant lesson learned was the
importance of effective time management when dealing with complex system components. It highlighted the
need for continuous research in a software developer's workflow, emphasizing efficient research practices
and the selection of appropriate and straightforward solutions.

25
Appendices

Screenshot 1: Home Page

Screenshot 2:
Admin Dashboard

26
Screenshot 3 : Product Page

Screenshot 4 : Add to cart

27
Screenshot 5 : Order Page

Screenshot 6: Adding new Item

28
Screenshot 7: Payment

Screenshot 8 : Succesful Payment

29

You might also like