/SGSupermarketChatbot

SG Supermarket Chatbot built using Microsoft Bot Framework

Primary LanguageJavaScript

SG Supermarket Chatbot

SG Supermarket bot allow users to easily access SG Supermarket promotions through this bot. Banner

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See Wiki for more details on how to deploy the project on a live system and other sample codes.

Architecture Diagram

Here is how the different services are used and connected in my solution. Architecture diagram

  1. The developer creates the chatbot using Microsoft Bot Framework (Bot Builder SDK) and deploy the code into GitHub for version control.
  2. Azure Cloud Services is used to host the Chatbot. An Azure Web App is created to provide the endpoint for the web service that will be used to point at to access the chatbot and connect to Bot Service for publication of the Chatbot to other channels (Facebook Messenger in particular for SG Supermarket Chatbot). It get access to the codes via GitHub repository. Language Understanding Intelligent Service (LUIS) is used and connected to the Web App to bring intelligence to the chatbot to behave just like like human.
  3. Having published the application to the platform, end-users can then interact with the chatbot

Prerequisites:

  1. Install NodeJS - Programming Language used for SG Supermarket
  2. Install Visual Studio Code* - You may use this code editor to edit your codes
  3. Install Git - Git for version control of your codes
  4. Install Bot Framework Emulator - For Local testing of the chatbot before deployment
  5. Azure Subscription - Required to publish the chatbot for public usage in the various platform (e.g. embed in webpage, Facebook Messenger, Telegram, Slack, etc.)

Local Deployment:

Steps

  1. Clone the repo
  2. Run the application
  3. Test the application

Clone the repo

  1. Clone the SGSupermarketChatbot locally. In a terminal, run:
$ git clone https://github.com/chialiyun/SGSupermarketChatbot.git
  1. Change the directory in SGSupermarketChatbot
$ cd SGSupermarketChatbot
  1. Install all required packages
$ npm install

Run the application

  1. In the same terminal, run:
$ node index.js

This should show you:

$ restify listening to http://[::]:3978

Test the application

  1. Launch the Microsoft Bot Framework Emulator. You can read more about it here

  2. Create a new bot configuration Bot configuration is a file that keeps your settings that reaches out to your chatbot. Just by doing this step, you no longer have to always type your end point.

    1. Click on 'create a new bot configuration' in the Welcome page or File -> New Bot Configuration. 1. create bot configuration.png
    2. Fill in the required fields and click save and connect: Currently, for a local chatbot we only need to fill in:
      1. Bot Name (Give it any name that will be easy for you to identify next time)
      2. End Point URL ("http://localhost:3978/api/messages") As we are building the chatbot locally, our endpoint now will be pointing to the localhost (our computer) 2. Fill in the configuration.png
    3. Start Testing 3. start testing.png

Built With

  • Microsoft Bot Builder SDK

Additional Reference Links

  1. Microsoft Bot Framework
  2. Bot Samples for NodeJS

License

SG Supermarket by Chia is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.