Skip to content
This repository has been archived by the owner on Nov 26, 2019. It is now read-only.

Commit

Permalink
major update with several additions, changes and restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
Rene Springer committed Jan 24, 2019
1 parent 3263cd6 commit a5a0a88
Show file tree
Hide file tree
Showing 193 changed files with 26,123 additions and 9,887 deletions.
48 changes: 0 additions & 48 deletions CONTRIBUTING.md

This file was deleted.

19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:carbon

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm install --only=production

# Bundle app source
COPY . .
RUN npm run build
EXPOSE 3004
CMD [ "node", "dist/index.js" ]
7 changes: 0 additions & 7 deletions ISSUE.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 RecastAI
Copyright (c) 2019 SAP

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
126 changes: 76 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
![Bot Conector Logo](https://cdn.recast.ai/bot-connector/bot-connector-logo.png)
![Bot Connector Logo](https://cdn.cai.tools.sap/bot-connector/bot-connector-logo.png)

| [Supported Channels](#supported-channels) | [Getting Started](#getting-started) | [How it works](#how-it-works) | [Messages Formats](#messages-format) | [Getting Started with Recast.AI]( #getting-started-with-recastai) | [License](#license) |
|---|---|---|---|---|---|
| [Supported Channels](#supported-channels) | [Getting Started](#getting-started) | [How it works](#how-it-works) | [Messages Formats](#messages-format) | [Getting Started with SAP Conversational AI]( #getting-started-with-sap-conversational-ai) |
|---|---|---|---|---|

<div>
<a href="https://slack.recast.ai/">💬 Questions / Comments? Join the discussion on our community Slack channel!</a>
</div>
[💬 Questions / Comments? Join the discussion on our community Slack channel!](https://slack.cai.tools.sap)

# Bot Connector

Expand All @@ -15,47 +13,46 @@ It provides a higher level API to manage several messaging platforms at once, an

## Documentation

You can see the API documentation [here](https://recastai.github.io/bot-connector/)
You can see the API documentation [here](https://sapconversationalai.github.io/bot-connector/)

Or generate the documentation with the following command:
```bash
yarn doc && open doc/index.html
yarn docs && open docs/index.html
```

## Supported Channels

Bot Connector supports the following channels:
* [Kik](https://github.com/RecastAI/bot-connector/wiki/Channel---Kik)
* [Slack](https://github.com/RecastAI/bot-connector/wiki/Channel---Slack)
* [Messenger](https://github.com/RecastAI/bot-connector/wiki/Channel---Messenger)
* [Callr](https://github.com/RecastAI/bot-connector/wiki/Channel-CALLR)
* [Telegram](https://github.com/RecastAI/bot-connector/wiki/Channel-Telegram)
* [Twilio](https://github.com/RecastAI/bot-connector/wiki/Channel-Twilio)
* [Cisco Spark](https://github.com/RecastAI/bot-connector/wiki/Channel-Cisco)

* [Kik](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel---Kik)
* [Slack](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel---Slack)
* [Facebook Messenger](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel---Messenger)
* [Callr](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel-CALLR)
* [Telegram](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel-Telegram)
* [Twilio](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel-Twilio)
* [Cisco Webex](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel-Cisco)
* [Microsoft Bot Framework (Skype, Teams, Cortana,...)](https://github.com/RecastAI/bot-connector/wiki/Channel-Microsoft-Bot-Framework)
* [Twitter](https://github.com/RecastAI/bot-connector/wiki/Channel-Twitter)
* [Twitter](https://github.com/SAPConversationalAI/bot-connector/wiki/Channel-Twitter)
* Line

You can find more information on each channel in the [wiki](https://github.com/RecastAI/bot-connector/wiki)
You can find more information on each channel in the [wiki](https://github.com/SAPConversationalAI/bot-connector/wiki)

More will be added, and you can [contribute](https://github.com/RecastAI/bot-connector/blob/master/CONTRIBUTING.md) if you want to, and add a thumbs up for the channel you want to see implemented first ;)
More will be added, and you can contribute if you want to, and add a thumbs up for the channel you want to see implemented first ;)
(To do so, fork this repo, add a thumbs up and make a PR!)


* Discord 👍👍👍
* Line 👍
* Ryver 👍
* Viber
* Wechat 👍👍
* Zinc.it 👍
* Salesforce 👍

You can find the current roadmap [here](https://github.com/RecastAI/bot-connector/projects/1).

## Getting started

The following examples use [yarn](https://github.com/yarnpkg/yarn) package manager but you can use your favorite one like npm, or pnpm.

In order to run the connector you need MongoDB installed and running. The configuration files for MongoDB are stored in *config* directory.
In order to run the connector you need MongoDB and Redis installed and running. The configuration files for both are stored in *config* directory.

### Installation

Expand All @@ -67,10 +64,56 @@ cd bot-connector
yarn install
```

### Available Commands

* `yarn start` - Start application in production mode
* `yarn start:dev` - Start application in development mode
* `yarn start:dev:debug` - Start application in development mode with debugger
* `yarn test` - Run unit & integration tests
* `yarn test:debug` - Run unit & integration tests with debugger
* `yarn test:coverage` - Run unit & integration tests with coverage report
* `yarn lint` - Run ESLint
* `yarn build` - Build artifacts for production
* `yarn docs` - Generate apidoc documentation

#### Configurations/Environments

You need to create a configuration file based on the following schema:

config/{env}.js

```
module.exports = {
db: {
host: 'localhost',
port: 27017,
dbName: 'botconnector',
},
server: {
port: 8080,
},
redis: {
port: 6379,
host: 'localhost',
auth: '',
db: 7,
options: {}, // see https://github.com/mranney/node_redis#rediscreateclient
},
mail: {}, // valid object to be passed to nodemail.createTransport()
base_url: '', // base url of the connector
facebook_app_id: '',
facebook_app_secret: '',
facebook_app_webhook_token: '',
amazon_client_id: '', // Client ID for use with Login with Amazon (Amazon Alexa channel)
amazon_client_secret: '', // Client Id for use with Login with Amazon (Amazon Alexa channel)
}
```

#### Running in development mode (hot reload)

```bash
yarn start-dev
yarn start:dev
```

#### Setup your connector
Expand All @@ -87,13 +130,13 @@ yarn install
yarn start
```

Now that your bot (well, your code) and the Bot Connector are running, you have to create channels. Channel is the actual link between your connector and a specific service like Messenger, Slack or Kik. A connector can have multiple channels.
Now that your bot (well, your code) and the Bot Connector are running, you have to create channels. A channel is the actual link between your connector and a specific service like Messenger, Slack or Kik. One connector can have multiple channels.

## How it works

There are two distinct flows:
* your bot receive a message from a channel
* your bot send a message to a channel
* your bot receives a message from a channel
* your bot sends a message to a channel

This pipeline allows us to have an abstraction of messages independent of the platform and implement only a few functions for each messaging platform (input and output parsing).

Expand All @@ -105,7 +148,7 @@ The Bot Connector posts on your connector's endpoint each time a new message arr
* the message is saved in MongoDB
* the message is post to the connector endpoint

![BotConnector-Receive](https://cdn.recast.ai/bot-connector/flow-1.png)
![BotConnector-Receive](https://cdn.cai.tools.sap/bot-connector/flow-1.png)

#### Post a message

Expand All @@ -114,7 +157,7 @@ To send a new message, you have to post it to Bot Connector's API
* the messages are formatted by the corresponding service to match the channel's format
* the messages are sent by Bot Connector to the corresponding channel

![BotConnector-Sending](https://cdn.recast.ai/bot-connector/flow-2.png)
![BotConnector-Sending](https://cdn.cai.tools.sap/bot-connector/flow-2.png)

## Messages format

Expand Down Expand Up @@ -231,41 +274,24 @@ Bot Connector supports several message formats:
{
title: 'BUTTON_1_TITLE',
value: 'BUTTON_1_VALUE',
type: 'BUTTON_1_TYPE',
}
type: 'BUTTON_1_TYPE',
}
]
}
],
}
```

### Issue

If you encounter any issue, please follow this [guide](https://github.com/RecastAI/bot-connector/blob/master/ISSUE.md).

### Contribution

Want to contribute? Great! Please check this [guide](https://github.com/RecastAI/bot-connector/blob/master/CONTRIBUTING.md).

## Getting started with Recast.AI
## Getting started with SAP Conversational AI

We build products to help enterprises and developers have a better understanding of user inputs.

- **NLP API**: a unique API for text processing, and augmented training.
- **Bot Building Tools**: all you need to create smart bots powered by Recast.AI's NLP API. Design even the most complex conversation flow, use all rich messaging formats and connect to external APIs and services.
- **Bot Building Tools**: all you need to create smart bots powered by SAP Conversational AI's NLP API. Design even the most complex conversation flow, use all rich messaging formats and connect to external APIs and services.
- **Bot Connector API**: standardizes the messaging format across all channels, letting you connect your bots to any channel in minutes.

Learn more about:

| [API Documentation](https://recast.ai/docs/api-reference/) | [Discover the platform](https://recast.ai/docs/create-your-bot) | [First bot tutorial](https://recast.ai/blog/build-your-first-bot-with-recast-ai/) | [Advanced NodeJS tutorial](https://recast.ai/blog/nodejs-chatbot-movie-bot/) | [Advanced Python tutorial](https://recast.ai/blog/python-cryptobot/) |
| [API Documentation](https://cai.tools.sap/docs/api-reference/) | [Discover the platform](https://cai.tools.sap/docs/concepts/create-builder-bot) | [First bot tutorial](https://cai.tools.sap/blog/build-your-first-bot-with-recast-ai/) | [Advanced NodeJS tutorial](https://cai.tools.sap/blog/nodejs-chatbot-movie-bot/) | [Advanced Python tutorial](https://cai.tools.sap/blog/python-cryptobot/) |
|---|---|---|---|---|

### License

Copyright (c) [2016] [Recast.AI](https://recast.ai)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 changes: 0 additions & 12 deletions config/development.js

This file was deleted.

2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const env = process.env.NODE_ENV || 'development'

module.exports = require('./' + env + '.js')
module.exports = require(`./${env}.js`)
12 changes: 0 additions & 12 deletions config/production.js

This file was deleted.

16 changes: 14 additions & 2 deletions config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ module.exports = {
db: {
host: 'localhost',
port: 27017,
dbName: 'chatbot-connector-test',
dbName: 'gromit-test',
},
server: {
port: 8080,
port: 2424,
},
redis: {
port: 6379,
host: 'localhost',
auth: '',
db: 14,
options: {}, // see https://github.com/mranney/node_redis#rediscreateclient
},
base_url: 'http://localhost:2424',
skillsBuilderUrl: 'https://api.cai.tools.sap/build/v1/dialog',
facebook_app_id: '1234567890123456',
facebook_app_secret: 'abcewfnjrefu340bg3',
facebook_app_webhook_token: '',
}
11 changes: 0 additions & 11 deletions deploy.sh

This file was deleted.

Loading

0 comments on commit a5a0a88

Please sign in to comment.