using Flask, Flask-Restful and SQLAlchemy. and angularjs (for monitoring UI.)
to run locally:
-
set up a vagrant machine (see Vagrantfile, provosion.sh) or Install requisite packages:
pip install -r requirements.txt
-
create main.db (local sqlite database file) :
python migrationManager.py db upgrade
-
Run service:
python ./application.py
-
check it out at: http://localhost:5000
TODO: we need to decouple the API from the slack extension. API client currently has to send `satellizer_token` with each request, which can only be retrieved by packaging the extension, installing it, logging in, and looking inside localStorage
The list of endpoints: https://github.com/Backfeed/BF-Chrome-Extension/blob/develop/extension/contentScript/app/contentServices/services.js
You could clone the BF-Chrome-Extension codebase and deep search for method names (e.g. `ContributionDetail.getDetail``) to find out the expected data model of the request object.
Most requests require authentication data returned by https://refactor.elasticbeanstalk.com/api/me so make sure to call that before any subsequent calls.
There are 2 HTTP headers you need to add to all requests:
1. `User-Agent`: the value is the string 'DEAP'
2. `x-access-token`: the value should be the word `Bearer ` (with a whitespace after) immediately followed by the `satellizer_token` from the extension's localStorage.
You'll see it on a tab opened with domain *.slack.com while the extension in installed and you're logged in