This repository contains a tool to retrieve step count and heart rate data from Google Fit API and store it in a MongoDB database. The tool also generates a daily message ranking users according to the number of steps they have taken and sends it to a WhatsApp group.
- Google Fit API credentials
- MongoDB database URL
- WhatsApp API credentials
- Clone the repository and navigate to the project directory
git clone https://github.com/<username>/<repo-name>
cd <repo-name>
- Install the dependencies
npm install
- Create a .env file in the root of the project and add the following environment variables:
GOOGLE_FIT_API_KEY=<Google Fit API Key>
MONGODB_URI=<MongoDB Connection URL>
clientId = <your-client-id>;
clientSecret = <your-client-secret>;
redirectUri = <your-redirect-uri>;
- Run the script
npm start
The tool currently only supports retrieving step count and heart rate data and generating a daily message. If you need to retrieve other types of data or generate messages at different times, you will need to modify the code.
This tool provides a basic implementation of retrieving data from Google Fit API and storing it in a MongoDB database, later that data will be segregated into leaderboards which will be sent as a whatsapp message at the time of winners announcement.