# jlopezarriaza/fitness-data-ingest architecture

> Architecture diagram of the GitHub repository jlopezarriaza/fitness-data-ingest, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jlopezarriaza/fitness-data-ingest
- Repository: https://github.com/jlopezarriaza/fitness-data-ingest

## Overview

Project Type Analysis:
This appears to be a data integration/ingestion service that interfaces with multiple fitness platforms (Fitbit and Strava) to collect fitness-related data.

##### External Services Layer
- Fitbit API
- Strava API

##### Service Integration Layer
- Fitbit Service Module
- Strava Service Module

##### Utility Components
- Shared utilities for each service
- Global configurations

##### Component Details

For Fitbit Service:
- Fitbit_service.py as the main interface
- Fitbit_utils.py as a supporting component
- Globals.py for configuration

For Strava Service:
- Get_activity_data.py and get_stream_data.py as main interfaces
- Utils.py as a supporting component
- Globals.py for configuration

##### Data Flow Representation

- Incoming data flow from external APIs to respective services
- Internal data flow between service components and their utilities
- Data output flow (add a destination database/storage component if applicable)

##### Additional Elements

- API version information if available
- Authentication flow paths
- Rate limiting or caching mechanisms

Specific Recommendations:

1. Use a top-down layout to show the clear separation between external services and internal components

##### Related components
- Keep Fitbit components together on one side
- Keep Strava components together on the other side
- Shared utilities (if any) in a central location

##### Notes about
- Authentication methods used for each service
- Data types being collected
- Any data transformation processes

##### Adding
- Error handling flows
- Retry mechanisms
- Data validation steps

Level of Detail:

- Detailed authentication flows
- Specific data collection processes
- Error handling mechanisms

Remember to:
- Use clear, consistent naming conventions
- Version information where relevant
- Document any assumptions made about data flow
- Both synchronous and asynchronous operations if present
- Scalability considerations

## Diagram (Mermaid)

```mermaid
graph TB
    %% External Services
    FitbitAPI(("Fitbit API")):::external
    StravaAPI(("Strava API")):::external

    %% Main Service Layer
    subgraph Services["Services Layer"]
        direction TB
        
        subgraph FitbitModule["Fitbit Service Module"]
            direction TB
            FitbitService["Fitbit Service"]
            FitbitUtils["Fitbit Utilities"]
            FitbitConfig["Fitbit Configuration"]
        end

        subgraph StravaModule["Strava Service Module"]
            direction TB
            StravaActivity["Activity Service"]
            StravaStream["Stream Service"]
            StravaUtils["Strava Utilities"]
            StravaConfig["Strava Configuration"]
        end
    end

    %% Connections
    FitbitAPI --> FitbitService
    FitbitService --> FitbitUtils
    FitbitService --> FitbitConfig
    
    StravaAPI --> StravaActivity
    StravaAPI --> StravaStream
    StravaActivity --> StravaUtils
    StravaStream --> StravaUtils
    StravaActivity --> StravaConfig
    StravaStream --> StravaConfig

    %% Click Events
    click FitbitService "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/fitbit/fitbit_service.py"
    click FitbitUtils "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/fitbit/fitbit_utils.py"
    click FitbitConfig "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/fitbit/globals.py"
    click StravaActivity "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/strava/get_activity_data.py"
    click StravaStream "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/strava/get_stream_data.py"
    click StravaUtils "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/strava/utils.py"
    click StravaConfig "https://github.com/jlopezarriaza/fitness-data-ingest/blob/main/services/strava/globals.py"
    click Services "https://github.com/jlopezarriaza/fitness-data-ingest/tree/main/services/"
    click FitbitModule "https://github.com/jlopezarriaza/fitness-data-ingest/tree/main/services/fitbit/"
    click StravaModule "https://github.com/jlopezarriaza/fitness-data-ingest/tree/main/services/strava/"

    %% Styling
    classDef external fill:#LightBlue,stroke:#666,stroke-width:2px
    classDef service fill:#90EE90,stroke:#333,stroke-width:1px
    classDef utility fill:#FFE5B4,stroke:#333,stroke-width:1px
    classDef config fill:#E6E6E6,stroke:#333,stroke-width:1px

    class FitbitService,StravaActivity,StravaStream service
    class FitbitUtils,StravaUtils utility
    class FitbitConfig,StravaConfig config
```
