# nyxar77/pulse architecture

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

- Interactive diagram: https://gitdiagram.com/nyxar77/pulse
- Repository: https://github.com/nyxar77/pulse

## Overview

Pulse is an offline-first weekly workout planner. Users open the app to see today’s workout, build a weekly routine from built-in or custom exercises, track sets and completion, and retain their programme locally. The main screen also supports programme backup and image preferences. The README documents additional capabilities such as muscle maps, themes, and export/import; these are represented as product subsystems, but their unsampled implementation links are left unverified. The graph is based on the README and sampled source excerpts.

Main entry points: [`src/routes/+page.svelte`](https://github.com/nyxar77/pulse/blob/master/src/routes/%2Bpage.svelte) (Workout screen), [`android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java`](https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java) (Android activity), [`src/lib/storage.ts`](https://github.com/nyxar77/pulse/blob/master/src/lib/storage.ts) (Ledger storage), [`src/lib/native.ts`](https://github.com/nyxar77/pulse/blob/master/src/lib/native.ts) (Native bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Workout planning"]
  node_workout_ui["Workout screen<br/>[+page.svelte]"]
  node_workout_ledger["Workout ledger<br/>[ledger.ts]"]
  node_workout_types["Workout data types<br/>[types.ts]"]
  node_workout_options["Planner options<br/>[options.ts]"]
  node_image_preference["Image preferences<br/>[data.ts]"]
end

subgraph group_library["Exercise library"]
  node_exercise_library["Exercise library"]
  node_default_exercises["Built-in exercises"]
  node_exercise_editor["Exercise editing<br/>[+page.svelte]"]
  node_tag_input["Tag input<br/>[TagCombobox.svelte]"]
  node_equipment_input["Equipment input"]
  node_muscle_map["Muscle maps<br/>[MuscleMap.svelte]"]
  node_muscle_data["Muscle map data<br/>[muscle-map.ts]"]
  node_image_cache["Exercise image cache"]
end

subgraph group_persistence["Local data and backup"]
  node_backup_logic["Programme backup<br/>[backup.ts]"]
  node_sheet_io["Import and export<br/>[sheet.ts]"]
  node_storage_api["Ledger storage<br/>[storage.ts]"]
  node_offline_store[("IndexedDB and fallback<br/>[storage.ts]")]
end

subgraph group_platform["Offline and Android"]
  node_native_bridge["Native bridge<br/>[native.ts]"]
  node_android_activity["Android activity<br/>[MainActivity.java]"]
  node_scoped_backup["Scoped backup plugin"]
  node_launcher_plugin["Launcher icon plugin"]
  node_service_worker["Service worker<br/>[service-worker.ts]"]
end

node_user(("User"))

node_user -->|"opens and edits"| node_workout_ui
node_workout_ui -->|"loads and saves"| node_storage_api
node_storage_api -->|"reads and writes"| node_offline_store
node_workout_ui -->|"sets image access"| node_image_cache
node_service_worker -->|"loads cached images"| node_image_cache
node_workout_ui -->|"writes backup"| node_native_bridge
node_android_activity -->|"registers"| node_launcher_plugin
node_android_activity -->|"registers"| node_scoped_backup
node_user -.->|"previews muscles"| node_muscle_map
node_user -.->|"imports or exports"| node_sheet_io
node_user -.->|"backs up programme"| node_backup_logic
node_user -.->|"adds exercises"| node_exercise_editor
node_user -.->|"tracks workout"| node_workout_ledger
node_user -.->|"sets preferences"| node_workout_options
node_user -.->|"starts with exercises"| node_default_exercises
node_user -.->|"browses exercises"| node_exercise_library
node_user -.->|"chooses image access"| node_image_preference
node_user -.->|"uses set details"| node_workout_types
node_user -.->|"enters exercise tags"| node_tag_input
node_user -.->|"enters equipment"| node_equipment_input
node_user -.->|"views muscle details"| node_muscle_data
node_native_bridge -.->|"invokes backup"| node_scoped_backup

click node_workout_ui "https://github.com/nyxar77/pulse/blob/master/src/routes/%2Bpage.svelte"
click node_workout_ledger "https://github.com/nyxar77/pulse/blob/master/src/lib/ledger.ts"
click node_workout_types "https://github.com/nyxar77/pulse/blob/master/src/lib/types.ts"
click node_workout_options "https://github.com/nyxar77/pulse/blob/master/src/lib/options.ts"
click node_exercise_library "https://github.com/nyxar77/pulse/blob/master/src/lib/exercise-library.ts"
click node_default_exercises "https://github.com/nyxar77/pulse/blob/master/src/lib/default-exercises.ts"
click node_exercise_editor "https://github.com/nyxar77/pulse/blob/master/src/routes/%2Bpage.svelte"
click node_tag_input "https://github.com/nyxar77/pulse/blob/master/src/lib/components/TagCombobox.svelte"
click node_equipment_input "https://github.com/nyxar77/pulse/blob/master/src/lib/components/AutocompleteInput.svelte"
click node_muscle_map "https://github.com/nyxar77/pulse/blob/master/src/lib/components/MuscleMap.svelte"
click node_muscle_data "https://github.com/nyxar77/pulse/blob/master/src/lib/muscle-map.ts"
click node_image_cache "https://github.com/nyxar77/pulse/blob/master/src/lib/exercise-image-cache.ts"
click node_image_preference "https://github.com/nyxar77/pulse/blob/master/src/lib/data.ts"
click node_backup_logic "https://github.com/nyxar77/pulse/blob/master/src/lib/backup.ts"
click node_sheet_io "https://github.com/nyxar77/pulse/blob/master/src/lib/sheet.ts"
click node_storage_api "https://github.com/nyxar77/pulse/blob/master/src/lib/storage.ts"
click node_offline_store "https://github.com/nyxar77/pulse/blob/master/src/lib/storage.ts"
click node_native_bridge "https://github.com/nyxar77/pulse/blob/master/src/lib/native.ts"
click node_android_activity "https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java"
click node_scoped_backup "https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/ScopedBackupPlugin.java"
click node_launcher_plugin "https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/LauncherIconPlugin.java"
click node_service_worker "https://github.com/nyxar77/pulse/blob/master/src/service-worker.ts"

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_workout_ui,node_workout_ledger,node_workout_types,node_workout_options,node_image_preference,node_user toneBlue
class node_exercise_library,node_default_exercises,node_exercise_editor,node_tag_input,node_equipment_input,node_muscle_map,node_muscle_data,node_image_cache toneAmber
class node_backup_logic,node_sheet_io,node_storage_api,node_offline_store toneMint
class node_native_bridge,node_android_activity,node_scoped_backup,node_launcher_plugin,node_service_worker toneRose
```

## Components

### Workout planning

- [Workout screen](https://github.com/nyxar77/pulse/blob/master/src/routes/%2Bpage.svelte): `src/routes/+page.svelte`
- [Workout ledger](https://github.com/nyxar77/pulse/blob/master/src/lib/ledger.ts): `src/lib/ledger.ts`
- [Workout data types](https://github.com/nyxar77/pulse/blob/master/src/lib/types.ts): `src/lib/types.ts`
- [Planner options](https://github.com/nyxar77/pulse/blob/master/src/lib/options.ts): `src/lib/options.ts`
- [Image preferences](https://github.com/nyxar77/pulse/blob/master/src/lib/data.ts): `src/lib/data.ts`

### Exercise library

- [Exercise library](https://github.com/nyxar77/pulse/blob/master/src/lib/exercise-library.ts): `src/lib/exercise-library.ts`
- [Built-in exercises](https://github.com/nyxar77/pulse/blob/master/src/lib/default-exercises.ts): `src/lib/default-exercises.ts`
- [Exercise editing](https://github.com/nyxar77/pulse/blob/master/src/routes/%2Bpage.svelte): `src/routes/+page.svelte`
- [Tag input](https://github.com/nyxar77/pulse/blob/master/src/lib/components/TagCombobox.svelte): `src/lib/components/TagCombobox.svelte`
- [Equipment input](https://github.com/nyxar77/pulse/blob/master/src/lib/components/AutocompleteInput.svelte): `src/lib/components/AutocompleteInput.svelte`
- [Muscle maps](https://github.com/nyxar77/pulse/blob/master/src/lib/components/MuscleMap.svelte): `src/lib/components/MuscleMap.svelte`
- [Muscle map data](https://github.com/nyxar77/pulse/blob/master/src/lib/muscle-map.ts): `src/lib/muscle-map.ts`
- [Exercise image cache](https://github.com/nyxar77/pulse/blob/master/src/lib/exercise-image-cache.ts): `src/lib/exercise-image-cache.ts`

### Local data and backup

- [Programme backup](https://github.com/nyxar77/pulse/blob/master/src/lib/backup.ts): `src/lib/backup.ts`
- [Import and export](https://github.com/nyxar77/pulse/blob/master/src/lib/sheet.ts): `src/lib/sheet.ts`
- [Ledger storage](https://github.com/nyxar77/pulse/blob/master/src/lib/storage.ts): `src/lib/storage.ts`
- [IndexedDB and fallback](https://github.com/nyxar77/pulse/blob/master/src/lib/storage.ts): `src/lib/storage.ts`

### Offline and Android

- [Native bridge](https://github.com/nyxar77/pulse/blob/master/src/lib/native.ts): `src/lib/native.ts`
- [Android activity](https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java): `android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java`
- [Scoped backup plugin](https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/ScopedBackupPlugin.java): `android/app/src/main/java/io/github/nyxar77/pulse/ScopedBackupPlugin.java`
- [Launcher icon plugin](https://github.com/nyxar77/pulse/blob/master/android/app/src/main/java/io/github/nyxar77/pulse/LauncherIconPlugin.java): `android/app/src/main/java/io/github/nyxar77/pulse/LauncherIconPlugin.java`
- [Service worker](https://github.com/nyxar77/pulse/blob/master/src/service-worker.ts): `src/service-worker.ts`

### Other components

- **User**

## Connections

- User → Workout screen: opens and edits (evidence: `README.md`)
- Workout screen → Ledger storage: loads and saves (evidence: `src/routes/+page.svelte`)
- Ledger storage → IndexedDB and fallback: reads and writes (evidence: `src/lib/storage.ts`)
- Workout screen → Exercise image cache: sets image access (evidence: `src/routes/+page.svelte`)
- Service worker → Exercise image cache: loads cached images (evidence: `src/service-worker.ts`)
- Workout screen → Native bridge: writes backup (evidence: `src/routes/+page.svelte`)
- Android activity → Launcher icon plugin: registers (evidence: `android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java`)
- Android activity → Scoped backup plugin: registers (evidence: `android/app/src/main/java/io/github/nyxar77/pulse/MainActivity.java`)
- User → Muscle maps: previews muscles (evidence: `README.md`)
- User → Import and export: imports or exports (evidence: `README.md`)
- User → Programme backup: backs up programme (evidence: `README.md`)
- User → Exercise editing: adds exercises (evidence: `README.md`)
- User → Workout ledger: tracks workout (evidence: `README.md`)
- User → Planner options: sets preferences (evidence: `README.md`)
- User → Built-in exercises: starts with exercises (evidence: `README.md`)
- User → Exercise library: browses exercises (evidence: `README.md`)
- User → Image preferences: chooses image access
- User → Workout data types: uses set details (evidence: `README.md`)
- User → Tag input: enters exercise tags
- User → Equipment input: enters equipment
- User → Muscle map data: views muscle details (evidence: `README.md`)
- Native bridge → Scoped backup plugin: invokes backup
