# etiennehoet-ai/gym-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/etiennehoet-ai/gym-tracker
- Repository: https://github.com/etiennehoet-ai/gym-tracker

## Overview

Gym Tracker is an offline-first Flutter workout log, with Android as a documented supported target. The visible domain spans exercise catalogue management, workout/session logging, reusable templates, history, and progression/performance views. The README explicitly documents the exercise repository and local Drift/SQLite lifecycle; other repository internals and page-to-storage wiring were not sampled, so those links are shown only where the tree and documented behavior support them.

Main entry points: [`lib/app/app.dart`](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/app.dart) (App shell), [`lib/database/app_database.dart`](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/app_database.dart) (Drift database), [`lib/main.dart`](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/main.dart) (Flutter entry), [`lib/app/exercises_page.dart`](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercises_page.dart) (Exercise catalogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_main["Flutter entry<br/>[main.dart]"]
  node_app["App shell<br/>[app.dart]"]
end

subgraph group_training["Training workflow"]
  node_exercises["Exercise catalogue"]
  node_exercise_detail["Exercise details"]
  node_exercise_form["Exercise editor"]
  node_exercise_model["Exercise model"]
  node_workout["Workout logging<br/>[workout_page.dart]"]
  node_session_edit["Session editing"]
  node_workout_model["Workout model<br/>[workout_model.dart]"]
end

subgraph group_review["Review and planning"]
  node_home["Home overview<br/>[home_page.dart]"]
  node_history["Workout history<br/>[history_page.dart]"]
  node_session_detail["Session details"]
  node_progression["Progression view"]
  node_performance["Performance model"]
  node_templates["Workout templates"]
  node_template_model["Template model"]
end

subgraph group_storage["Local persistence"]
  node_database[("Drift database<br/>[app_database.dart]")]
  node_exercise_repo["Exercise repository"]
  node_seed["Exercise seed"]
  node_sqlite[("Local SQLite file")]
end

node_person(("Gym tracker user"))

node_person -->|"opens app"| node_main
node_main -->|"starts shell"| node_app
node_app -->|"offers catalogue"| node_exercises
node_app -->|"offers logging"| node_workout
node_app -->|"shows overview"| node_home
node_app -->|"offers history"| node_history
node_app -->|"offers templates"| node_templates
node_exercises -->|"opens details"| node_exercise_detail
node_exercise_detail -->|"edits exercise"| node_exercise_form
node_exercise_repo -->|"queries and writes"| node_database
node_database -->|"inserts on creation"| node_seed
node_database -->|"persists locally"| node_sqlite

click node_main "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/main.dart"
click node_app "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/app.dart"
click node_exercises "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercises_page.dart"
click node_exercise_detail "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercise_detail_page.dart"
click node_exercise_form "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercise_form_dialog.dart"
click node_exercise_model "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercise_model.dart"
click node_workout "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/workout_page.dart"
click node_session_edit "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/session_edit_page.dart"
click node_workout_model "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/workout_model.dart"
click node_home "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/home_page.dart"
click node_history "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/history_page.dart"
click node_session_detail "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/session_detail_page.dart"
click node_progression "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/progression_model.dart"
click node_performance "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/performance_model.dart"
click node_templates "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/templates_page.dart"
click node_template_model "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/template_model.dart"
click node_database "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/app_database.dart"
click node_exercise_repo "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/exercise_repository.dart"
click node_seed "https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/seed_exercises.dart"

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_main,node_app,node_person toneBlue
class node_exercises,node_exercise_detail,node_exercise_form,node_exercise_model,node_workout,node_session_edit,node_workout_model toneAmber
class node_home,node_history,node_session_detail,node_progression,node_performance,node_templates,node_template_model toneMint
class node_database,node_exercise_repo,node_seed,node_sqlite toneRose
```

## Components

### App entry

- [Flutter entry](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/main.dart): `lib/main.dart`
- [App shell](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/app.dart): `lib/app/app.dart`

### Training workflow

- [Exercise catalogue](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercises_page.dart): `lib/app/exercises_page.dart`
- [Exercise details](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercise_detail_page.dart): `lib/app/exercise_detail_page.dart`
- [Exercise editor](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercise_form_dialog.dart): `lib/app/exercise_form_dialog.dart`
- [Exercise model](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/exercise_model.dart): `lib/app/exercise_model.dart`
- [Workout logging](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/workout_page.dart): `lib/app/workout_page.dart`
- [Session editing](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/session_edit_page.dart): `lib/app/session_edit_page.dart`
- [Workout model](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/workout_model.dart): `lib/app/workout_model.dart`

### Review and planning

- [Home overview](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/home_page.dart): `lib/app/home_page.dart`
- [Workout history](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/history_page.dart): `lib/app/history_page.dart`
- [Session details](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/session_detail_page.dart): `lib/app/session_detail_page.dart`
- [Progression view](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/progression_model.dart): `lib/app/progression_model.dart`
- [Performance model](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/performance_model.dart): `lib/app/performance_model.dart`
- [Workout templates](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/templates_page.dart): `lib/app/templates_page.dart`
- [Template model](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/app/template_model.dart): `lib/app/template_model.dart`

### Local persistence

- [Drift database](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/app_database.dart): `lib/database/app_database.dart`
- [Exercise repository](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/exercise_repository.dart): `lib/database/exercise_repository.dart`
- [Exercise seed](https://github.com/etiennehoet-ai/gym-tracker/blob/main/lib/database/seed_exercises.dart): `lib/database/seed_exercises.dart`
- **Local SQLite file**

### Other components

- **Gym tracker user**

## Connections

- Gym tracker user → Flutter entry: opens app
- Flutter entry → App shell: starts shell
- App shell → Exercise catalogue: offers catalogue
- App shell → Workout logging: offers logging
- App shell → Home overview: shows overview
- App shell → Workout history: offers history
- App shell → Workout templates: offers templates
- Exercise catalogue → Exercise details: opens details
- Exercise details → Exercise editor: edits exercise
- Exercise repository → Drift database: queries and writes
- Drift database → Exercise seed: inserts on creation
- Drift database → Local SQLite file: persists locally
