Sidekick is a Django application which provides additional functionality to RapidPro through RapidPro’s webhooks within flow, as well as using RP’s REST API to initiate flows, update contact fields etc. In some respects it functions much like setting up serverless functions to handle webhooks and return responses. However there are some additional benefits to using a Django application, primarily User authentication and management, as well as management of RapidPro Orgs.
To set up and run rp-sidekick
locally, do the following:
$ git clone [email protected]:praekeltfoundation/rp-sidekick.git $ cd rp-sidekick $ virtualenv ve $ source ve/bin/activate $ pip install -e . $ pip install -r requirements-dev.txt $ pre-commit install
RP-Sidekick does not work with SQLite because it uses JSONFields. This means that you will need to set up PostgreSQL locally. You can spin up a local db with docker, using the following command:
$ docker run -d -p 5432:5432 --name=sidekick_db -e POSTGRES_DB=rp_sidekick postgres:9.6
- black - this repository uses an opinionated python code formatter. See
pyproject.toml
for config. - pre-commit - lints staged code as a git pre-commit check. Will prevent commits if linting fails. Currently runs black, flake8 and yamllint.
There is a [docker image](https://github.com/praekeltfoundation/rp-sidekick/pkgs/container/rp-sidekick) that can be used to easily run this service. It uses the following environment variables for configuration:
See our ways of working for a guide on how to contribute to rp-sidekick
.