arpanghosh8453 / public-fitbit-projects

A script to fetch data from Fitbit servers using their API and store the data in a local influxdb database.
BSD 4-Clause "Original" or "Old" License
323 stars 29 forks source link

Adds files to launch full stack with docker-compose #2

Closed jtbrush56 closed 1 year ago

jtbrush56 commented 1 year ago

The PR will launch the full stack with docker compose. The only environment variables that are required to be updated are the following:

  - CLIENT_ID=your_application_client_ID # Change this to your client ID
  - CLIENT_SECRET=your_application_client_secret # Change this to your client Secret
  - DEVICENAME = 'Your_Device_Name' # e.g. "Charge5"

To launch this stack:

  1. Update the environment variables listed above in docker-compose.yml
  2. Run docker-compose run publicfitbitprojects
  3. Enter a valid FitBit refresh token
  4. Then exit out with ctrl + c
  5. Run docker-compose up -d to launch the full stack

Access Grafana:

  1. http://localhost:3000 in your browser
  2. Default user: admin
  3. Default password: admin

Add InfluxDB as datasource to grafana (these credentials can all be set in the docker-compose.yml file before the initial launch):

  1. Host: influxdb
  2. User: fitbit_user
  3. Password: fitbit_password
  4. Database: fitbit_database

Import the dashboard to Grafana with the included Health Stats Dashboard.json template file.

clschnei commented 1 year ago

I just bookmarked this repo to help do exactly this. Thank you!

jtbrush56 commented 1 year ago

I love me some docker. :)