Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick Installation Guide #2

Open
cama opened this issue Feb 20, 2017 · 14 comments
Open

Quick Installation Guide #2

cama opened this issue Feb 20, 2017 · 14 comments

Comments

@cama
Copy link
Collaborator

cama commented Feb 20, 2017

Quick and dirty installation guide on how to get started with Botstackjs.

https://github.com/cama/botstackjs/blob/master/README.md#installation

@cama cama assigned cama and webus Feb 20, 2017
@Danail-Irinkov
Copy link

Danail-Irinkov commented Feb 22, 2017

Hello cama,

What could be the reasons this error after launching index.js, .env - ok, modules - ok

Terminal =
' file: 'util.js',
function: 'exports._exceptionWithHostPort',
line: 1045,
method: '_exceptionWithHostPort',
native: false },
{ column: 14,
file: 'net.js',
function: 'TCPConnectWrap.afterConnect [as oncomplete]',
line: 1087,
method: 'afterConnect [as oncomplete]',
native: false } ],
stack:
[ 'Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379',
' at Object.exports._errnoException (util.js:1022:11)',
' at exports._exceptionWithHostPort (util.js:1045:20)',
' at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)' ] }'

Debugger =
`2017-02-22T11:45:02.876Z - error: uncaughtException: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
{ date: 'Wed Feb 22 2017 13:45:02 GMT+0200 (FLE Standard Time)',
process:
{ pid: 7616,
uid: null,
gid: null,
cwd: 'c:\FB_Cust_Automation',
execPath: 'C:\Program Files\nodejs\node.exe',
version: 'v6.9.5',
argv:
[ 'C:\Program Files\nodejs\node.exe',
'c:\FB_Cust_Automation\index.js' ],
memoryUsage: { rss: 132177920, heapTotal: 103837696, heapUsed: 57976824 } },
os: { loadavg: [ 0, 0, 0 ], uptime: 12182.0241738 },
trace:
[ { column: 11,
file: 'util.js',
function: 'Object.exports._errnoException',
line: 1022,

@Danail-Irinkov
Copy link

Danail-Irinkov commented Feb 22, 2017

I am running VS code on windows 10, node.js, git for windows and modules - latest versions

express.listen(80) is creating a server normally btw

What do I need to configure on the AWS system, except bucket name?

@webus
Copy link
Collaborator

webus commented Feb 22, 2017

Hello, @Danail-Irinkov .

Yet BotStackJS depends on Redis. In the future we will make this dependency optional.

So now you need to start Redis to solve this issue.

@Danail-Irinkov
Copy link

Thank you very much, I am trying to use virtual box to start redis server in ubuntu :)

@cama
Copy link
Collaborator Author

cama commented Feb 22, 2017

Thanks Danail for giving Botstackjs a go. Let me know if you have any more challenges getting it working. I've created an issue to make REDIS optional and use MongoDb for Sessions. It will simplify deployment and meet most use cases.
#3

@cama
Copy link
Collaborator Author

cama commented Feb 22, 2017

@Danail-Irinkov Would a demo repo that extends BotstackJS be useful?

#4

We could possible stand up a shared mongoDB\REdis instance so all you have to do is deploy the code to a Heroku instance, update a few env variables like API.AI and be up and running.

Cam

@Danail-Irinkov
Copy link

Danail-Irinkov commented Feb 23, 2017 via email

@Danail-Irinkov
Copy link

Danail-Irinkov commented Feb 26, 2017 via email

@webus
Copy link
Collaborator

webus commented Feb 27, 2017

Hi @Danail-Irinkov . Yes, you can override class method textMessage or / and postbackMessage and add your custom behaviour.

@Danail-Irinkov
Copy link

Danail-Irinkov commented Feb 27, 2017 via email

@cama
Copy link
Collaborator Author

cama commented Feb 27, 2017

Hi Dan

Here is the updated list of what's in and out why we to use and whether you need them:

In

S3 [optional] - scalable storage for media like images and video
REDIS - scalable in memory cache for storing session state. It's in the backlog to make this optional and by default use Mongodb for session state
API.AI - Natural Language Programming
DASHBOT [optional] - Third party analytics and broadcast platform
Botmetrics [optional] - Third party analytic platform. Less features than Dashbot but has a useful bot for checking metrics.

Out

Dynamos - Removed. Using Mongodb

Hope this helps.

Cam

@Danail-Irinkov
Copy link

Danail-Irinkov commented Feb 28, 2017 via email

@webus
Copy link
Collaborator

webus commented Mar 1, 2017

Hi @Danail-Irinkov

  1. fallback(message, senderID) {
    log.debug("Unknown message", {
    module: "botstack:fallback",
    senderId: senderID,
    message: message
    });
    //fb.reply(fb.textMessage("Ops, internal short circuit... Shutting
    down... :("), senderID);* ----why does it happen that when this line is
    active it loops constantly?*
    };

This happens when Facebook sends messages that BotStackJS not yet able to handle correctly. Typically, this is a service message from facebook. In the future we will properly handle.

  1. This is inside the Class BotStack:
    this.server.get('/images/', (req, res, next) => {
    //res.send(__dirname + '/images')
    let serveData = {
    directory: './images', -------- I cannot understand where is
    the root for this restify function and it just won't serve an html from a
    subfolder. I tried for 2 hours different debugging things and couldn't find
    it...

    file: 'images.html',
    }
    restify.serveStatic(serveData),
    });

Under the hood BotStackJS uses Restify, perhaps you should read the documentation on restify.serveStatic

Usually the root directory is the directory where you run node for execution.

BotStackJS can serve static files for you. All you just need to set 2 environment variables: BOTSTACK_STATIC and BOTSTACK_URL.

For example, you can set this value: BOTSTACK_STATIC=./media
And next create public path inside media (it's Restify issue). After this you can get your files by this URL for example : http://localhost:3000/public/myfile.png

BOTSTACK_URL reserved for future use. You can setup this variable with empty value: BOTSTACK_URL=

@Danail-Irinkov
Copy link

Danail-Irinkov commented Mar 8, 2017 via email

@cama cama unassigned webus and cama Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants