Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cdimascio/nationalparks_conversation

Chatbots and Watson: Let’s talk about national parks: course source code
https://github.com/cdimascio/nationalparks_conversation

bluemix tutorial watson watson-conversation watson-conversation-service

Last synced: about 2 months ago
JSON representation

Chatbots and Watson: Let’s talk about national parks: course source code

Awesome Lists containing this project

README

        

# nationalparks-conversation

**Chatbots and Watson**: Let’s talk about national parks: course source code

The chatbot uses [Watson Conversation](https://console.bluemix.net/catalog/services/conversation?env_id=ibm:yp:us-south&taxonomyNavigation=services), [Weather Company Data](https://console.bluemix.net/catalog/services/weather-company-data?env_id=ibm:yp:us-south&taxonomyNavigation=services), [React](https://facebook.github.io/react/), [Nodejs](https://nodejs.org/en/), and [IBM Cloud](https://www.bluemix.net) to create a chatbot about National Parks.

The complete course content and videos lives [here](https://developer.ibm.com/courses/all-courses/chatbots-and-watson-lets-talk-about-national-parks/)

Try the live demo [here](https://nationalparks.mybluemix.net/)

Ask:
- which parks can you talk about
- Tell me about zion
- What animals live there
- What's the weather like
- What animals live at Denali National Park
- What's the weather like there

## A glimpse

![](https://github.com/cdimascio/nationalparks_conversation/raw/master/.assets/sshot.png)

## Prequisities

1. Clone this repo
2. Create an IBM Cloud account

## Setup

### Conversation

- Provision an instance of [Watson Conversation](https://console.bluemix.net/catalog/services/conversation?env_id=ibm:yp:us-south&taxonomyNavigation=services) on IBM Cloud
- Create a new conversation workspace by importing `./resources/conversation_workspace.json` into your Watson Conversation workspaces,
- Install client and server dependencies
- Create `.env` files in the project root with the following contents

```
APP_ID=parks-conversation
PORT=3004
LOG_LEVEL=debug
SESSION_SECRET=test

WATSON_CONVERSATION_API_ROOT=https://gateway.watsonplatform.net/conversation/api
WATSON_CONVERSATION_VERSION=v1
WATSON_CONVERSATION_VERSION_DATE=2016-07-11
WATSON_CONVERSATION_USERNAME=
WATSON_CONVERSATION_PASSWORD=
WATSON_CONVERSATION_WORKSPACE_ID=
```

### Server

Install server dependencies

```shell
npm install
```

### Client

Install client dependencies

```shell
cd client
npm install
```

## Build / Run (Development)
- Start the server `npm start`
- Start the client `cd client && npm start`
- Navigate to http://localhost:3000

## Build / Run (Production)

```shell
cd client
npm run build
cd ..
npm start
```
Navigate to [http://localhost:3000](http://localhost:3000)

## Deploy to IBM Cloud

#### Prequisites:
- Install CloudFoundry Tools

#### Deploy
Follow the first 3 steps in the "Build / Run (Production)" section above, then run.

```shell
cf push USER_ID-nationalparks
```
Navigate to [https://USER_ID-nationalparks.mybluemix.net](https://USER_ID-nationalparks.mybluemix.net)

## FAQ

**Q:** In Lab 5: "[Programmatically interact with Watson Conversation](https://developer.ibm.com/courses/all/chatbots-watson-lets-talk-national-parks/?course=begin#3990)", I get an authentication error. What do I do?

**A:**
This occurs on Windows. Windows sets the `USERNAME` variable to the logged in OS user. Ultimately, it ends up overriding the value for `USERNAME` specified in `.env`. The problem can be solved in two ways:

- on step 3., hard code the `USERNAME` and `PASSWORD`
e.g.

```javascript
const conversation = new ConversationV1({
username: 'your-username',
password: 'your-password',
version_date: ConversationV1.VERSION_DATE_2016_09_20
});
```
**or**
- Rename the `USERNAME` env
- Edit `.env`, change `USERNAME` to `NP_USERNAME`
- in step 3., change `USERNAME` to `NP_USERNAME`