f1foo

0.2.0 • Public • Published

Build Status Docker Image Build Status Code Coverage Code Climate Dependency Status Current Version

Docker Stars Docker Pulls

Stories in Ready Stories In Progress

JS Standard Style

f1foo

An integration between Wufoo's WebHooks and Fellowship One's REST API.

It allows Wufoo to be used for event registration (and other) forms, while being able to track registrations within Fellowship One.

Installation

This application is best used on a PaaS cloud provider like Heroku, Cloud Foundry, IBM BlueMix, and others. It's also available as a Docker image. It's (mostly) pre-configured for Heroku and IBM BlueMix, and it can of course also be used on a self-hosted environment.

Start by writing your configuration into a JSON file and saving it where you're going to install f1foo.

Then, follow the instructions relevant to your environment...

Docker

See the docker website to get started with Docker.

$ docker run \
  --detach \
  --publish 3000:3000 \
  --env F1_CONFIG='{ "apiURL": "...", ... }' \
  hairyhenderson/f1foo

Heroku

Assuming you already have a Heroku account and the Heroku Toolbelt installed, all you should need to do is:

$ npm install f1foo
$ cd node_modules/f1foo
$ git init
$ heroku apps:create APP_NAME
$ heroku git:remote -a APP_NAME
$ heroku config:set F1_CONFIG="`cat ../../f1config.json`"
$ git add .
$ git commit -am "Initial commit"
$ git push heroku master

At this point, the URL to your new app will be printed out - something like https://APP_NAME.herokuapp.com

Self-hosted

$ npm install f1foo
$ cd node_modules/f1foo
$ npm start

The app is now running at http://localhost:3000/.

Configuration

All configuration is done through environment variables.

F1_CONFIG

Required.

An environment variable F1_CONFIG must be set with your Fellowship One credentials. It's a JSON string like this:

{
  "apiURL": "https://churchcode.staging.fellowshiponeapi.com/v1",
  "username": "Me",
  "password": "reallysecurepassword",
  "oauth_credentials": {
    "consumer_key": "111",
    "consumer_secret": "12345678-9abc-defe-dcba-987654321012"
  }
}

Note: For testing you probably should use the staging API URL, but make sure to use your production API URL for production.

WUFOO_HANDSHAKE_KEY

Optional.

When WUFOO_HANDSHAKE_KEY is set, f1foo will reject incoming posts that don't have a matching handshake key.

DEBUG

Optional.

Controls the debug logs to aid with troubleshooting. Try DEBUG=f1foo to see f1foo's debug logs, or DEBUG=* to see all debug logs.

NEW_STATUS

Optional.

Defaults to New from Website.

When creating a Person record as a result of a form submission, the Person must be assigned a Status. This variable is used to look up the Status by name. To create new People with different Statuses, set this variable, e.g. NEW_STATUS='New from Wufoo'.

Usage

Once f1foo is configured and running, add WebHook notifications to your forms. See these instructions. The path on the URL should be /hooks, so if the app is running on Heroku, the URL should be something like https://f1foo.herokuapp.com/hooks, and the handshakeKey should be set (or not) to your WUFOO_HANDSHAKE_KEY value.

Important: Wufoo must send the form metadata along with each POST. In the Wufoo UI, this is

  • Include Field and Form Structures with Entry Data

Contributions

Pull Requests are more than welcome!

Tests

To run the unit tests:

$ npm install --dev
$ make test

License

The MIT License

Copyright (c) 2014-2015 Dave Henderson

Package Sidebar

Install

npm i f1foo

Weekly Downloads

0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • dhenderson