OINK: The Open-INcentive-Kit
The goal of Oink is to provide an easy-to-extend framework for simple, secure, robust, and reliable incentive-based studies.
We are initially developing Oink as part of the GridWatch project, specifically for the DumsorWatch deployment in greater Accra, however the long-term aim is for Oink to live as a standalone entity to accelerate and ease future studies.
Getting Started
Right this second, everything is a pretty rough around the edges, and getting started will require having your head reasonably well wrapped around the Firebase and Firestore ecosystems.
Installations / Prerequisites
-
The first step is to install the Firebase CLI tools, be sure to follow the steps to log in to firebase too.
-
Oink deployments work via branches. The
master
branch is affiliated with no project. Currently thedumsorwatch
branch represents the live code for the deployed DumsorWatch project and thepaymenttoy
branch is a test branch for running Oink code prior to deployment (and matches the PaymentToy google project).
-
If you want to test out a specific project:
- Check out the appropriate branch (e.g.
git checkout paymenttoy
) - Head to
src/firebase_project/functions
and runfirebase functions:config:get > .runtimeconfig.json
. Careful, these are private variables that are made available by the firebase environment, things such as passwords. Don't commit this file! (It's .gitignored)
- Check out the appropriate branch (e.g.
NOTE: At this point, you've configured this directory to this project. Changing branches will not change to another project as these two magic hidden files are
.gitignore
d. Currently, we strongly advise one checkout of this repo for each firebase project you have.
-
Some of the support scripts will need you to have the Python firestore library installed:
pip install --upgrade google-cloud-firestore
-
You will also need the Google Cloud SDK, be sure to get through
gcloud auth login
from their setup directions. -
The firebase cloud runs a pretty out of date version of node, so install the Node Version Manager (nvm). Once you have that set up, grab the current firebase node version, which as of this writing is
nvm install 6.11.5
(once) andnvm use 6.11.5
(every terminal session).
Digging in
Head into the src to start learning about how Oink works.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.