feat: Implement Garmin sync, login improvements, and utility scripts

This commit is contained in:
2025-10-11 11:56:25 -07:00
parent 56a93cd8df
commit 3819e4f5e2
921 changed files with 2058 additions and 371 deletions

27
GEMINI.md Normal file
View File

@@ -0,0 +1,27 @@
# FitTrack_GarminSync Development Guidelines
Auto-generated from all feature plans. Last updated: 2025-10-10
## Active Technologies
- Python 3.13 + FastAPI, `garth`, `garminconnect`, `httpx`, `pydantic` (003-loginimprovements-use-the)
- Python 3.13 + FastAPI, garth, garminconnect, httpx, pydantic (003-loginimprovements-use-the)
- centralDB (PostgreSQL/SQLite with SQLAlchemy) (003-loginimprovements-use-the)
## Project Structure
```
src/
tests/
```
## Commands
cd src [ONLY COMMANDS FOR ACTIVE TECHNOLOGIES][ONLY COMMANDS FOR ACTIVE TECHNOLOGIES] pytest [ONLY COMMANDS FOR ACTIVE TECHNOLOGIES][ONLY COMMANDS FOR ACTIVE TECHNOLOGIES] ruff check .
## Code Style
Python 3.13: Follow standard conventions
## Recent Changes
- 003-loginimprovements-use-the: Added Python 3.13 + FastAPI, garth, garminconnect, httpx, pydantic
- 003-loginimprovements-use-the: Added Python 3.13 + FastAPI, `garth`, `garminconnect`, `httpx`, `pydantic`
<!-- MANUAL ADDITIONS START -->
<!-- MANUAL ADDITIONS END -->

61
README.md Normal file
View File

@@ -0,0 +1,61 @@
# FitTrack Garmin Sync Backend
This project provides a backend service for synchronizing fitness data from Garmin Connect.
## Getting Started
...
## Garmin Authentication
To enable Garmin synchronization, you need to link your Garmin Connect account with this service. This is done via a dedicated login endpoint.
### 1. Link your Garmin Account
Send a `POST` request to the `/api/garmin/login` endpoint with your Garmin Connect username (email) and password.
**Endpoint**: `POST /api/garmin/login`
**Request Body (JSON)**:
```json
{
"username": "your_garmin_email@example.com",
"password": "your_garmin_password"
}
```
**Example using `curl`**:
```bash
curl -X POST \
http://localhost:8000/api/garmin/login \
-H 'Content-Type: application/json' \
-d
{
"username": "your_garmin_email@example.com",
"password": "your_garmin_password"
}
```
**Success Response (200 OK)**:
```json
{
"message": "Garmin account linked successfully."
}
```
**Error Response (401 Unauthorized)**:
```json
{
"detail": "Invalid Garmin credentials provided."
}
```
Upon successful login, your Garmin credentials and authentication tokens will be stored in the system. The system will handle token refreshes automatically to maintain continuous synchronization.
### 2. Subsequent Synchronization
Once linked, other Garmin synchronization endpoints (e.g., for activities, health metrics) will automatically use the stored and refreshed credentials to access your Garmin data. **These subsequent synchronization calls do not require any additional authentication headers from the client.**

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More