- Postgres DB (
brew install postgres
,initdb /usr/local/var/postgres
) - Node JS (see install instructions)
- Forward, or another https forwarding service (try forward here)
git clone git@github.com:buzzfeed-openlab/buzzbot.git && cd buzzbot
npm install
createuser --no-password buzzbot
(for development only!)createdb -O buzzbot buzzbot_development
postgres -D /usr/local/var/postgres
- Instructions can be found here: https://developers.facebook.com/docs/messenger-platform/implementation#create_app_page
export FB_PAGE_TOKEN=XXX
using the token for your Facebook pageexport VERIFY_TOKEN=XXX
using a secret string that only your app and Facebook will know (I recommend generating a UUID or something similar)- Make sure the user and database inside
./db/sequelize_config.js
match the user and database you created npm run db:init
(Creates fixtures and populates db. Done only once, manually!)npm run init
(Webpack build. While developing this will be done automatically whenever the client code changes, but in production this needs to be run for every build.)npm start
- Start Forward (or your https forwarding service) and create a url that forwards to
localhost:8000
- Go to your Facebook app dashboard (https://developers.facebook.com/apps/)
- Configure a webhook with url from your forwarding service +
/hook/
and theverifyToken
specified in./config.js
- Verify and save
- Pull up the admin dashboard at
localhost:8000/admin
- Start a conversation with your bot by visiting your Facebook page and clicking "message" in the top right
npm start
: Run buzzbotnpm run init
: Do a Webpack build of the admin dashboard code.npm run db:nuke
: Drop all tables and data in the dbnpm run db:init
: Initialize db using the models in./db/models
and create fixtures specified in./db/fixtures
npm run migrate
: Run all migrationsnpm run migration:create
: Create a new migrationnpm run migration:undo
: Undo just the last migrationnpm run migration:undo:all
: Undo all migrations
Note that there are commands for creating and running migrations, but that the existing migrations are no longer used. All models and relations are created using sequelize.sync()
. See here for how that could change, but it hasn't happened yet.