# ayaanator/superlift architecture

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

- Interactive diagram: https://gitdiagram.com/ayaanator/superlift
- Repository: https://github.com/ayaanator/superlift

## Overview

SuperLift is a cross-platform, offline-first workout log. Users start a session, select exercises, record sets and duration, and save workouts; they can then browse past sessions, view details, and edit or delete saved workouts. The documented product also includes gesture-driven workout interactions and an exercise catalog. The sampled code confirms exercise selection, shared workout state, database initialization, and edit persistence; wiring for several history and save flows is described in the README but not visible in the excerpts, so those links are omitted where ownership is uncertain.

Main entry points: [`database/database.js`](https://github.com/ayaanator/superlift/blob/main/database/database.js) (SQLite access), [`app/exercises.tsx`](https://github.com/ayaanator/superlift/blob/main/app/exercises.tsx) (Exercise picker), [`app/(tabs)/index.tsx`](https://github.com/ayaanator/superlift/blob/main/app/(tabs)/index.tsx) (Quick start), [`app/blocks/workoutPanelContext.tsx`](https://github.com/ayaanator/superlift/blob/main/app/blocks/workoutPanelContext.tsx) (Session state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App navigation"]
  node_root["App shell<br/>[_layout.tsx]"]
  node_home["Quick start<br/>[index.tsx]"]
end

subgraph group_logging["Workout logging"]
  node_workout_state["Session state"]
  node_workout_panel["Active workout<br/>[workoutPanel.tsx]"]
  node_exercise_picker["Exercise picker<br/>[exercises.tsx]"]
  node_exercise_catalog["Exercise catalog<br/>[exercises.js]"]
end

subgraph group_history["History and editing"]
  node_past_workouts["Workout history<br/>[pastWorkouts.tsx]"]
  node_workout_details["Session details<br/>[details.tsx]"]
  node_edit_workout["Edit session<br/>[editMode.tsx]"]
end

subgraph group_storage["Local data"]
  node_database["SQLite access<br/>[database.js]"]
  node_workout_store[("Workout database<br/>[database.js]")]
end

node_user(("Athlete"))

node_user -->|"starts session"| node_home
node_root -->|"initializes"| node_database
node_home -->|"toggles session"| node_workout_state
node_workout_state -->|"provides state"| node_workout_panel
node_workout_panel -->|"opens picker"| node_exercise_picker
node_exercise_picker -->|"loads catalog"| node_database
node_database -->|"reads and writes"| node_workout_store
node_exercise_picker -->|"selects exercises"| node_exercise_catalog
node_user -->|"browses sessions"| node_past_workouts
node_past_workouts -->|"opens session"| node_workout_details
node_user -->|"edits session"| node_edit_workout
node_edit_workout -->|"loads and updates"| node_database

click node_root "https://github.com/ayaanator/superlift/blob/main/app/_layout.tsx"
click node_home "https://github.com/ayaanator/superlift/blob/main/app/(tabs)/index.tsx"
click node_workout_state "https://github.com/ayaanator/superlift/blob/main/app/blocks/workoutPanelContext.tsx"
click node_workout_panel "https://github.com/ayaanator/superlift/blob/main/app/blocks/workoutPanel.tsx"
click node_exercise_picker "https://github.com/ayaanator/superlift/blob/main/app/exercises.tsx"
click node_exercise_catalog "https://github.com/ayaanator/superlift/blob/main/constants/exercises.js"
click node_past_workouts "https://github.com/ayaanator/superlift/blob/main/app/blocks/pastWorkouts.tsx"
click node_workout_details "https://github.com/ayaanator/superlift/blob/main/app/workouts/details.tsx"
click node_edit_workout "https://github.com/ayaanator/superlift/blob/main/app/workouts/editMode.tsx"
click node_database "https://github.com/ayaanator/superlift/blob/main/database/database.js"
click node_workout_store "https://github.com/ayaanator/superlift/blob/main/database/database.js"

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_root,node_home toneBlue
class node_workout_state,node_workout_panel,node_exercise_picker,node_exercise_catalog toneAmber
class node_past_workouts,node_workout_details,node_edit_workout toneMint
class node_database,node_workout_store toneRose
class node_user toneIndigo
```

## Components

### App navigation

- [App shell](https://github.com/ayaanator/superlift/blob/main/app/_layout.tsx): `app/_layout.tsx`
- [Quick start](https://github.com/ayaanator/superlift/blob/main/app/(tabs)/index.tsx): `app/(tabs)/index.tsx`

### Workout logging

- [Session state](https://github.com/ayaanator/superlift/blob/main/app/blocks/workoutPanelContext.tsx): `app/blocks/workoutPanelContext.tsx`
- [Active workout](https://github.com/ayaanator/superlift/blob/main/app/blocks/workoutPanel.tsx): `app/blocks/workoutPanel.tsx`
- [Exercise picker](https://github.com/ayaanator/superlift/blob/main/app/exercises.tsx): `app/exercises.tsx`
- [Exercise catalog](https://github.com/ayaanator/superlift/blob/main/constants/exercises.js): `constants/exercises.js`

### History and editing

- [Workout history](https://github.com/ayaanator/superlift/blob/main/app/blocks/pastWorkouts.tsx): `app/blocks/pastWorkouts.tsx`
- [Session details](https://github.com/ayaanator/superlift/blob/main/app/workouts/details.tsx): `app/workouts/details.tsx`
- [Edit session](https://github.com/ayaanator/superlift/blob/main/app/workouts/editMode.tsx): `app/workouts/editMode.tsx`

### Local data

- [SQLite access](https://github.com/ayaanator/superlift/blob/main/database/database.js): `database/database.js`
- [Workout database](https://github.com/ayaanator/superlift/blob/main/database/database.js): `database/database.js`

### Other components

- **Athlete**

## Connections

- Athlete → Quick start: starts session
- App shell → SQLite access: initializes
- Quick start → Session state: toggles session
- Session state → Active workout: provides state
- Active workout → Exercise picker: opens picker
- Exercise picker → SQLite access: loads catalog
- SQLite access → Workout database: reads and writes
- Exercise picker → Exercise catalog: selects exercises
- Athlete → Workout history: browses sessions
- Workout history → Session details: opens session
- Athlete → Edit session: edits session
- Edit session → SQLite access: loads and updates
