# brandonp2412/flexify architecture

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

- Interactive diagram: https://gitdiagram.com/brandonp2412/flexify
- Repository: https://github.com/brandonp2412/flexify

## Overview

Flexify is an offline-first workout tracker. Users create plans, record training sessions (including weights, reps, cardio, and rest), then review exercise history and progress graphs; settings customize behavior and appearance. The README documents these capabilities, while the supplied source excerpts chiefly show Android timer handling. The graph therefore uses the documented product areas and tree paths for Flutter subsystems, and limits native timer wiring to what the excerpts support; unsampled Flutter internals are not inferred.

Main entry points: [`lib`](https://github.com/brandonp2412/flexify/tree/main/lib) (Flexify app), [`lib/database`](https://github.com/brandonp2412/flexify/tree/main/lib/database) (Local database), [`android/app/src/main/kotlin/com/presley/flexify/MainActivity.kt`](https://github.com/brandonp2412/flexify/blob/main/android/app/src/main/kotlin/com/presley/flexify/MainActivity.kt) (Android bridge), [`lib/timer`](https://github.com/brandonp2412/flexify/tree/main/lib/timer) (Rest timer UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workouts["Workout tracking"]
  node_plans["Workout plans"]
  node_sets["Training logs"]
  node_timer_ui["Rest timer UI"]
end

subgraph group_insights["Progress insights"]
  node_history["Exercise history"]
  node_graphs["Progress graphs"]
end

subgraph group_appdata["Local app data"]
  node_settings["Preferences"]
  node_database[("Local database")]
  node_audio["Audio behavior"]
end

subgraph group_timer["Timer integration"]
  node_android["Android bridge<br/>[MainActivity.kt]"]
  node_timer_service["Timer service<br/>[TimerService.kt]"]
end

node_user(("Trainee"))
node_app["Flexify app"]
node_android_os["Android notifications"]

node_user -->|"uses"| node_app
node_app -->|"opens plans"| node_plans
node_app -->|"records training"| node_sets
node_app -->|"starts rest"| node_timer_ui
node_app -->|"reviews history"| node_history
node_app -->|"views progress"| node_graphs
node_app -->|"configures"| node_settings
node_plans -->|"stores plans"| node_database
node_sets -->|"stores logs"| node_database
node_history -->|"reads history"| node_database
node_graphs -->|"reads records"| node_database
node_settings -->|"stores preferences"| node_database
node_timer_ui -->|"invokes methods"| node_android
node_android -->|"starts service"| node_timer_service
node_timer_service -->|"notifies and alarms"| node_android_os
node_android -->|"sends timer events"| node_timer_ui

click node_app "https://github.com/brandonp2412/flexify/tree/main/lib"
click node_plans "https://github.com/brandonp2412/flexify/tree/main/lib/plan"
click node_sets "https://github.com/brandonp2412/flexify/tree/main/lib/sets"
click node_timer_ui "https://github.com/brandonp2412/flexify/tree/main/lib/timer"
click node_history "https://github.com/brandonp2412/flexify/tree/main/lib/sets"
click node_graphs "https://github.com/brandonp2412/flexify/tree/main/lib/graph"
click node_settings "https://github.com/brandonp2412/flexify/tree/main/lib/settings"
click node_database "https://github.com/brandonp2412/flexify/tree/main/lib/database"
click node_audio "https://github.com/brandonp2412/flexify/tree/main/lib/audio"
click node_android "https://github.com/brandonp2412/flexify/blob/main/android/app/src/main/kotlin/com/presley/flexify/MainActivity.kt"
click node_timer_service "https://github.com/brandonp2412/flexify/blob/main/android/app/src/main/kotlin/com/presley/flexify/TimerService.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_plans,node_sets,node_timer_ui toneBlue
class node_history,node_graphs toneAmber
class node_settings,node_database,node_audio toneMint
class node_android,node_timer_service toneRose
class node_user,node_android_os toneIndigo
class node_app toneTeal
```

## Components

### Workout tracking

- [Workout plans](https://github.com/brandonp2412/flexify/tree/main/lib/plan): `lib/plan`
- [Training logs](https://github.com/brandonp2412/flexify/tree/main/lib/sets): `lib/sets`
- [Rest timer UI](https://github.com/brandonp2412/flexify/tree/main/lib/timer): `lib/timer`

### Progress insights

- [Exercise history](https://github.com/brandonp2412/flexify/tree/main/lib/sets): `lib/sets`
- [Progress graphs](https://github.com/brandonp2412/flexify/tree/main/lib/graph): `lib/graph`

### Local app data

- [Preferences](https://github.com/brandonp2412/flexify/tree/main/lib/settings): `lib/settings`
- [Local database](https://github.com/brandonp2412/flexify/tree/main/lib/database): `lib/database`
- [Audio behavior](https://github.com/brandonp2412/flexify/tree/main/lib/audio): `lib/audio`

### Timer integration

- [Android bridge](https://github.com/brandonp2412/flexify/blob/main/android/app/src/main/kotlin/com/presley/flexify/MainActivity.kt): `android/app/src/main/kotlin/com/presley/flexify/MainActivity.kt`
- [Timer service](https://github.com/brandonp2412/flexify/blob/main/android/app/src/main/kotlin/com/presley/flexify/TimerService.kt): `android/app/src/main/kotlin/com/presley/flexify/TimerService.kt`

### Other components

- **Trainee**
- [Flexify app](https://github.com/brandonp2412/flexify/tree/main/lib): `lib`
- **Android notifications**

## Connections

- Trainee → Flexify app: uses
- Flexify app → Workout plans: opens plans
- Flexify app → Training logs: records training
- Flexify app → Rest timer UI: starts rest
- Flexify app → Exercise history: reviews history
- Flexify app → Progress graphs: views progress
- Flexify app → Preferences: configures
- Workout plans → Local database: stores plans
- Training logs → Local database: stores logs
- Exercise history → Local database: reads history
- Progress graphs → Local database: reads records
- Preferences → Local database: stores preferences
- Rest timer UI → Android bridge: invokes methods
- Android bridge → Timer service: starts service
- Timer service → Android notifications: notifies and alarms
- Android bridge → Rest timer UI: sends timer events
