If you are here, and reading these words, it means that you are either lost or want to play with our Order Bot. You probably want to know what it is and how to run it. You are lucky, I'm gonna explain that now.
Well, it's a bot right? According to Google a bot is an autonomous program on a network (especially the Internet) which can interact with systems or users. Well, our bot takes care of the food orders for the #cordoba channel on Slack. In the future, it might rule the order business and take care also of the other channels. Yes, we are that ambitious.
This script would:
- Create a new WebApp and AppService
- Use an existing Resource Group (if an existing one is passed) or create a new one (if a non existing name is passed)
- Create a Direct Line connection and it's config file
az deployment create --name "appName" --template-file "template-with-new-rg.json" --location "westus" --parameters appId="appid" appSecret="appsecret" botId="appName" botSku=S1 newAppServicePlanName="app-service-name" newWebAppName="appName" groupName="RG" groupLocation="westus" newAppServicePlanLocation="westus"
az webapp up -n webapp-name
az bot directline create --name appName --resource-group resourceGroup > "DirectLineConfig.json"
Running the bot and testing it is simple:
-
Clone the project
git clone https://github.com/southworks/order-bot.git
-
Install python, you can download it here (recommended version 3.7) https://www.python.org/downloads/
-
Make sure to run the following command to install the requested packages:
- pip install -r requirements.txt
-
Open the project (using PyCharm, VSCode or... Notepad++? Who am I to judge)
-
Go to a command line, go to the project directory and run
python app.py
. Check for common issues and how to solve them here -
The cmd should now say "Running on http://localhost:PORT", where PORT will be a number.
-
Copy that URL into the Emulator and add '/api/message' to the end -> http://localhost:PORT/api/message
- Done! Now you should have something like this:
Backlog organization
- Create new issues and assigned them to a project version and milestone.
- The version will be closed when the milestone is completed.
- If a bug is found on a specific version, it will be fixed on the next version as a priority issue. Also, it will be tagged as bug.
Branch organization
- Each version has a base branch, i.g: order-bot-vX.
- Each feature belongs to a branch, i.g: order-bot-vX-featureY.
- When a feature is finished, it merged on the base branch
- A version will be merged to master when is ready to be deployed.
- A base order is being read and written from a .json file.
- Some of the operations we can perform are "Add" and "Remove" an item from the order.
- The order is shown on an Adaptive Card dynamically created.
- It can recognize item quantities
- Recognize when the user wants to add or remove using a different unit. (2Kg Bananas -> 500 Gr Bananas")
- Add more unit tests.
- Test whole conversations.
- Be able to make several operations in one line.
- Maintain the real number of orders.
- Write on an email template the final order when it's confirmed.
- Add concurrency when several users are editing the same order.
- Consider an alternative to Adaptive Card, due to it's not supported on Slack.