External data collection service from Waistline.
This API is designed to receive data from the app thanks to the "Data sharing" feature.
It's built with Symfony, Postgres, and MongoDB.
I created this service to centralize all my statistics from Waistline and be able to consult my data from an API endpoint.
This endpoint allows me to visualize my stats in a Grafana dashboard.
- Documentation — Learn how to use Waistline API
- Docker Hub — Find all docker images
Create a directory of your choice (e.g. ./waistline-api
) to hold the docker-compose.yml
and .env.local
files.
mkdir waistline-api
cd ./waistline-api
Download docker-compose.yml
and .env
by running the following commands:
wget https://raw.githubusercontent.com/hippothomas/waistline-api/master/docker-compose.yml
wget -O .env.local https://raw.githubusercontent.com/hippothomas/waistline-api/master/.env
You should change these values for security reason:
APP_ENV= # Set it to "prod"
APP_SECRET= # You should generate a new app secret
APP_BASE_URL= # The url of the app (without the ending /)
DATABASE_URL= # Your database connection string
MONGODB_URL= # Your mongodb connection string
You should also change the values in consequence in the docker-compose.yml
.
From the directory you created in Step 1, run:
docker compose up -d
Once the containers are up and running, you may have to execute these commands to instantiate the database and reset the cache:
docker exec -it waistline-api /bin/sh
php bin/console doctrine:migrations:migrate --quiet
php bin/console cache:clear --quiet
exit
Contributions, suggestions, bug reports and fixes are welcome!
For new features, filters, or endpoints, please open an issue and discuss before sending a PR.
See the LICENSE file for license rights and limitations (MIT).