Git Product home page Git Product logo

waistline-api's Introduction

Waistline API

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.

Screenshot from my Grafana Dashboard

Links

Installation

Docker Compose [Recommended]

Step 1 - Download the required files

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

Step 2 - Populate the .env file with custom values

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.

Step 3 - Start the containers

From the directory you created in Step 1, run:

docker compose up -d

Step 4 - Execute migrations

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

Contributing

Contributions, suggestions, bug reports and fixes are welcome!

For new features, filters, or endpoints, please open an issue and discuss before sending a PR.

License

See the LICENSE file for license rights and limitations (MIT).

waistline-api's People

Contributors

hippothomas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.