CALORIES

command module
v0.0.0-...-934788e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2018 License: MIT Imports: 5 Imported by: 0

README

calories

Deployed with Inertia Build Status Coverage Status

WIP

Setup
  1. Make sure you have Go and the Heroku CLI installed
  2. Clone the repository into $GOPATH/src/github.com/bobheadxi
  3. If you aren't a repository collaborator, you will have to create your own Heroku and Postgres instance:
heroku create
heroku config:set HEROKU_URI=your-heroku-uri
heroku config:set DATABASE_URL=your-database-url
  1. Now you have to set up your Facebook app page. Create a Facebook page for your app at https://developers.facebook.com/apps/
  2. Click on "Messenger" under "Products". Generate a token under "Token Generation", and set up Webhook under "Webhooks". Use the URL of your Heroku server as your webhook URL (append /webhook to the end). Make sure you at least subscribe to messages and messaging_postbacks.
  3. Save your tokens as Config Variables on Heroku. These are required for the app to run.
heroku config:set FB_PAGE_ID=your-page-id
heroku config:set FB_TOKEN=your-fb-token
  1. With all this set up, you should be good to go! Deploy the bot to your Heroku instance:
git push heroku dev:master

Now you can message your Facebook page to try out the bot. Note that until your application gets submitted for review and accepted, other users will have to be added as testers before the bot will respond to them.

Development
Dependencies

We use dep to manage our dependencies. To install dep and Calorie's dependencies:

go get -u github.com/golang/dep/cmd/dep
dep ensure
Makefile
  • make -> builds the project

  • make db -> sets up local database shenanigans for testing

  • make test -> runs all tests with coverage reporting

  • make clean -> cleans up project (eg remove binaries)

  • make deploy -> deploys your branch to Heroku (and sets up the Heroku CLI if you haven't)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package bot contains implementation of the Calories bot.
Package bot contains implementation of the Calories bot.
Package config contains functions and data types to get necessary parameters from outside the app.
Package config contains functions and data types to get necessary parameters from outside the app.
Package facebook contains the processes, functions and data types required to receive data from and make requests to Facebook's API.
Package facebook contains the processes, functions and data types required to receive data from and make requests to Facebook's API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL