Skip to content

thebarbariangroup/receptionbot-slackbot-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

receptionbot-slackbot-be

This is the backend component of the Reception Slackbot. It is in charge of keeping and transforming a database of users to be retrieved via API. The front-end repo provides the interface for interacting with the API.

Prerequisites

Building the app

Install MongoDB

https://docs.mongodb.com/manual/installation/

Make sure it is running as a service or started manually on your machine or you will get a connection error when trying to start the server

Install modules

npm install

Running server

Dev build:

  • Check .env and configure the variables:

    • Change MONGODB_URI to the location of your install and the name of the DB
      • This should look something like mongodb://localhost/[db-name]
    • Add SLACK_API_TOKEN with your OAuth access token
      • You can add multiple Slack instances by delimiting the SLACK_API_TOKENs with a | (pipe)
    • Add a random string to seed the JSON Web Token generator
    • Add a specific PORT to run the API out of.
      • By default the server start on port 3000
  • start the server via npm run dev

If everything goes well, you should see: Running on port: 3000 (or whatever PORT you specified in the .env) MONGODB CONNECTION ACCEPTED

You can now debug this server using Google Chrome by navigating to chrome://inspect and inspecting app/server.js.

The port will be important when connecting the front-end repo(https://github.com/thebarbariangroup/receptionbot-slackbot-fe) as this will be the API_URI of the app.

Prod build:

  • Configure ENV_VARs on your server of choice.

    • Include NODE_ENV as "production"
    • Change MONGODB_URI to the location of your install and the name of the DB
      • This should look something like mongodb://localhost/[db-name]
    • Add SLACK_API_TOKEN with your OAuth access token
      • You can add multiple Slack instances by delimiting the SLACK_API_TOKENs with a | (pipe)
    • Add a random string to seed the JSON Web Token generator
    • Add a specific PORT to run the API out of.
      • By default the server start on port 3000
  • start the server via npm start

If everything goes well, you should see: Running on port: 3000 (or whatever PORT you specified in the ENV_VARs) MONGODB CONNECTION ACCEPTED

The port will be important when connecting the front-end repo as this will be the API_URI of the app.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published