Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 2.85 KB

TUTORIAL.md

File metadata and controls

51 lines (36 loc) · 2.85 KB

Tutorial

This tutorial will cover how to deploy your own version of EZNet.

Creating the dialogflow agent

You can either click the button below, which will automatically create an agent for you or create it yourself and import the dialogflow-assets.zip file.

EZNet

Creating the various integrations

By default, all 4 integrations are enabled for the bot. If you want to disable some integrations, simply set the corresponding environmental variables by running npm run env.

Deploying the bot

Locally

You can run it locally, and still expose it to the internet for Dialogflow to use, via ngrok.

git clone https://github.com/tejashah88/eznet.git # clone this repo
cd eznet
npm run env  # configure your environmental variable

Open one terminal and run npm run ngrok. This will export port 8080 to the internet. Copy the HTTPS version of the generated url for the fulfillment webhook URL. In this case, it should be https://<random-id>.ngrok.io/chat. Then open another terminal to run npm run redis. Redis is used for caching Meraki Dashboard API requests. Finally, open a third terminal to run the server: npm start.

Heroku

Simply click the button, fill the required environmental variables and you're done! The fulfillment webhook URL should be https://<app-name>.herokuapp.com/chat, where <app-name> is what you named the Heroku app.

Deploy to Heroku

Docker

git clone https://github.com/tejashah88/eznet.git # clone this repo
cd eznet
npm run env  # configure your environmental variable
npm run docker # start via docker

This will auto-configure docker to launch a redis server along with this server, while allowing communication between the 2 containers.

When you are done, you can clean the docker resources generated by running npm run clean-docker.

The fulfillment webhook URL should be https://<some-random-url>/chat:8080. You can also still use ngrok on another terminal if you are deploying locally.

Linking the bot server to Dialogflow

In Dialogflow, go to the "Fulfillent" section and enable it. You need to update the fulfillment url in Dialogflow in order for the bot to actually process messages. Depending on how you configured your bot, it should be HTTPS and have "/chat" at the end of the url.