This project is a microservice for integrating Google Fit data into your application. It allows you to retrieve and analyze fitness data such as steps, calories, and active minutes.
- Fetch step count from Google Fit
- Retrieve calories expended and active minutes data
- Dockerized for easy deployment
Before you begin, ensure you have met the following requirements:
- Python 3.8 or higher
- Docker installed on your machine
- Google Cloud account for setting up OAuth2 credentials
-
Clone the repository:
git clone https://github.com/Krishpandya682/FitnessData.git cd FitnessData
-
Set up the virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Download the Google OAuth2 credentials:
- Set up OAuth2 credentials in the Google Cloud Console.
- Download the
credentials.json
file and place it in the root directory of this project.
-
Run the application:
python app.py
-
Build the Docker image:
docker build -t fitness-data-service .
-
Run the Docker container:
docker run -p 5002:5002 fitness-data-service
Once the service is running, you can interact with it via API endpoints. For example, to fetch step count data, send a GET request to:
GET http://localhost:5002/steps
You can use tools like Postman or curl
to test the endpoints.
.
├── app.py # Main application file
├── dockerfile # Docker configuration
├── requirements.txt # Python dependencies
├── .gitignore # Files to ignore in Git
└── venv/ # Virtual environment (not included in Git)