# alex-git-ctrl/dashboard-prepa-marathon architecture

> Architecture diagram of the GitHub repository alex-git-ctrl/dashboard-prepa-marathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alex-git-ctrl/dashboard-prepa-marathon
- Repository: https://github.com/alex-git-ctrl/dashboard-prepa-marathon

## Overview

This is a personal marathon-preparation dashboard: it gathers Intervals.icu activity and wellness data, derives training and recovery metrics, and publishes a static view of progress toward the Barcelona sub-4-hour goal. Its complementary workflows generate a 27-week plan and send upcoming structured workouts through Intervals.icu to Garmin. The graph preserves the major analysis capabilities named in the source index; unsampled relationships are omitted unless the README documents them.

Main entry points: [`scripts/fetch_data.py`](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/fetch_data.py) (Activity extraction), [`scripts/build_site.py`](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/build_site.py) (Site assembly), [`docs/index.html`](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/index.html) (Static dashboard), [`docs/metrics.json`](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/metrics.json) (Aggregated metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_fetch["Activity extraction<br/>[fetch_data.py]"]
  node_metrics[("Aggregated metrics<br/>[metrics.json]")]
end

subgraph group_analysis["Training analysis"]
  node_detail["Session detail<br/>[seance_detail.py]"]
  node_types["Workout descriptions<br/>[seances_type.py]"]
  node_calibration["Pace calibration<br/>[calibration.py]"]
  node_health["Health indicators<br/>[sante.py]"]
  node_alerts["Training alerts<br/>[alerts.py]"]
  node_adaptation["Plan adaptation<br/>[adaptation.py]"]
end

subgraph group_planning["Planning and feedback"]
  node_planbuilder["Plan generation<br/>[build_plan.py]"]
  node_plan[("Training plan<br/>[plan.json]")]
  node_summary["Session summaries<br/>[resume.py]"]
  node_summaryai["AI analysis<br/>[resume_ia.py]"]
  node_bilan["Weekly review<br/>[bilan.py]"]
  node_export["Garmin workout export<br/>[export_garmin.py]"]
end

subgraph group_presentation["Dashboard and delivery"]
  node_sitebuilder["Site assembly<br/>[build_site.py]"]
  node_dashboard["Static dashboard<br/>[index.html]"]
end

node_runner(("Runner"))
node_watch["Garmin devices"]
node_intervals["Intervals.icu"]
node_actions["GitHub Actions"]
node_garmin["Garmin Connect"]
node_pages["GitHub Pages"]

node_watch -->|"syncs activities"| node_intervals
node_intervals -->|"serves API data"| node_fetch
node_actions -->|"runs scheduled"| node_fetch
node_fetch -->|"fetches streams"| node_intervals
node_fetch -->|"analyzes streams"| node_detail
node_fetch -->|"uses workout logic"| node_types
node_fetch -->|"uses calibration"| node_calibration
node_fetch -->|"builds health data"| node_health
node_fetch -->|"computes alerts"| node_alerts
node_fetch -->|"computes adaptation"| node_adaptation
node_fetch -->|"writes aggregates"| node_metrics
node_planbuilder -->|"writes plan"| node_plan
node_fetch -.->|"reads plan inputs"| node_plan
node_bilan -->|"uses summaries"| node_summary
node_summary -->|"uses analysis context"| node_summaryai
node_export -->|"reads workouts"| node_metrics
node_export -->|"posts workouts"| node_intervals
node_intervals -->|"syncs workouts"| node_garmin
node_garmin -->|"syncs workouts"| node_watch
node_sitebuilder -->|"assembles data"| node_metrics
node_sitebuilder -.->|"assembles plan"| node_plan
node_sitebuilder -->|"writes page"| node_dashboard
node_dashboard -->|"published on"| node_pages
node_runner -->|"views progress"| node_dashboard

click node_fetch "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/fetch_data.py"
click node_metrics "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/metrics.json"
click node_detail "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/seance_detail.py"
click node_types "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/seances_type.py"
click node_calibration "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/calibration.py"
click node_health "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/sante.py"
click node_alerts "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/alerts.py"
click node_adaptation "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/adaptation.py"
click node_planbuilder "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/build_plan.py"
click node_plan "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/plan.json"
click node_summary "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/resume.py"
click node_summaryai "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/resume_ia.py"
click node_bilan "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/bilan.py"
click node_export "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/export_garmin.py"
click node_sitebuilder "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/build_site.py"
click node_dashboard "https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/index.html"

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_fetch,node_metrics toneBlue
class node_detail,node_types,node_calibration,node_health,node_alerts,node_adaptation toneAmber
class node_planbuilder,node_plan,node_summary,node_summaryai,node_bilan,node_export toneMint
class node_sitebuilder,node_dashboard toneRose
class node_runner,node_watch,node_intervals,node_actions,node_garmin,node_pages toneIndigo
```

## Components

### Data ingestion

- [Activity extraction](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/fetch_data.py): `scripts/fetch_data.py`
- [Aggregated metrics](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/metrics.json): `docs/metrics.json`

### Training analysis

- [Session detail](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/seance_detail.py): `scripts/seance_detail.py`
- [Workout descriptions](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/seances_type.py): `scripts/seances_type.py`
- [Pace calibration](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/calibration.py): `scripts/calibration.py`
- [Health indicators](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/sante.py): `scripts/sante.py`
- [Training alerts](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/alerts.py): `scripts/alerts.py`
- [Plan adaptation](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/adaptation.py): `scripts/adaptation.py`

### Planning and feedback

- [Plan generation](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/build_plan.py): `scripts/build_plan.py`
- [Training plan](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/plan.json): `docs/plan.json`
- [Session summaries](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/resume.py): `scripts/resume.py`
- [AI analysis](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/resume_ia.py): `scripts/resume_ia.py`
- [Weekly review](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/bilan.py): `scripts/bilan.py`
- [Garmin workout export](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/export_garmin.py): `scripts/export_garmin.py`

### Dashboard and delivery

- [Site assembly](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/scripts/build_site.py): `scripts/build_site.py`
- [Static dashboard](https://github.com/alex-git-ctrl/dashboard-prepa-marathon/blob/main/docs/index.html): `docs/index.html`

### Other components

- **Runner**
- **Garmin devices**
- **Intervals.icu**
- **GitHub Actions**
- **Garmin Connect**
- **GitHub Pages**

## Connections

- Garmin devices → Intervals.icu: syncs activities (evidence: `README.md`)
- Intervals.icu → Activity extraction: serves API data (evidence: `README.md`)
- GitHub Actions → Activity extraction: runs scheduled (evidence: `README.md`)
- Activity extraction → Intervals.icu: fetches streams (evidence: `scripts/fetch_data.py`)
- Activity extraction → Session detail: analyzes streams (evidence: `scripts/fetch_data.py`)
- Activity extraction → Workout descriptions: uses workout logic (evidence: `scripts/fetch_data.py`)
- Activity extraction → Pace calibration: uses calibration (evidence: `scripts/fetch_data.py`)
- Activity extraction → Health indicators: builds health data (evidence: `scripts/fetch_data.py`)
- Activity extraction → Training alerts: computes alerts (evidence: `scripts/fetch_data.py`)
- Activity extraction → Plan adaptation: computes adaptation (evidence: `scripts/fetch_data.py`)
- Activity extraction → Aggregated metrics: writes aggregates (evidence: `README.md`)
- Plan generation → Training plan: writes plan (evidence: `README.md`)
- Activity extraction → Training plan: reads plan inputs
- Weekly review → Session summaries: uses summaries (evidence: `scripts/bilan.py`)
- Session summaries → AI analysis: uses analysis context (evidence: `scripts/resume.py`)
- Garmin workout export → Aggregated metrics: reads workouts (evidence: `scripts/export_garmin.py`)
- Garmin workout export → Intervals.icu: posts workouts (evidence: `scripts/export_garmin.py`)
- Intervals.icu → Garmin Connect: syncs workouts (evidence: `README.md`)
- Garmin Connect → Garmin devices: syncs workouts (evidence: `README.md`)
- Site assembly → Aggregated metrics: assembles data (evidence: `README.md`)
- Site assembly → Training plan: assembles plan
- Site assembly → Static dashboard: writes page (evidence: `README.md`)
- Static dashboard → GitHub Pages: published on (evidence: `README.md`)
- Runner → Static dashboard: views progress (evidence: `README.md`)
