Skip to content

Is a chat/voice bot 🤖 for Booking at restaurants 🍽️ ready for the "New normality" ✔️

License

Notifications You must be signed in to change notification settings

udsgit/reservation-covid-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reservation Covid Bot

Is a chat/voice bot 🤖 for Booking at restaurants 🍽️ ready for the "New normality" ✔️

Table of contents

General info

Date: May, 2020
Duration: 1 Month.
Team members: @Emmanuel, @Fernando and @Omar.

This project has been the result of the FCT practices that we have carried out remotely 👨‍💻 in ATOS and it has been quite a challenge, since it has been a project started from scratch in new technologies for us (Node, Firebase, DialogFlow, etc) and with carte blanche in practically everything, since the only rule was to use the technologies discussed above and meet the deadlines for the bot.

The most important thing about the bot is that it is completely autonomous and that in addition to taking into account the basic things of the reservations, it also contemplates those added by the "new normal", so when you make a reservation, the bot will take into account its own schedule in case it is closed at that time, its capacity limitation both inside and outside (including extra limitation depending on the phase it is in), maximum number of people per groups and other things. Although the most important thing is that in case the indicated date was already reserved, it will automatically offer you similar options to continue with the "Happy Path" and make your reservation.

Demo

Unfortunately, right now we don't have an interactive demo that can be tested, since to avoid expenses we have deactivated the project in Firebase and DialogFlow, but if you follow the steps of the Setup you can assemble it yourself and test it.

But we do have visual content of the project working so you can see the functionalities that it has.


Demo

You can download the full video with sound from this Link

Screenshots


Bot query examples

Technologies

Setup

There are 2 types of installations, the one of the developer mode (recommended) to have the local webhook with testing/debug and the other is for when the project is in production deployed in firebase

Developer mode (local webhook)

  1. Clone/Download the repository.
git clone https://github.com/udsgit/reservation-covid-bot.git
  1. Move to the functions folder.
cd functions
  1. Install the packages.
npm install
  1. Edit the files at "/functions/credentials" and change it for your Google Calendar credentials (owner) and Firebase (admin) (For this step you will add 2 new credentials account at Google Cloud).

  2. Init the local server.

npm run dev
  1. Open another console and move again to the function folder.
npm run tunnel
  1. The previous command will provide us with an HTTPS link from our local server already deployed and valid for 8 hours (In case the time expires, restart the command again) *Remember that the link is different with each restart.

  2. Copy the HTTPS link, enter the DialogFlow website, import the file "agent.zip" from the repository.

  3. And in the Fulfillment tab paste the link and add "/dialogflow" like the following example.

https://9cbb5915b7e7.ngrok.io/dialogflow
  1. Now you just need to create the database at Firebase Realtime Database (locally or not) and import the file firebase-database.json. *Important, you must add the calendar Id in the JSON file of the db.

  2. Finally now you can test it.

Production Mode (webhook @firebase functions)

  1. After first having the service running locally following the previous steps, you only have to change small things to move it to production.

  2. Open console window and move to "/" out of the functions folder.

  3. Init Firebase.

firebase init
  1. And we answer the following questions

    • Are you ready to proceed? => Yes
    • Which Firebase CLI features do you want to setup for this folder? => Select database and functions
    • Select the project => We select the previously created project when we have imported the agent at dialogflow
    • Optionally you can choose to work with JavaScript/TypeScript with ESLint, etc. (If you don't know what I mean, just choose javascript)
    • If ask for rewrite => No.
    • Install dependencies with npm => Yes.
  2. Ready, now you can use the following command for deploy

firebase deploy
  1. The deployment may take more than 1 minute and when it is finished, you can already enter the Firebase website in the functions tab and copy the HTTPS url and paste it in the Fulfillment tab of Dialogflow replacing the previous one and adding "/dialogflow" to the end like the following example.
https://us-central1-projectName.cloudfunctions.net/app/dialogflow
  1. Obviously then you can change the Firebase server so that it is not so far from where the product is used.

  2. And ready, now in a simple way through commands you can pass the local webhook to the cloud without changing part of the node and express code.

Usage

  1. For test the bot, if you was followed the previously steps you can now test it at Dialogflow console.
  2. Other options to test it, is that if in the integrations tab you have enabled the deployment on other platforms such as Telegram, Messenger, etc. Then you can test it on these platforms as long as you have been able to configure it correctly.
  3. The "Code" for access when you are talking with the bot is "atos".

Status

Project is: Completed.

Because it was a project with an end date and it has served to better understand these technologies. In case a similar project is followed, it would be good to take it into account but it would be better to start a more orderly and clean project from scratch, since tests and clean code could not be added (both due to lack of knowledge and time).

Contact

Created by

Feel free to contact us if you need it.

About

Is a chat/voice bot 🤖 for Booking at restaurants 🍽️ ready for the "New normality" ✔️

Topics

Resources

License

Stars

Watchers

Forks