This is a console application that tracks energy deficit basing on data from FatSecret API (calories consumption) and Google Fit API (calories expenditure). It is written in Go and consists of 3 microservices:
-
FatSecret producer - periodically polls FatSecret API for today consumption and sends it to Kafka
-
Google Fit producer - periodically polls Google Fit API for today expenditure and sends it to Kafka
-
Calorie deficit calculator - calulcates calorie deficit basing on consumption and expenditure received through Kafka
- Obtain credentials on FatSecret (REST API OAuth 1.0 Credentials) and Google Fit (OAuth 2.0) platforms or just ask me for them
- Clone this repository
- Enter obtained credentials in
fatsecret_producer/client.json
andgoogle_fit_producer/client.json
- Run
docker compose up
from project directory - Attach to
calorie-deficit-tracker-fatsecret-producer
container and follow printed URL - you'll be redirected to FatSecret authorization form - On successful authorization OAuth 1.0 verification code is printed - enter it in stdin of an attached container
- Attach to
calorie-deficit-tracker-google-fit-producer
container and follow printed URL - you'll be redirected to Google authorization form - On successful authorization you will be redirected to Google OAuth 2.0 Playground page. Copy Authorization code and enter it in stdin of an attached container
- Attach to or print logs of
calorie-deficit-tracker-calorie-deficit-calculator
- it periodically prints calorie deficit (i.e. difference between calorie expenditure and consumption)