MODE Integration Guide for backend data analysis
We provide a basic REST entpoint as a Docker image which listens
on an endpoint /analyze
. The input is binary movement data gathered
from the smartphone apps (see here and here).
Output is a JSON string of the taken activities.
Using the image
Step 1: Copy exported image to server
Use your tool of choice.
Step 2: Import image on server
docker load -i modesrv-1.0.0.tar.gz
Step 3: Create Docker container
# docker stop modesrv
# docker rm modesrv
docker create --name modesrv -p 8080:8080 --restart=unless-stopped ait/modesrv:1.0.0
Step 4: Run Docker image and follow its logs
docker start modesrv
docker logs -f modesrv
Step 5: Test the image
Follow these instructions to send example data to localhost:8080
and see some JSON output.
Important Notes
The MODE backend service uses third-party routing services (e.g. Google Router). At this stage, a sample API key is hardcoded in the project. Make sure to keep that key confident and only use it for testing and sparsingly. Overuse of the API key may result in high fees, as only about 20.000 requests/per month are free!
For production, we must use a different key being used for billing. This will be set via an ENV variable to the Docker image.