Giter Club home page Giter Club logo

nodejsbot's Introduction

TheBot

nodejsbot Quick Start

GitHub Site

Pre-requisites

  1. Node.js v4.3.0 or later. Download
  2. Serverless CLI v1.9.0 or later. You can run npm install -g serverless to install it once node is installed
  3. An AWS account. If you don't already have one, you can sign up for a free trial that includes 1 million free Lambda requests per month.
  4. Set-up your CredentialsAWS Docs. Watch the video on setting up credentials Serverless

Create a new chatbot using LEX and Lambda Screens provided by AWS (e.g. Creating OrderFlowers Bot)

  1. Go to Lex console and select OrderFlowers as bot
  2. Create a Lambda function by going to Lambda Console and using filter Lex and selecting OrderFlowerLex nodejs blueprint
  3. Specify respective roles etc and test Lambda function using Lex Flower bot test event
  4. Go to LEX console select OrderFlower bot and attach the Lambda Function to Initialization and validation code hook and confirmation
  5. Build the bot and publish it by providing an alias name

How to call the FlowerBot from your machine

  1. There is a folder node_http
  2. Got to folder make sure you have node installed
  3. Open app.js in your machine set your AWS access key, password and specify Bot Parameters like botName, alias etc in script.
  4. Type node server when you are in the folder and it will have a web server running at http://localhost:3000
  5. Make sure you never checkin changes with your AWS access key and ID
  6. Try your utterances from the UI screen

In case you want to deploy lambda function from your desktop instead of using AWS templates (use below instructions)

Create a new service using the Node.js template, specifying a unique name and an optional path for your service.

# Create a new Serverless Service/Project
$ serverless create --template aws-nodejs --path nodejsbot
# Change into the newly created directory
$ cd nodejsbot
# Replace handler.js and serverless.yml by the files provided in repo
File replaced by repo version

Deploy, test and diagnose your service

  1. Deploy the Service
serverless deploy -v
  1. Go to AWS console create a LEX Bot using Lex FlowerBot template

  2. Attach the Lambda function created with the Bot

  3. Test the chatbot and refer Cloudwatch logs

Cleanup

If at any point, you no longer need your service, you can run the following command to remove the Functions, Events and Resources that were created, and ensure that you don't incur any unexpected charges.

serverless remove

nodejsbot's People

Contributors

ratewar avatar

Stargazers

 avatar Marcus R. Brown avatar Ian H avatar Richard Moore avatar Martin Petercak avatar Richard Clayton avatar Wojciech avatar Ben Swinburne avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.