ONLINE FOOD ORDERS THROUGH WHATSAPP AUTOMATION BOT
Rimmalapudi Rajesh
Student, Department of Computer Science and Engineering(AI &ML), Vasireddy Venkatadri Institute of Technology, Guntur-522508, Andhra Pradesh, India.
Abstract – Duetorapidtechnologicalgrowth,automation botsarewidelyusedtoincreaseproductsales.Mostpeople areusingfooddeliveryappslikeSwiggy,Zomato,etc., but those apps have some drawbacks. To overcome the drawbacks. I have developed a new solution for food deliverythroughWhatsAppAutomationBot.ThisWhatsApp AutomationBotissimplyusedtoorderfoodfromfamous Restaurants in a city. Mainly it is beneficial to unlettered people because we know that it is not easy to order food fromZomatoorSwiggyetcforthem.Nowadaysmostpeople arefamiliarwithWhatsApp.So,theycaneasilyplaceorders throughWhatsApp.
Key Words: Automation, unlettered, Swiggy, Zomato, Bot
1 INTRODUCTION
WhatisaWhatsAppbot?
A WhatsApp chatbot is a computer program designed to automatically answer customer questions about your productsandservices,sharecontent,andsendnotifications regarding orders, payments, and shipping on WhatsApp [5].ButwiththisWhatsAppautomationbot,wecanplacean order through WhatsApp. Nowadays many members are familiarwithWhatsApp[1].So,theycaneasilyplaceorders throughWhatsApp[6].IusedTwilioformessagehandling APIandMongoDBfordatabasemanagement
I developed a WhatsApp Automation Bot using pythonandTwilioapartfromsendingmessageswillalsouse MongoDB to store messages in a database. For this, we createdarelativelyadvancedmultistepWhatsAppchatbot [2].Inthisprojectalltheservicesthatweusearehosting, database,andmessagingservicesallofthesearecompletely freeforcertainlimitedconditions.
WhyWhatsApp?
WhatsApp is the most popular messaging tool and it has around1.6billion+users,alsothethirdmostpopularsocial mediaplatformwith2billion+users.It’soperationalinover 180countriesand60languages.It’ssecure,fast,simple,and intuitive [8]. It helps people connect with friends and families across the globe, anytime. It’s personalized and moreintimatethanothersocialmedianetworks.Itprotects
***
theprivacyofconsumersthus,facilitatingtrust. It’sfreefor usersanddoesn’tneedatechnicalsetup.Thereareveryfew messagingapplicationslikeWhatsApp,andnewerplatforms aren’taseffectiveorfar-reaching
2. SOFTWARE AND ARCHITECTURE
InthisWhatsAppAutomationBot,Iusedwebsoftware.The software consists of carefully-organized instructions and codes written by programmers for different computer languages.Now,letusseeinadiagrammaticwayhowthis WhatsAppchatbotworks.
Inthis,aclientsendsarequesttotheserver through Twilio and the server sends the response to the ClientthroughTwilioandthedatabaseactsasastoredand retrieverofthedata.
2.1 TWILIO
TwilioisamessagingAPIforSMS,MMS,andOTTmessages operating a global network. It uses intelligent sending featurestoensuremessagesreachenduserswhereverthey areTwiliohasSMS-enabledphonenumbersavailableinmore than180countries.Forthefreeaccount,Twiliogivessome numberorifyouwantthespecificnumbertopayforit[7]. TheWhatsAppmessagesweresenttothatnumber.Twiliois a single platform with flexibleAPIsforanychannel,built-in intelligence,andglobalinfrastructuretosupportyouatscale. Twiliousesthepowerofthecloudtoconnectyouwithyour supporters, beneficiaries,andvolunteers, anywherein the world[3].ThisisthelinkbelowforhowsetuptheTwilio: https://github.com/RimmalapudiRajesh/Food-Deliverythrough-whatsapp.git
2.2 MONGODB
MongoDBisanopen-sourceNoSQLdatabasemanagement program. NoSQL is used as an alternative to traditional relationaldatabases.NoSQLdatabasesarequiteusefulfor working with large sets of distributed data. MongoDB is a toolthatcanmanagedocument-orientedinformation,and storeorretrieveinformation.Itisadocumentdatabasewith the scalability and flexibility you want with the necessary queryingandindexing.Itenablesyoutostoreunstructured dataandprovidesfullindexingsupportandreplicationwith richandintuitiveAPIs[4].
2.2.1 CONFIGURING THE MONGODB
InMongoDB,IcreatedadatabasenamedRestaurantwitha collectionofordersandusersinit.Inthe“orderscollection”, thedatathatisrequiredbytheRestaurantownerlikephone numbers, items, bills… etc is present, and in the “users collection”,themessagesthataresentbycustomersthrough WhatsApparepresent.
ThisisthelinkbelowhowtoconfiguretheMongoDB: https://github.com/RimmalapudiRajesh/Food-Deliverythrough-whatsapp.git
3 INSTALL THE REQUIREMENTS
Install python from google. Also, install the pycharm community version from google. Install the NPM (Node PackageManager).Thiscomesbundledwithnode.js(node.js isusedinjavascriptruntimeforthegeneraltodevelopthe backend applications) and after the installation process check in the command prompt whether the node.js is installedornot.Nowwealsoinstallthenpmpackageslike nodemon(whichhelpsustorestarttheserverincasewedo any changes to it) and localtunnel (It makes your server accessibleonline).Forthistypeofcommandpromptas npminstall-gnodemonlocaltunnelwhere-gdeterminesto installthepackagesglobally.Also,installthepythonpackage likeaflask,twilio,pymongo,anddnspython.Forthistypeof command prompt as pip install flask twilio pymongo dnspython
3.1 SOFTWARE TOOLS
Therequirementstodeveloptheprojectare:
flask: Thisisusedtocreateawebserver
twilio: WhichisamessagingAPI(ApplicationProgramming Interface)
pymongo: Thisisusedtointeractwiththedatabase
dnspython: whichisTwiliodependencyonthisparticular package
4 FLOW CHART
This is the flowchart of how the steps are constructed to implementtheWhatsAppAutomationBotforFoodDelivery
5
ThisisthesourcecodetobuildaWhatsAppAutomationBot forfooddelivery.
https://github.com/RimmalapudiRajesh/automate-whatsapp
5.1 EXECUTION OF THE SOURCE CODE INPYCHARM
ToexecutethesourcecodeinPycharmfollowthesestepsin theterminal:
(1) Firstly,dividetheterminalintotwoparts.Inthefirst parttype“nodemonfilename”andthenpressenter
(2) Inthesecondparttypeasnodemon watch“filename” exec“lt–subdomainYOURSUBDOMAIN–port5000”–delay 2here,
nodemon: used to restart the server when we do any changestoit.
watch: usedtowatchthechangesifwedoanychangesin thesourcecode.
filename:Enterafilename.
--exec: usedtoexecutethechangeswemadeinthesource code.
lt (localtunnel): Wheneverwecreateaserverinthesystem itstayslocaltoyourIPaddress.Theoutsidersofthepeople can’t access the server. what the local tunnel does is it assigns you a website URL and when the website URL is queried. It proxies all the requests to the local server. In otherwords,itkindofmakestheserversaccessibleonline.
subdomain: usedforsub-domain.
YOURSUBDOMAIN:entertheuniquesubdomainherelike mango-2006-apple…etcwhichgetsthespecificURL.Make surethatitmustbeunique
delay 2: which helps us to the gap between the server restarting. If we don’t give any gap between the server restarting the local tunnel assume that the subdomain is already taken and will assign some random subdomain which is not what we want. In this, I gave 2 seconds gap betweentheserverrestarting
6 RESULT AND DISCUSSION
InWhatsAppthechatbetweenthecustomerandWhatsApp botasinfig6.1.1:
TheinformationthatisneededbytheRestaurantowner, likephonenumber,items,bills…etc. asshowninfig.6.1.2, aredisplayedonthe“orderscollection”ofMongoDB,andthe remaininginformationlikeoptionsselectedbytheusers,is storedinthe“userscollection”.
This is how the restaurant owner sees the only needed informationtodeliverthefoodtothataddress
7
CONCLUSION
After the successfully executed then deploy this project in Heroku. This paper presents how to make a food order throughWhatsAppAutomationBot.Isuccessfullydeveloped and implemented the software to order food from Restaurants.Thismodelwasdevelopedandimplementedata low cost and very cheap offering to all kinds of people becauseitstoresthedatainadatabase.Inthefuture,Bothas gooddevelopmenttoincreasesalesproductioninanysector. Maintenancecoststilldecreasebyhostingthisapplication’s dataonthecloud
REFERENCES
[1] Roberta Roberta De Cicco, Susana Cristina Lima da CostaeSilva&FrancescaRomanaAlparone(2021)“It’son itsway”:Chatbotsappliedforonlinefooddelivery services, social or task-oriented interaction style,Journal of FoodserviceBusinessResearch,24:2,140-164 DOI:10.1080/15378020.2020.1826268
[2] Rajendiran Anbumathi, Sriram Dorai and Umaya Palaniappan, Evaluating the role of technology and nontechnologyfactorininfluencingbrandloveinOnlineFood Deliveryservices.vol71,2023,103181.
[3] Sujana A S, D R Ramesh Babu, S Venkatesan, Twilio Integration with Dialogflow for Effective Communication. JournalofWebDevelopmentandWebDesigningpoweredby MATjournal,vol4,issue2,2019
https://core.ac.uk/download/pdf/230494953.pdf
[4] Kyle Banker, Douglas Garrett, Petter Bakkum, Tim HawkinsandShaunVerchwroteabookaboutthecomplete details of MongoDB Version 3.0 published by manning publications,2016
[5] DariusZumsteinandSophieHundertmark,ChatbotsTechnologyforPersonalizedCommunication, Transactions, and services on IADIS International Journal on WWW/Internet.2017,vol 15,96-109.
[6] Verloop.io,WhatsAppforRestaurants101: WhatsApp
FoodOrderingSystemaccessedonOct 2022
https://verloop.io/blog/whatsapp-business-restaurants/
[7] TwilioProgrammableAPIforWhatsApp
https://www.twilio.com/docs/whatsapp
BIOGRAPHY
1 Rimmlapudi Rajesh
[8] https://www.digitaltrends.com/mobile/what-is- whatsapp/ Studying in BTech 3rd year, DepartmentofComputerScience and Engineering (AI& ML), VasireddyVenkatadriInstituteof Technology, My interests are ArtificialIntelligentandMachine Learning.