# jorge-huxley/intervalssync architecture

> Architecture diagram of the GitHub repository jorge-huxley/intervalssync, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jorge-huxley/intervalssync
- Repository: https://github.com/jorge-huxley/intervalssync

## Overview

Intervals Sync moves rides from iGPSPORT or Bryton to intervals.icu, and can send planned workouts and iGPSPORT profile zones in the reverse direction. Users initiate these workflows through either the Flet GUI or headless CLI; configuration and credentials are collected before the sync logic coordinates vendor and intervals.icu APIs. The README documents optional Dropbox mirroring and zone sync. The sampled excerpts do not expose all GUI/CLI dispatch and orchestration code, so uncertain internal wiring is omitted.

Main entry points: [`src/intervalssync/cli/main.py`](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/main.py) (Headless CLI), [`src/intervalssync/intervals_icu.py`](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/intervals_icu.py) (Intervals API helpers), [`src/intervalssync/gui/app.py`](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/app.py) (Flet application), [`src/intervalssync/igpsport/core.py`](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/core.py) (iGPSPORT activity sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["User interfaces"]
  node_cli["Headless CLI<br/>[main.py]"]
  node_gui["Flet application<br/>[app.py]"]
  node_settings["Settings view<br/>[settings_view.py]"]
  node_sync_view["Sync view<br/>[sync_view.py]"]
  node_profile_ui["Profile sync UI<br/>[profile_sync_ui.py]"]
end

subgraph group_sync["Sync workflows"]
  node_igp_activity["iGPSPORT activity sync<br/>[core.py]"]
  node_bryton_activity["Bryton activity sync<br/>[core.py]"]
  node_igp_workouts["iGPSPORT workout upload<br/>[workout.py]"]
  node_bryton_workouts["Bryton workout upload<br/>[workout.py]"]
  node_profile_sync["iGPSPORT profile sync<br/>[profile_sync.py]"]
end

subgraph group_integrations["Service integrations"]
  node_intervals_api["Intervals API helpers<br/>[intervals_icu.py]"]
  node_igp_api["iGPSPORT API"]
  node_bryton_api["Bryton API<br/>[api.py]"]
  node_dropbox_client["Dropbox client<br/>[dropbox_client.py]"]
end

subgraph group_state["Configuration and storage"]
  node_cli_config["CLI configuration<br/>[config.py]"]
  node_gui_config["GUI configuration<br/>[config.py]"]
  node_secrets["Secure credentials<br/>[secrets.py]"]
  node_activity_map["Upload checkpoints<br/>[main.py]"]
end

node_user(("User"))
node_intervals_service(("intervals.icu"))
node_igpsport_service(("iGPSPORT"))
node_bryton_service(("Bryton Active"))
node_dropbox_service(("Dropbox"))

node_user -->|"opens app"| node_gui
node_user -->|"runs commands"| node_cli
node_gui -->|"shows settings"| node_settings
node_gui -->|"shows sync"| node_sync_view
node_gui -->|"prompts sync"| node_profile_ui
node_settings -->|"saves preferences"| node_gui_config
node_settings -->|"stores credentials"| node_secrets
node_gui -->|"checks credentials"| node_secrets
node_cli -->|"loads config"| node_cli_config
node_cli -->|"runs sync"| node_igp_activity
node_cli -->|"runs sync"| node_bryton_activity
node_cli -->|"uploads workouts"| node_igp_workouts
node_cli -->|"uploads workouts"| node_bryton_workouts
node_cli -->|"syncs zones"| node_profile_sync
node_sync_view -->|"starts sync"| node_igp_activity
node_sync_view -->|"starts sync"| node_bryton_activity
node_profile_ui -->|"starts sync"| node_profile_sync
node_igp_activity -->|"fetches rides"| node_igp_api
node_igp_activity -->|"uploads activities"| node_intervals_api
node_bryton_activity -->|"fetches rides"| node_bryton_api
node_bryton_activity -->|"uploads activities"| node_intervals_api
node_igp_workouts -->|"fetches workouts"| node_intervals_api
node_bryton_workouts -->|"fetches workouts"| node_intervals_api
node_igp_workouts -->|"creates workouts"| node_igp_api
node_bryton_workouts -->|"uploads FIT"| node_bryton_api
node_profile_sync -->|"reads zones"| node_intervals_api
node_profile_sync -->|"updates profile"| node_igp_api
node_igp_api -->|"requests API"| node_igpsport_service
node_bryton_api -->|"requests API"| node_bryton_service
node_intervals_api -->|"requests API"| node_intervals_service
node_cli -->|"persists checkpoints"| node_activity_map
node_igp_activity -.->|"optional FIT mirror"| node_dropbox_client
node_bryton_activity -.->|"optional FIT mirror"| node_dropbox_client
node_settings -.->|"connects Dropbox"| node_dropbox_client
node_dropbox_client -.->|"uploads and lists"| node_dropbox_service

click node_cli "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/main.py"
click node_gui "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/app.py"
click node_settings "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/settings_view.py"
click node_sync_view "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/sync_view.py"
click node_profile_ui "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/profile_sync_ui.py"
click node_igp_activity "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/core.py"
click node_bryton_activity "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/bryton/core.py"
click node_igp_workouts "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/workout.py"
click node_bryton_workouts "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/bryton/workout.py"
click node_profile_sync "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/profile_sync.py"
click node_intervals_api "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/intervals_icu.py"
click node_bryton_api "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/bryton/api.py"
click node_dropbox_client "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/dropbox_client.py"
click node_cli_config "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/config.py"
click node_gui_config "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/config.py"
click node_secrets "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/secrets.py"
click node_activity_map "https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_gui,node_settings,node_sync_view,node_profile_ui,node_user toneBlue
class node_igp_activity,node_bryton_activity,node_igp_workouts,node_bryton_workouts,node_profile_sync toneAmber
class node_intervals_api,node_igp_api,node_bryton_api,node_dropbox_client toneMint
class node_cli_config,node_gui_config,node_secrets,node_activity_map toneRose
class node_intervals_service,node_igpsport_service,node_bryton_service,node_dropbox_service toneIndigo
```

## Components

### User interfaces

- [Headless CLI](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/main.py): `src/intervalssync/cli/main.py`
- [Flet application](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/app.py): `src/intervalssync/gui/app.py`
- [Settings view](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/settings_view.py): `src/intervalssync/gui/settings_view.py`
- [Sync view](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/sync_view.py): `src/intervalssync/gui/sync_view.py`
- [Profile sync UI](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/profile_sync_ui.py): `src/intervalssync/gui/profile_sync_ui.py`

### Sync workflows

- [iGPSPORT activity sync](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/core.py): `src/intervalssync/igpsport/core.py`
- [Bryton activity sync](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/bryton/core.py): `src/intervalssync/bryton/core.py`
- [iGPSPORT workout upload](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/workout.py): `src/intervalssync/igpsport/workout.py`
- [Bryton workout upload](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/bryton/workout.py): `src/intervalssync/bryton/workout.py`
- [iGPSPORT profile sync](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/igpsport/profile_sync.py): `src/intervalssync/igpsport/profile_sync.py`

### Service integrations

- [Intervals API helpers](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/intervals_icu.py): `src/intervalssync/intervals_icu.py`
- **iGPSPORT API**
- [Bryton API](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/bryton/api.py): `src/intervalssync/bryton/api.py`
- [Dropbox client](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/dropbox_client.py): `src/intervalssync/dropbox_client.py`

### Configuration and storage

- [CLI configuration](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/config.py): `src/intervalssync/cli/config.py`
- [GUI configuration](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/config.py): `src/intervalssync/gui/config.py`
- [Secure credentials](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/gui/secrets.py): `src/intervalssync/gui/secrets.py`
- [Upload checkpoints](https://github.com/jorge-huxley/intervalssync/blob/master/src/intervalssync/cli/main.py): `src/intervalssync/cli/main.py`

### Other components

- **User**
- **intervals.icu**
- **iGPSPORT**
- **Bryton Active**
- **Dropbox**

## Connections

- User → Flet application: opens app
- User → Headless CLI: runs commands
- Flet application → Settings view: shows settings
- Flet application → Sync view: shows sync
- Flet application → Profile sync UI: prompts sync
- Settings view → GUI configuration: saves preferences
- Settings view → Secure credentials: stores credentials
- Flet application → Secure credentials: checks credentials
- Headless CLI → CLI configuration: loads config
- Headless CLI → iGPSPORT activity sync: runs sync
- Headless CLI → Bryton activity sync: runs sync
- Headless CLI → iGPSPORT workout upload: uploads workouts
- Headless CLI → Bryton workout upload: uploads workouts
- Headless CLI → iGPSPORT profile sync: syncs zones
- Sync view → iGPSPORT activity sync: starts sync
- Sync view → Bryton activity sync: starts sync
- Profile sync UI → iGPSPORT profile sync: starts sync
- iGPSPORT activity sync → iGPSPORT API: fetches rides
- iGPSPORT activity sync → Intervals API helpers: uploads activities
- Bryton activity sync → Bryton API: fetches rides
- Bryton activity sync → Intervals API helpers: uploads activities
- iGPSPORT workout upload → Intervals API helpers: fetches workouts
- Bryton workout upload → Intervals API helpers: fetches workouts
- iGPSPORT workout upload → iGPSPORT API: creates workouts
- Bryton workout upload → Bryton API: uploads FIT
- iGPSPORT profile sync → Intervals API helpers: reads zones
- iGPSPORT profile sync → iGPSPORT API: updates profile
- iGPSPORT API → iGPSPORT: requests API
- Bryton API → Bryton Active: requests API
- Intervals API helpers → intervals.icu: requests API
- Headless CLI → Upload checkpoints: persists checkpoints
- iGPSPORT activity sync → Dropbox client: optional FIT mirror
- Bryton activity sync → Dropbox client: optional FIT mirror
- Settings view → Dropbox client: connects Dropbox
- Dropbox client → Dropbox: uploads and lists
