# python-piyush/mygym architecture

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

- Interactive diagram: https://gitdiagram.com/python-piyush/mygym
- Repository: https://github.com/python-piyush/mygym

## Overview

MyGYM is an Android gym-rest timer. Users choose a muscle group, start, pause, or reset its countdown, and can edit rest durations either from the home screen or the settings list. The UI reads and saves per-muscle durations through Preferences DataStore, with defaults supplied by the timer model. The graph reflects the shown Compose code; it omits Android launch wiring and other relationships not evidenced by the excerpts.

Main entry points: [`app/src/main/java/com/boss/mygym/MainActivity.kt`](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/MainActivity.kt) (Home and timer), [`app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt) (Settings screen), [`app/src/main/java/com/boss/mygym/TimerSettings.kt`](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/TimerSettings.kt) (Duration preferences), [`app/src/main/java/com/boss/mygym/ui/theme/Theme.kt`](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Theme.kt) (Theme provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_timer["Timer experience"]
  node_main["Home and timer<br/>[MainActivity.kt]"]
  node_defaults["Muscle defaults<br/>[GymTimer.kt]"]
end

subgraph group_settings["Duration settings"]
  node_settings_screen["Settings screen"]
  node_editor["Duration editor"]
end

subgraph group_storage["Duration storage"]
  node_settings_api["Duration preferences<br/>[TimerSettings.kt]"]
  node_datastore[("Preferences DataStore")]
end

subgraph group_theme["UI theme"]
  node_theme["Theme provider<br/>[Theme.kt]"]
  node_colors["Theme colors<br/>[Color.kt]"]
  node_typography["Typography<br/>[Type.kt]"]
end

node_user(("Gym user"))

node_user -->|"uses timer"| node_main
node_main -->|"applies theme"| node_theme
node_theme -->|"uses palette"| node_colors
node_theme -->|"uses typography"| node_typography
node_main -->|"shows settings"| node_settings_screen
node_main -->|"lists muscle groups"| node_defaults
node_main -->|"reads duration"| node_settings_api
node_main -->|"opens editor"| node_editor
node_settings_screen -->|"lists muscle groups"| node_defaults
node_settings_screen -->|"reads durations"| node_settings_api
node_settings_screen -->|"opens editor"| node_editor
node_editor -->|"saves duration"| node_settings_api
node_settings_api -->|"reads and writes"| node_datastore

click node_main "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/MainActivity.kt"
click node_defaults "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/GymTimer.kt"
click node_settings_screen "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt"
click node_editor "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt"
click node_settings_api "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/TimerSettings.kt"
click node_theme "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Theme.kt"
click node_colors "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Color.kt"
click node_typography "https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Type.kt"

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_defaults,node_user toneBlue
class node_settings_screen,node_editor toneAmber
class node_settings_api,node_datastore toneMint
class node_theme,node_colors,node_typography toneRose
```

## Components

### Timer experience

- [Home and timer](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/MainActivity.kt): `app/src/main/java/com/boss/mygym/MainActivity.kt`
- [Muscle defaults](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/GymTimer.kt): `app/src/main/java/com/boss/mygym/GymTimer.kt`

### Duration settings

- [Settings screen](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt): `app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`
- [Duration editor](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt): `app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`

### Duration storage

- [Duration preferences](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/TimerSettings.kt): `app/src/main/java/com/boss/mygym/TimerSettings.kt`
- **Preferences DataStore**

### UI theme

- [Theme provider](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Theme.kt): `app/src/main/java/com/boss/mygym/ui/theme/Theme.kt`
- [Theme colors](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Color.kt): `app/src/main/java/com/boss/mygym/ui/theme/Color.kt`
- [Typography](https://github.com/python-piyush/mygym/blob/main/app/src/main/java/com/boss/mygym/ui/theme/Type.kt): `app/src/main/java/com/boss/mygym/ui/theme/Type.kt`

### Other components

- **Gym user**

## Connections

- Gym user → Home and timer: uses timer (evidence: `app/src/main/java/com/boss/mygym/MainActivity.kt`)
- Home and timer → Theme provider: applies theme (evidence: `app/src/main/java/com/boss/mygym/MainActivity.kt`)
- Theme provider → Theme colors: uses palette (evidence: `app/src/main/java/com/boss/mygym/ui/theme/Theme.kt`)
- Theme provider → Typography: uses typography (evidence: `app/src/main/java/com/boss/mygym/ui/theme/Theme.kt`)
- Home and timer → Settings screen: shows settings (evidence: `app/src/main/java/com/boss/mygym/MainActivity.kt`)
- Home and timer → Muscle defaults: lists muscle groups (evidence: `app/src/main/java/com/boss/mygym/MainActivity.kt`)
- Home and timer → Duration preferences: reads duration (evidence: `app/src/main/java/com/boss/mygym/MainActivity.kt`)
- Home and timer → Duration editor: opens editor (evidence: `app/src/main/java/com/boss/mygym/MainActivity.kt`)
- Settings screen → Muscle defaults: lists muscle groups (evidence: `app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`)
- Settings screen → Duration preferences: reads durations (evidence: `app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`)
- Settings screen → Duration editor: opens editor (evidence: `app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`)
- Duration editor → Duration preferences: saves duration (evidence: `app/src/main/java/com/boss/mygym/DurationSettingsScreen.kt`)
- Duration preferences → Preferences DataStore: reads and writes (evidence: `app/src/main/java/com/boss/mygym/TimerSettings.kt`)
