# evan-king-dev/epoch-lifts architecture

> Architecture diagram of the GitHub repository evan-king-dev/epoch-lifts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/evan-king-dev/epoch-lifts
- Repository: https://github.com/evan-king-dev/epoch-lifts

## Overview

Epoch Lifts is an iPhone workout tracker whose current workflow is to start or resume a workout, choose exercises, log sets, and browse or delete workout history. The app uses SwiftUI views over a WorkoutViewModel; WorkoutCore supplies workout models, input parsing, rep-counting abstractions, and persistence. The README also describes Watch-based counting, replay, and rep-quality analysis as future capabilities, not implemented subsystems in this tree. Relationships are limited to the sampled source and README; planned integrations are shown as unverified.

Main entry points: [`EpochLifts/ViewModels/WorkoutViewModel.swift`](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/ViewModels/WorkoutViewModel.swift) (Workout State), [`EpochLifts/Views/ActiveWorkoutView.swift`](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/ActiveWorkoutView.swift) (Active Workout), [`EpochLifts/Views/WorkoutListView.swift`](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutListView.swift) (Workout List), [`EpochLifts/EpochLiftsApp.swift`](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/EpochLiftsApp.swift) (App Wiring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["iPhone App"]
  node_composition["App Wiring"]
  node_workout_list["Workout List"]
  node_active_workout["Active Workout"]
  node_log_set["Log Set<br/>[LogSetView.swift]"]
  node_workout_detail["Workout Detail"]
  node_timer["Workout Timer"]
  node_view_model["Workout State"]
  node_exercise_picker["Exercise Picker"]
end

subgraph group_core["Workout Core"]
  node_set_input["Input Parsing<br/>[SetInput.swift]"]
  node_rep_service["Counter Contract"]
  node_manual_counter["Manual Counter"]
  node_rep_event["Rep Events<br/>[RepEvent.swift]"]
  node_exercise_type["Exercise Catalog<br/>[ExerciseType.swift]"]
  node_workout_model["Workout Records<br/>[Workout.swift]"]
  node_logged_exercise["Logged Exercise"]
  node_logged_set["Logged Set<br/>[LoggedSet.swift]"]
  node_rep_source["Rep Source"]
  node_storage_contract["Storage Contract"]
  node_file_storage[("JSON File Store")]
end

subgraph group_planned["Planned Capabilities"]
  node_watch_counting["Watch Rep Counting"]
  node_motion_replay["Motion Replay"]
  node_quality_analysis["Rep Quality ML"]
  node_history_tools["History Tools"]
  node_templates_export["Templates and Export"]
end

node_user(("Lifter"))

node_composition -->|"launches"| node_workout_list
node_composition -->|"creates"| node_view_model
node_composition -->|"configures"| node_file_storage
node_composition -->|"configures"| node_manual_counter
node_user -->|"starts or browses"| node_workout_list
node_workout_list -->|"starts and deletes"| node_view_model
node_workout_list -->|"opens"| node_active_workout
node_workout_list -->|"opens"| node_workout_detail
node_active_workout -->|"logs and edits"| node_view_model
node_active_workout -->|"presents"| node_exercise_picker
node_active_workout -->|"renders"| node_log_set
node_active_workout -->|"renders"| node_timer
node_log_set -->|"submits set"| node_view_model
node_workout_detail -->|"reads and deletes"| node_view_model
node_exercise_picker -->|"offers catalog"| node_exercise_type
node_view_model -->|"validates input"| node_set_input
node_view_model -->|"loads and saves"| node_storage_contract
node_view_model -->|"controls counter"| node_rep_service
node_manual_counter -->|"implements"| node_rep_service
node_manual_counter -->|"emits"| node_rep_event
node_view_model -->|"updates history"| node_workout_model
node_file_storage -->|"implements"| node_storage_contract
node_view_model -.->|"can accept counter"| node_watch_counting
node_view_model -.->|"can accept counter"| node_motion_replay
node_watch_counting -.->|"sends live events"| node_rep_event
node_motion_replay -.->|"planned source"| node_rep_service
node_watch_counting -.->|"feeds motion data"| node_quality_analysis
node_workout_model -.->|"planned history"| node_history_tools
node_workout_model -.->|"planned support"| node_templates_export

click node_composition "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/EpochLiftsApp.swift"
click node_workout_list "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutListView.swift"
click node_active_workout "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/ActiveWorkoutView.swift"
click node_log_set "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/LogSetView.swift"
click node_workout_detail "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutDetailView.swift"
click node_timer "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutTimerView.swift"
click node_view_model "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/ViewModels/WorkoutViewModel.swift"
click node_exercise_picker "https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/ExercisePickerView.swift"
click node_set_input "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Input/SetInput.swift"
click node_rep_service "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/RepCounting/RepCountingService.swift"
click node_manual_counter "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/RepCounting/ManualRepCounter.swift"
click node_rep_event "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/RepCounting/RepEvent.swift"
click node_exercise_type "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/ExerciseType.swift"
click node_workout_model "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/Workout.swift"
click node_logged_exercise "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/LoggedExercise.swift"
click node_logged_set "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/LoggedSet.swift"
click node_rep_source "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/RepCountSource.swift"
click node_storage_contract "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Persistence/WorkoutStorage.swift"
click node_file_storage "https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Persistence/FileWorkoutStorage.swift"

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_composition,node_workout_list,node_active_workout,node_log_set,node_workout_detail,node_timer,node_view_model,node_exercise_picker toneBlue
class node_set_input,node_rep_service,node_manual_counter,node_rep_event,node_exercise_type,node_workout_model,node_logged_exercise,node_logged_set,node_rep_source,node_storage_contract,node_file_storage toneAmber
class node_watch_counting,node_motion_replay,node_quality_analysis,node_history_tools,node_templates_export toneMint
class node_user toneIndigo
```

## Components

### iPhone App

- [App Wiring](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/EpochLiftsApp.swift): `EpochLifts/EpochLiftsApp.swift`
- [Workout List](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutListView.swift): `EpochLifts/Views/WorkoutListView.swift`
- [Active Workout](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/ActiveWorkoutView.swift): `EpochLifts/Views/ActiveWorkoutView.swift`
- [Log Set](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/LogSetView.swift): `EpochLifts/Views/LogSetView.swift`
- [Workout Detail](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutDetailView.swift): `EpochLifts/Views/WorkoutDetailView.swift`
- [Workout Timer](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/WorkoutTimerView.swift): `EpochLifts/Views/WorkoutTimerView.swift`
- [Workout State](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/ViewModels/WorkoutViewModel.swift): `EpochLifts/ViewModels/WorkoutViewModel.swift`
- [Exercise Picker](https://github.com/evan-king-dev/epoch-lifts/blob/main/EpochLifts/Views/ExercisePickerView.swift): `EpochLifts/Views/ExercisePickerView.swift`

### Workout Core

- [Input Parsing](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Input/SetInput.swift): `WorkoutCore/Sources/WorkoutCore/Input/SetInput.swift`
- [Counter Contract](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/RepCounting/RepCountingService.swift): `WorkoutCore/Sources/WorkoutCore/RepCounting/RepCountingService.swift`
- [Manual Counter](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/RepCounting/ManualRepCounter.swift): `WorkoutCore/Sources/WorkoutCore/RepCounting/ManualRepCounter.swift`
- [Rep Events](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/RepCounting/RepEvent.swift): `WorkoutCore/Sources/WorkoutCore/RepCounting/RepEvent.swift`
- [Exercise Catalog](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/ExerciseType.swift): `WorkoutCore/Sources/WorkoutCore/Models/ExerciseType.swift`
- [Workout Records](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/Workout.swift): `WorkoutCore/Sources/WorkoutCore/Models/Workout.swift`
- [Logged Exercise](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/LoggedExercise.swift): `WorkoutCore/Sources/WorkoutCore/Models/LoggedExercise.swift`
- [Logged Set](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/LoggedSet.swift): `WorkoutCore/Sources/WorkoutCore/Models/LoggedSet.swift`
- [Rep Source](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Models/RepCountSource.swift): `WorkoutCore/Sources/WorkoutCore/Models/RepCountSource.swift`
- [Storage Contract](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Persistence/WorkoutStorage.swift): `WorkoutCore/Sources/WorkoutCore/Persistence/WorkoutStorage.swift`
- [JSON File Store](https://github.com/evan-king-dev/epoch-lifts/blob/main/WorkoutCore/Sources/WorkoutCore/Persistence/FileWorkoutStorage.swift): `WorkoutCore/Sources/WorkoutCore/Persistence/FileWorkoutStorage.swift`

### Planned Capabilities

- **Watch Rep Counting**
- **Motion Replay**
- **Rep Quality ML**
- **History Tools**
- **Templates and Export**

### Other components

- **Lifter**

## Connections

- App Wiring → Workout List: launches (evidence: `EpochLifts/EpochLiftsApp.swift`)
- App Wiring → Workout State: creates (evidence: `EpochLifts/EpochLiftsApp.swift`)
- App Wiring → JSON File Store: configures (evidence: `EpochLifts/EpochLiftsApp.swift`)
- App Wiring → Manual Counter: configures (evidence: `EpochLifts/EpochLiftsApp.swift`)
- Lifter → Workout List: starts or browses (evidence: `README.md`)
- Workout List → Workout State: starts and deletes (evidence: `EpochLifts/Views/WorkoutListView.swift`)
- Workout List → Active Workout: opens (evidence: `EpochLifts/Views/WorkoutListView.swift`)
- Workout List → Workout Detail: opens (evidence: `EpochLifts/Views/WorkoutListView.swift`)
- Active Workout → Workout State: logs and edits (evidence: `EpochLifts/Views/ActiveWorkoutView.swift`)
- Active Workout → Exercise Picker: presents (evidence: `EpochLifts/Views/ActiveWorkoutView.swift`)
- Active Workout → Log Set: renders (evidence: `EpochLifts/Views/ActiveWorkoutView.swift`)
- Active Workout → Workout Timer: renders (evidence: `EpochLifts/Views/ActiveWorkoutView.swift`)
- Log Set → Workout State: submits set (evidence: `EpochLifts/Views/LogSetView.swift`)
- Workout Detail → Workout State: reads and deletes (evidence: `EpochLifts/Views/WorkoutDetailView.swift`)
- Exercise Picker → Exercise Catalog: offers catalog (evidence: `EpochLifts/Views/ExercisePickerView.swift`)
- Workout State → Input Parsing: validates input (evidence: `EpochLifts/ViewModels/WorkoutViewModel.swift`)
- Workout State → Storage Contract: loads and saves (evidence: `EpochLifts/ViewModels/WorkoutViewModel.swift`)
- Workout State → Counter Contract: controls counter (evidence: `EpochLifts/ViewModels/WorkoutViewModel.swift`)
- Manual Counter → Counter Contract: implements (evidence: `WorkoutCore/Sources/WorkoutCore/RepCounting/ManualRepCounter.swift`)
- Manual Counter → Rep Events: emits (evidence: `WorkoutCore/Sources/WorkoutCore/RepCounting/ManualRepCounter.swift`)
- Workout State → Workout Records: updates history (evidence: `EpochLifts/ViewModels/WorkoutViewModel.swift`)
- JSON File Store → Storage Contract: implements (evidence: `WorkoutCore/Sources/WorkoutCore/Persistence/FileWorkoutStorage.swift`)
- Workout State → Watch Rep Counting: can accept counter (evidence: `README.md`)
- Workout State → Motion Replay: can accept counter (evidence: `README.md`)
- Watch Rep Counting → Rep Events: sends live events (evidence: `README.md`)
- Motion Replay → Counter Contract: planned source (evidence: `README.md`)
- Watch Rep Counting → Rep Quality ML: feeds motion data (evidence: `README.md`)
- Workout Records → History Tools: planned history (evidence: `README.md`)
- Workout Records → Templates and Export: planned support (evidence: `README.md`)
