Final Project
Final Project
Submitted in partial fulfillment of the requirement for the award of the degree of
Submitted by:
April-2024
CANDIDATE’S DECLARATION
I/we hereby certify that the work which is being presented in the Project Report entitled
“ChatBot” in partial fulfillment of the requirements for the award of the Degree of Master
of Computer Applications in the Department of Computer Applications of the Graphic Era
(Deemed to be University), Dehradun shall be carried out by the undersigned under the
supervision of Mrs. Neelam Singh (Associate Professor) , Department of Computer
Applications, Graphic Era (Deemed to be University), Dehradun.
The above mentioned students shall be working under the supervision of the
undersigned on the “ChatBot Using Python”
Signature Signature
Any Comments:
1.
2.
2
Table of Content
Page No.
Abstract
Acknowledgement
Chapter 1. Introduction
Chapter 2. System Analysis
2.1. Introduction
2.2 Objectives
2.3 Functional Requirenments
2.4 Non-Functional Requirenments
2.5 System Architecture
2.6 Data Flow
2.7 System Integration
Chapter 3. Identificaiton of Need
3.1. Current Challenges in Food Delivery
3.2. Benefits of Implementing Chatbot
3.3. Specific Needs Addressed by chatbot
Chapter 4. Preliminary Investigation
4.1. Current State Analysis
4.2. Problem Identification
4.3. Potential benefits of Chatbot
4.4. Feasibility Analysis
4.5. Scope and Requirements
4.6. StakeHolder Input
Chapter 5. Project Planning
5.1. Project Scope
5.2. Project Objectives
5.3. Resources Requirements
5.4. Timeline and MileStones
5.5. Risk Management
Chapter 6. Software Requirenments Specialization(SRS)
6.1. Scope
6.2. System Overview
6.3. System Architecture
6.4. Interface Requirnments
Chapter 7. Database Connectivity
7.1. Set up Database
7.1. Functions in the Database
Chapter 8. User Interface Design
8.1. HTML Code for Inteface
Chapter 9. Coding
9.1. Code for Integration of Dialogflow with Backend
3
9.2. Code fir integration of Dataabase with project
9.3. Generic helper Class
Chapter 10. Database Security
Chapter 11. Cost Estimation of the project
Chapter 12. Future Enhancements
Chapter 13. Pert Chart / Gaant Chart
13.1. Pert Chart
13.2. Gantt Chart
Chapter 13. Pert Chart / Gaant Chart
13.1. Pert Chart
13.2. Gantt Chart
Chapter 14. Glossary
4
Abstarct
This project aims to develop a chatbot using Python programming language to facilitate
natural language interactions between users and a food delivery service. Leveraging Python's
robust libraries and frameworks, including NLTK (Natural Language Toolkit) and
TensorFlow, the chatbot will employ machine learning and natural language processing
techniques to understand user queries, process orders, and provide personalized
recommendations. The project will follow a systematic approach, starting with data
collection and preprocessing, followed by model training and evaluation to ensure accurate
and contextually relevant responses. The chatbot will be integrated with existing food
delivery platforms, enabling users to place orders, track deliveries, and resolve inquiries
seamlessly. The outcomes of this project will include an efficient and user-friendly chatbot
solution that enhances customer experience, increases operational efficiency, and drives
business growth in the competitive food delivery services industry.
5
1. Introduction
In recent years, the healthcare industry has witnessed a rapid transformation driven by
advancements in technology. One of the notable innovations is the integration of artificial
intelligence (AI) and natural language processing (NLP) into healthcare services, leading to
the development of intelligent chatbots. These chatbots have the potential to revolutionize the
way healthcare services are delivered, offering efficiency, accessibility, and personalized
user experiences.
This project focuses on the development of a Chatbot for Medicine Delivery, leveraging the
capabilities of Dialogflow, a natural language understanding platform by Google. The
primary objective of this project is to streamline the process of ordering medicines, making it
more efficient and user-friendly for patients and healthcare providers alike.
The chatbot developed in this project is designed to handle various tasks, including receiving
medicine orders, providing information about available medicines, and updating users on the
status of their orders. The integration with a backend database ensures that the chatbot can
manage and retrieve data effectively, supporting real-time interactions and order processing.
Moreover, the project includes the creation of a user-friendly website that serves as an
interface for interacting with the chatbot. This website not only facilitates easy
communication between users and the chatbot but also provides additional functionalities
such as viewing order history, checking medicine availability, and accessing healthcare
information.
The need for such a chatbot arises from the increasing demand for efficient and accessible
healthcare services. Traditional methods of ordering medicines often involve long wait times,
manual processing, and limited accessibility, especially in remote areas. By introducing an
AI-powered chatbot, this project aims to address these challenges, providing a solution that is
6
available 24/7, capable of handling multiple queries simultaneously, and accessible from
anywhere with an internet connection.
The development of this chatbot involves several key steps, including designing the chatbot's
conversational flow, integrating Dialogflow with the backend database, and developing the
website interface. Each component is meticulously crafted to ensure a seamless user
experience and reliable performance.
This report will delve into the detailed methodology, system design, implementation process,
and testing strategies employed in the development of the Chatbot for Medicine Delivery.
Through this project, we aim to demonstrate the potential of AI in enhancing healthcare
services and provide a foundation for future innovations in this field.
7
2. System Analysis
2.1. Introduction
The food delivery industry has seen substantial growth, particularly with the advent of digital
platforms that streamline the process of ordering and delivering food. To further enhance
customer experience and operational efficiency, the integration of AI-powered chatbots has
become increasingly popular. This system analysis focuses on a food delivery chatbot
developed using Dialogflow, which includes HTML support for a user-friendly website and
database support for managing orders, menus, and customer information.
2.2. Objectives
The primary objectives of the food delivery chatbot system are:
Automate Order Processing: Facilitate seamless and efficient order taking through
natural language interactions.
Enhance User Experience: Provide a user-friendly interface for customers to interact
with the chatbot via a website.
Efficient Data Management: Utilize a robust database to manage orders, customer
data, and menu items.
Integrate Systems: Ensure smooth integration between the chatbot, database, and
website.
8
2.3. Functional Requirements
The functional requirements for implementing a chatbot in the food delivery services
industry encompass various aspects aimed at enhancing user experience, operational
efficiency, and business growth. Firstly, the chatbot should facilitate seamless order
placement, allowing users to browse menus, customize orders, and make payments
effortlessly. Integration with payment gateways and order management systems is essential
to ensure secure transactions and timely processing. Additionally, the chatbot should provide
real-time order tracking capabilities, enabling users to monitor the status of their orders and
receive updates on delivery times. This functionality enhances transparency and trust,
contributing to overall customer satisfaction. Furthermore, the chatbot should offer
personalized recommendations based on user preferences, order history, and dietary
restrictions, enhancing upselling opportunities and driving higher order values. It should also
provide responsive customer support, addressing inquiries, and resolving issues promptly to
maintain positive customer relationships. Operational functionalities such as automating
routine tasks, managing reservations, and analyzing customer data for insights and decision-
making are crucial for streamlining operations and driving business growth. Lastly, the
chatbot should be scalable and adaptable, capable of integrating with existing systems and
evolving alongside changing customer needs and technological advancements. By fulfilling
these functional requirements, the chatbot can effectively contribute to the success and
competitiveness of food delivery services in the dynamic market landscape.
9
sacrificing performance or responsiveness. Security is another critical consideration,
requiring robust measures to safeguard sensitive user data, payment information, and
transactional details. Implementing encryption, access controls, and compliance with data
protection regulations are imperative to mitigate cybersecurity risks and instill confidence in
users regarding their privacy and security. Moreover, performance optimization is essential
to ensure that the chatbot delivers prompt responses and operates efficiently across various
devices and platforms. This includes optimizing response times, minimizing latency, and
optimizing resource utilization to enhance user experience. Lastly, maintainability is crucial
for the long-term sustainability of the chatbot, necessitating clear documentation, modular
design, and regular updates to address bugs, incorporate new features, and adapt to evolving
user needs and technological advancements. By addressing these non-functional
requirements comprehensively, the chatbot can deliver a robust, secure, and scalable solution
that enhances customer satisfaction and drives business success in the competitive food
delivery services landscape.
1. Dialogflow Chatbot
Provides a graphical user interface for users to interact with the chatbot.
Displays menu items, allows users to place orders, and manage their accounts.
3. Database
Stores user information, order details, menu items, and transaction records.
Ensures data integrity and supports efficient data retrieval and updates.
10
4. Integration Layer
Users interact with the chatbot via the website or other messaging platforms.
The chatbot processes user inputs, queries the database if needed, and
responds accordingly.
2. Order Placement
Confirmation and order status updates are communicated back to the user.
3. Menu Management
The system retrieves the latest menu information from the database.
Users can browse the menu, and the chatbot can provide detailed information
about specific items.
4. Account Management
Users can create and manage their accounts through the website.
Account details are stored in the database, and any updates are synchronized.
11
Dialogflow and Database Integration
The website embeds the chatbot interface, allowing users to interact with the
chatbot directly.
API calls facilitate data exchange between the website and chatbot.
The website retrieves and displays data from the database, such as menu items
and user order history.
Any updates made via the website are reflected in the database and
synchronized with the chatbot.
12
3. Identification of Need
In the contemporary digital landscape, businesses and services continuously seek ways to
enhance user experience, streamline operations, and maintain a competitive edge. Chatbots,
powered by artificial intelligence (AI) and natural language processing (NLP), have emerged
as a vital tool in achieving these goals. This section explores the specific needs and
motivations behind developing a chatbot project, particularly in the context of food delivery
services.
Another significant challenge is maintaining food quality and safety standards throughout the
delivery process. Ensuring that food remains fresh and uncontaminated during transportation
requires robust packaging and handling protocols. Moreover, addressing dietary restrictions,
allergies, and food preferences accurately adds complexity to the ordering process and
increases the risk of errors.
Furthermore, labor issues, including driver shortages and labor disputes, can impact the
availability and reliability of delivery personnel. Ensuring fair compensation and working
conditions for delivery drivers while balancing the operational costs of the business poses a
continuous challenge for food delivery companies.
13
Lastly, technological advancements and consumer preferences are constantly evolving,
requiring food delivery services to innovate and adapt quickly to stay competitive. This
includes investing in advanced delivery tracking systems, mobile apps, and AI-driven
personalization to enhance the user experience and meet evolving customer expectations.
Moreover, chatbots can offer personalized recommendations based on user preferences, order
history, and browsing behavior, enhancing upselling and cross-selling opportunities for food
delivery businesses. By analyzing customer data and behavior, chatbots can suggest relevant
menu items, promotions, and discounts, driving higher order values and revenue generation.
Furthermore, chatbots can improve operational efficiency by automating routine tasks such
as order processing, reservation management, and customer support inquiries. This
14
automation frees up human resources to focus on more complex tasks and enhances overall
productivity.
In terms of customer support, chatbots can provide instant assistance and resolve common
queries and issues without the need for human intervention. This reduces wait times for
customers and improves response times, leading to higher levels of customer satisfaction and
retention.
Moreover, chatbots can integrate with existing systems and platforms, including websites,
mobile apps, and social media channels, providing a seamless omnichannel experience for
customers. This consistency across channels enhances brand visibility and strengthens
customer engagement and loyalty.
Overall, implementing a chatbot in the food delivery services industry can lead to improved
customer satisfaction, increased sales, enhanced operational efficiency, and strengthened
competitive advantage. By leveraging chatbot technology, food delivery businesses can meet
the evolving needs and expectations of customers in a fast-paced and competitive market
landscape.
15
facilitates upselling and cross-selling opportunities, thereby increasing revenue potential for
food delivery businesses. Operationally, the chatbot automates routine tasks such as order
processing, reservation management, and customer support inquiries, freeing up human
resources to focus on more strategic initiatives. By addressing these specific needs, the
chatbot not only enhances customer satisfaction and loyalty but also drives operational
efficiency and revenue growth in the competitive food delivery services industry.
16
4. Preliminary Investigation
The preliminary investigation for the Food Delivery Chatbot project involves understanding
the current state of food delivery services, identifying existing problems, exploring potential
solutions, and determining the feasibility of developing a chatbot to address these issues.
This investigation is crucial in laying the foundation for the project and ensuring its
alignment with business goals and customer needs.
Objectives
1. To analyze the current food delivery process and identify pain points.
Orders are typically received through phone calls, mobile apps, or websites.
Manual order processing can lead to errors and delays, especially during peak
hours.
2. Customer Support
Customer inquiries about menu items, delivery status, and issues are handled
by human agents.
17
Limited availability and long wait times can result in poor customer
satisfaction.
3. Scalability Issues
During high demand periods, existing systems and staff may struggle to
handle the volume of orders and inquiries.
Scaling the operation requires additional resources, which can be costly and
time-consuming.
4. User Experience
The current system may not provide a consistent user experience due to
variability in human agent interactions.
High operational costs due to the need for extensive customer support staff.
2. Customer Dissatisfaction
3. Data Management
18
4.3. Potential Benefits of a Chatbot
1. Automation of Order Processing
Automates the entire order process, reducing the likelihood of errors and
speeding up order fulfillment.
3. Cost Reduction
Reduces the need for a large customer support team, leading to significant
cost savings.
4. Scalability
5. Personalized Service
19
Integration Capabilities: Existing APIs and webhook functionalities allow
for seamless integration with the database and website.
2. Operational Feasibility
Change Management: Training and support for staff to adapt to the new
system can be managed effectively.
3. Economic Feasibility
Funding Availability: Budget allocation for the project is feasible within the
current financial planning.
User Interaction: The chatbot must handle natural language inputs for
placing orders, answering queries, and providing order updates.
20
User Account Management: Allow users to create and manage their
accounts.
2. Non-Functional Requirements
Security: Protect user data and comply with data protection regulations.
Usability: Design an intuitive interface for both the chatbot and the
supporting website.
3. Integration Requirements
Emphasize the need for reducing operational costs and improving customer
satisfaction.
Concerns about job security but positive about reducing repetitive tasks.
3. Customers
21
Desire for quicker service, real-time order tracking, and personalized
interactions.
22
5. Project Planning
Effective project planning is crucial for the successful implementation of the Food Delivery
Chatbot. This phase involves defining the project scope, setting objectives, determining
resource requirements, creating a timeline, and identifying potential risks and mitigation
strategies. The following sections outline a comprehensive project plan for developing a food
delivery chatbot using Dialogflow, integrating it with a database, and providing a user-
friendly web interface.
1. Automate Order Processing: Allow users to place, customize, and track food orders
through natural language interactions.
3. Integrate with Existing Systems: Seamlessly integrate with the existing database
and website to ensure smooth data flow and user experience.
4. Collect and Analyze Data: Gather data on user interactions and preferences to
inform business decisions and improve services.
23
3. Database Integration: Ensure the chatbot and website can interact with a backend
database for order management and user data.
4. Testing and Deployment: Conduct thorough testing to ensure the system's reliability,
performance, and security before deploying it.
Project Manager
Dialogflow Developer
Web Developer
Database Administrator
UI/UX Designer
2. Technical Resources
3. Budget
24
Contingency fund for unexpected expenses.
Implement the backend database and integrate it with the chatbot and website.
25
5. Testing Phase (4 Weeks)
Regularly update the chatbot and website based on new requirements and
feedback.
26
2. Mitigation Strategies
27
6. Software Requirement Specifications (SRS)
This Software Requirement Specification (SRS) document outlines the functional and non-
functional requirements, system architecture, and other critical aspects of the Food Delivery
Chatbot project. The chatbot will automate order processing, provide customer support, and
integrate seamlessly with a website and a backend database.
The purpose of this SRS document is to detail the specifications and requirements for the
development and implementation of a food delivery chatbot using Dialogflow, supported by
a website and a database. This document serves as a guide for developers, designers, and
stakeholders to ensure a clear understanding of the project’s objectives and functionalities.
6.1. Scope
The food delivery chatbot project includes:
Connectivity with a backend database to manage orders, menu items, and customer
information.
28
2. Web Interface: A user-friendly website where customers can interact with the
chatbot, browse the menu, place orders, and manage their accounts.
3. Database: Stores customer data, order details, menu items, and transaction history,
ensuring data integrity and accessibility.
2. Web Interface
3. Database
Ensures data consistency and supports efficient data retrieval and updates.
4. Integration Layer
29
6.4. Interface Requirements
1. User Interface (UI)
30
7. DataBase Connectivity
To integrate the Dialogflow chatbot with the database and create a seamless flow for your
food delivery project, follow these steps for database connectivity. I'll assume you're using a
typical web stack with [Link] for the server-side logic. Below is a comprehensive guide
including necessary configurations and sample code.
USE Pandeji_Medical;
name VARCHAR(100),
price INT
);
31
CREATE TABLE Orders (
itemId INT,
quantity INT,
totalPrice INT
);
32
CREATE TABLE OrderTracking (
status VARCHAR(20) ,
);
33
CREATE DEFINER=`root`@`localhost` FUNCTION
`get_price_for_item`(p_item_name VARCHAR(255)) RETURNS decimal(10,2)
DETERMINISTIC
BEGIN
DECLARE v_price DECIMAL(10, 2);
RETURN v_price;
ELSE
-- Invalid item_name, return -1
RETURN -1;
END IF;
END
Result is :
34
To get total order Price
DETERMINISTIC
BEGIN
FROM orders
RETURN v_total_price;
ELSE
RETURN -1;
END IF;
END
35
Result is :
36
8. User Interface Design
A well-designed user interface (UI) is essential for ensuring a smooth and intuitive user experience.
For this food delivery chatbot project, we'll focus on creating a clean, user-friendly interface that
allows users to interact easily with the chatbot. Below, I'll outline the key components and provide a
sample HTML, CSS, and JavaScript implementation for the UI.
2. Chat Window: A section where users can see the conversation with the chatbot.
<!DOCTYPE html>
<html>
<head>
<link href="[Link]
rel="stylesheet">
<style>
body {
margin: 0;
37
padding: 0;
background-color: #f4f4f4;
color: #333;
.container {
max-width: 1200px;
margin: auto;
padding: 20px;
header {
background-color: #333;
color: white;
padding: 10px 0;
nav {
text-align: center;
nav a {
color: white;
text-decoration: none;
margin: 0 15px;
font-weight: 700;
38
nav a:hover {
color: #ddd;
#home img {
width: 100%;
height: auto;
border-radius: 8px;
margin-bottom: 20px;
.photo-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
margin: 20px 0;
.image-container {
position: relative;
width: 30%;
margin: 10px 0;
.image-container img {
width: 100%;
height: auto;
39
border-radius: 8px;
.image-container:hover img {
transform: scale(1.05);
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
opacity: 0;
border-radius: 8px;
.image-container:hover .overlay {
opacity: 1;
40
}
.text-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 20px 0;
.text-view {
flex: 1;
padding: 20px;
background-color: #fff;
margin: 10px;
border-radius: 8px;
.text-view:hover {
transform: translateY(-5px);
.text-view h3 {
margin-top: 0;
section {
41
margin: 20px 0;
padding: 20px;
background-color: #fff;
border-radius: 8px;
#location, #contactus {
text-align: center;
margin-top: 0;
.chat-bot {
display: block;
border: none;
border-radius: 8px;
</style>
</head>
<body>
<div class="container">
<header>
42
<nav>
<a href="#home">HOME</a> |
<a href="#menu">MENU</a> |
<a href="#location">LOCATION</a> |
</nav>
</header>
<section id="home">
</section>
<div class="photo-container">
<div class="image-container">
</div>
<div class="image-container">
</div>
<div class="image-container">
43
<div class="overlay">89 Rs/ </div>
</div>
</div>
<div class="text-container">
<div class="text-view">
<h3>Azrithromycin</h3>
<p>Azithromycin, sold under the brand names Zithromax and Azasite, is an antibiotic
medication used for the treatment of a number of bacterial infections.</p>
</div>
<div class="text-view">
<h3>Dolo-650</h3>
<p>Dolo 650 can be used for headaches, mild to high fevers, and any other type of bodily
aches.</p>
</div>
<div class="text-view">
<h3>Norflox-TZ</h3>
<p>Norflox TZ tablet treats diarrhoea and dysentery caused by amoebas, bacteria, or other
mixed organisms.</p>
</div>
</div>
<div class="photo-container">
<div class="image-container">
44
<div class="overlay">120 Rs/ </div>
</div>
<div class="image-container">
</div>
<div class="image-container">
</div>
</div>
<div class="text-container">
<div class="text-view">
<h3>Meftal forte</h3>
<p>Meftal Forte is used to relieve pain associated with muscles and joints, headache,
migraine, back pain, pain due to sprain, strain and injury, post-operative pain and dental pain.</p>
</div>
<div class="text-view">
<h3>Calcium Tablets</h3>
</div>
<div class="text-view">
45
<h3>Pregablin</h3>
<p>Pregabalin is used to treat epilepsy and anxiety. It's also taken to treat nerve pain. Nerve
pain can be caused by different conditions including diabetes and shingles, or an injury.</p>
</div>
</div>
<div class="photo-container">
<div class="image-container">
</div>
<div class="image-container">
</div>
<div class="image-container">
</div>
</div>
<div class="text-container">
<div class="text-view">
<h3>Vitamin Tablets</h3>
46
<p>Vitamin D is a group of fat-soluble secosteroids responsible for increasing intestinal
absorption of calcium, magnesium, and phosphate, and for many other biological effects.</p>
</div>
<div class="text-view">
<h3>Paracetamol</h3>
<p>It belongs to a group of medicines called analgesics (painkillers) and is used to treat
pain (including headache, toothache, back and period pain) and cold or flu symptoms.</p>
</div>
<div class="text-view">
<h3>Azrithomycin</h3>
<p>Azithromycin, sold under the brand names Zithromax and Azasite, is an antibiotic
medication used for the treatment of a number of bacterial infections.</p>
</div>
</div>
<section id="location">
<h2>Location</h2>
</section>
<section id="contactus">
<h2>Contact Us</h2>
47
</section>
</div>
</body>
</html>
48
9. Coding
import db_helper
import generic_helper
import stripe
import json
import os
app = FastAPI()
inprogress_orders = {}
stripe.api_key =
'sk_live_51PH4rmSH11E0ZkqDMor95GzIqXoMaUiQYesL8NXSUqWLWmgivYjrXQoMs
ogAgcn0ZdNdkG8LSpa2WcTbMsVmdna300oInNruv0'
@[Link]("/")
49
payload = await [Link]()
intent = payload['queryResult']['intent']['displayName']
parameters = payload['queryResult']['parameters']
output_contexts = payload['queryResult']['outputContexts']
session_id = generic_helper.extract_session_id(output_contexts[0]['name'])
intent_handler_dict = {
if intent in intent_handler_dict:
else:
# Handle the case when the intent is not found in the dictionary
50
def add_to_order(parameters: dict , session_id : str):
try:
except ValueError:
if len(medicines) != len(quantities):
51
return JSONResponse(content={"fulfillmentText": "Please specify the quantity for each
medicine."})
else:
if session_id in inprogress_orders:
current_food_dict = inprogress_orders[session_id]
current_food_dict.update(new_food_dict)
inprogress_orders[session_id] = current_food_dict
else:
inprogress_orders[session_id] = new_food_dict
order_str = generic_helper.get_str_from_food_dict(inprogress_orders[session_id])
fulfillment_text = f"So far you have {order_str} in your order. Do you want anything
else?"
52
if session_id not in inprogress_orders:
fulfillment_text = "I am having trouble finding your order. Sorry! Can you place a new
order?"
else:
order = inprogress_orders[session_id]
order_id = save_to_db(order)
if order_id == -1:
else:
order_total = db_helper.get_total_order_price(order_id)
fulfillment_text = (
if client_secret:
else:
53
fulfillment_text += " There was an error processing your payment. Please try again
later."
del inprogress_orders[session_id]
return JSONResponse(content={
"fulfillment_text": fulfillment_text
})
try:
payment_intent = [Link](
amount=amount,
currency=currency,
payment_method_types=['card']
return payment_intent.client_secret
except [Link] as e:
return None
next_order_id = db_helper.get_nxt_order_id()
54
db_helper.insert_order_items(
medicines ,
quantity ,
next_order_id
if rcode == -1:
return -1
print("hello 1 ")
print("hello 2 ")
return next_order_id
if order_id is None:
order_status = db_helper.get_order_status(order_id)
55
if order_status:
fulfilment_text = f"The order status for order id: {order_id} is: {order_status}"
else:
global cnx
cnx = [Link](
host="localhost",
user="root",
password="Gaurav@1510",
database="pandeyji_eatery"
def get_total_order_price(order_id):
cursor = [Link]()
56
query = f"SELECT get_total_order_price({order_id})"
[Link](query)
result = [Link]()[0]
[Link]()
return result
cursor = [Link]()
[Link](insert_query)
[Link]()
[Link]()
try:
cursor = [Link]()
57
[Link]('insert_order_item', (medicines, quantity, order_id))
[Link]()
[Link]()
return 1
[Link]()
return -1
def get_order_status(order_id):
cursor = [Link]()
try:
if isinstance(order_id, list):
order_id = int(order_id)
58
[Link](query, (order_id,))
result = [Link]()
result = None
[Link]()
return result[0]
else:
return None
def get_nxt_order_id():
[Link](query)
result = [Link]()[0]
59
[Link]()
if result is None:
return 1
else:
return result + 1
import re
import re
match = [Link](r"/sessions/(.*?)/contexts/",session_str)
if match:
extracted_string = [Link](1)
return extracted_string
return ""
def get_str_from_food_dict(food_dict):
60
if __name__ =="__main__":
print(get_str_from_food_dict({"samosa":2 , "chole":5}))
61
10. Database security
Ensuring robust database security is essential for safeguarding sensitive information in your
medicine delivery chatbot project. Implementing stringent measures to protect data
integrity, confidentiality, and availability is paramount. This includes employing encryption
techniques to secure data both in transit and at rest, ensuring that sensitive information such
as user credentials and medical records are encrypted to prevent unauthorized access.
Implementing access controls and role-based permissions helps restrict database access to
authorized personnel only, reducing the risk of insider threats or unauthorized data
breaches. Regular security audits and vulnerability assessments should be conducted to
identify and address potential security weaknesses proactively. Additionally, implementing
measures such as database activity monitoring and logging can help detect and mitigate any
suspicious activities or unauthorized access attempts in real-time. Continuously updating
and patching database software and operating systems helps mitigate vulnerabilities and
ensure the latest security patches are applied. Lastly, implementing robust backup and
disaster recovery procedures ensures that data can be recovered in the event of a security
incident or system failure, minimizing the impact on operations and maintaining data
availability. By prioritizing database security measures, your project can effectively mitigate
risks and uphold the confidentiality, integrity, and availability of sensitive information.
62
11. Cost Estimation of the Project
Estimating the cost of developing a Food Delivery Chatbot project specifically in India
involves considering local rates for developers, infrastructure, and operational costs. Below is
a detailed cost estimation considering typical rates in India.
1. Development Costs
a. Personnel Costs:
Developers:
Assume:
Cost Calculation:
b. Project Management:
c. Design:
63
UI/UX Designer: ₹800/hr, 50 hours = ₹40,000
2. Infrastructure Costs
Web Server:
Database Server:
3. Operational Costs
Dialogflow:
64
Total Operational Costs: ₹7,500 + ₹9,000 = ₹16,500
4. Maintenance Costs
5. Miscellaneous Costs
a. Contingency Fund:
Summary of Costs
1. Development Costs:
Personnel: ₹380,000
Design: ₹40,000
5. Miscellaneous Costs:
Detailed Breakdown
65
Category Subcategory Estimated Cost (INR)
Design ₹40,000
Total ₹666,050
Conclusion
The total estimated cost for the Food Delivery Chatbot project developed in India is
approximately ₹666,050. This includes development, infrastructure, operational,
maintenance, and contingency expenses. Adjust these estimates based on actual hourly rates,
project scope, and specific service costs relevant to your project.
66
12. Future Enhancements
Future enhancements for the Food Delivery Chatbot project can significantly improve its
functionality, user experience, and scalability. Here are some potential enhancements:
Multi-language Support:
Voice Interaction:
Personalization:
Interactive UI:
3. Expanded Functionalities
Menu Customization:
67
Real-time Order Tracking:
Integrate real-time GPS tracking for delivery orders, providing users with live
updates on their order status and estimated delivery time.
Scalability:
Advanced Analytics:
Enhanced Security:
Integrate multiple payment gateways to provide users with more options for
secure and convenient payments.
Allow users to log in and share their experiences on social media platforms
directly from the chatbot interface.
68
Loyalty Programs:
Push Notifications:
Use push notifications to alert users about special deals, order status updates,
or new menu items.
Predictive Ordering:
Chatbot Training:
Continuously train the chatbot using new data to improve its responses and
accuracy over time.
8. Mobile Application
Develop a dedicated mobile application for iOS and Android, offering a more
seamless and integrated user experience compared to a web-based interface.
9. Customer Support
Implement a hybrid model where the chatbot can handle basic queries, and
complex issues can be escalated to human customer support agents available
24/7.
Feedback System:
Develop a robust feedback system within the chatbot to gather user feedback
and improve service quality.
69
10. Compliance and Accessibility
Regulatory Compliance:
Ensure that the chatbot and the entire system comply with local regulations
regarding data privacy, food safety, and online transactions.
Accessibility Features:
70
13. PERT Chart and Gantt chart
Requirement Analysis
System Design
Database Design
Frontend Development
Backend Development
Testing
Deployment
Documentation
71
Testing starts after Frontend, Backend, Chatbot, and Payment Integration.
72
73
14. Glossary
A chatbot is a conversational agent designed to interact with users via text or voice
commands. Dialogflow, a natural language understanding platform, is utilized to design and
integrate conversational interfaces into applications. In the context of this project, a
Medicine Delivery Chatbot is specifically tailored to assist users with ordering and managing
medicine deliveries. The system relies on a database, a structured collection of data, to store
and manage information related to medicines, users, orders, and other relevant entities.
Integration is crucial for the seamless operation of the chatbot, particularly with the website
where chatbot functionality is integrated to provide users with a conversational interface.
Natural Language Processing (NLP) techniques are employed to understand user intents,
extract important entities from user input, and fulfill user requests effectively. This fulfillment
process involves taking user input, processing it, and providing an appropriate response or
action. APIs and webhooks are used for communication and to enable custom callbacks for
specific actions. Authentication mechanisms, such as SSL/TLS encryption and HTTPS, ensure
secure communication and data exchange between the chatbot and other systems. Sessions
are maintained to preserve context and provide a personalized experience for users during
their interaction with the chatbot. User Interface (UI) and User Experience (UX) design
principles are applied to create an intuitive and user-friendly interface for the chatbot and
the integrated website. Analytics tools are employed to collect, measure, and analyze data,
enabling insights into usage patterns, user behavior, and performance metrics, which can be
used to optimize the chatbot's functionality and user experience over time.
74