Skip to content

Latest commit

 

History

History
executable file
·
172 lines (106 loc) · 6.25 KB

README.md

File metadata and controls

executable file
·
172 lines (106 loc) · 6.25 KB

Cloud Insurance Co. - Main web site and chat bot

master Build Status
dev Build Status

This repository is part of the larger Cloud Insurance Co. project.

Overview

Policy Bot

In order to deploy the full set of microservices involved, check out the insurance-toolchain repo. Otherwise, you can deploy just the app by following the steps here.

Running the app on Bluemix

  1. If you do not already have a Bluemix account, sign up here

  2. Download and install the Cloud Foundry CLI tool

  3. The app depends on the Catalog and Orders microservices. Make sure to deploy them first.

  4. Clone the app to your local environment from your terminal using the following command:

git clone https://github.com/IBM-Bluemix/insurance-bot.git
  1. cd into this newly created directory

  2. Open the manifest.yml file and change the host value to something unique.

The host you choose will determinate the subdomain of your application's URL: <host>.mybluemix.net

  1. Connect to Bluemix in the command line tool and follow the prompts to log in
cf login -a https://api.ng.bluemix.net
  1. Create a Compose for MongoDB service in Bluemix
cf create-service compose-for-mongodb Standard insurance-bot-db
  1. Create a Conversation service in Bluemix
cf create-service conversation standard insurance-bot-conversation
  1. Push the app to Bluemix
cf push --no-start
  1. Define a variable pointing to the Catalog API deployment.
cf set-env insurance-bot CATALOG_URL https://your-insurance-catalog.mybluemix.net
  1. Define a variable pointing to the Orders API deployment.
cf set-env insurance-bot ORDERS_URL https://your-insurance-orders.mybluemix.net
  1. Define the Watson Conversation workspace ID to use. Refer to this step to get a workspace id.
cf set-env insurance-bot CONVERSATION_WORKSPACE <your-workspace-id>
  1. Start your app
cf start insurance-bot

And voila! You now have your very own instance of the app running on Bluemix.

Run the app locally

  1. If you do not already have a Bluemix account, sign up here

  2. If you have not already, download Node.js and install it on your local machine.

  3. The app depends on the Catalog and Orders microservices. Make sure to have them running first.

  4. Create a Compose for MongoDB service in Bluemix

cf create-service compose-for-mongodb Standard insurance-bot-db
  1. Create a Conversation service in Bluemix
cf create-service conversation standard insurance-bot-conversation
  1. In the checkout directory, copy the file vcap-local.template.json to vcap-local.json. Edit vcap-local.json and update the credentials for the MongoDB and Conversation services. You can retrieve the service credentials from the Bluemix console.
cp vcap-local.template.json vcap-local.json
  1. In the checkout directory, copy the file .template.env to .env. Edit .env and update the credentials for the MongoDB and Conversation services. Refer to this step to get a workspace id.
cp .template.env .env
  1. Run
npm install
  1. Run
npm start

Importing the conversation workspace into your Watson Conversation service

⚠️ Whether you have deployed the application with the toolchain, or manually or even running locally, you will need to initialize the Watson Conversation service with the conversation model before you can interact with the chat bot.

  1. Go to the Watson Conversation service in Bluemix.

  2. Launch the Watson Conversation tool.

  3. Select the option to import a workspace from a JSON file.

  4. Select the most recent file from the conversation folders.

  5. Once you have imported the workspace, retrieve the workspace ID by using the View Details option

  • If you are using the toolchain, edit the DEPLOY step of bot (dev) and bot (prod) pipelines and set the value of the CONVERSATION_WORKSPACE environment variable to the workspace ID;

  • If you are running the app on Bluemix, define a CONVERSATION_WORKSPACE environment variable with the workspace ID;

  • If you are running the app locally, edit the .env file and set the value of the CONVERSATION_WORKSPACE variable to the workspace ID.

Contribute

If you find a bug, please report it via the Issues section or even better, fork the project and submit a pull request with your fix! We are more than happy to accept external contributions to this project if they address something noted in an existing issue. In order to be considered, pull requests must pass the initial Travis CI build and/or add substantial value to the sample application.

Troubleshooting

The primary source of debugging information for your Bluemix app is the logs. To see them, run the following command using the Cloud Foundry CLI:

$ cf logs insurance-bot --recent

For more detailed information on troubleshooting your application, see the Troubleshooting section in the Bluemix documentation.

License

See License.txt for license information.