# arijitwayne/fitdex architecture

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

- Interactive diagram: https://gitdiagram.com/arijitwayne/fitdex
- Repository: https://github.com/arijitwayne/fitdex

## Overview

FitDex is a local-first Android fitness companion with a retro-RPG presentation. The main user journey is to enter through the app, log and plan training, track nutrition, and review progress and game-like rewards; records remain on-device. The README also documents exercise demonstrations, audio, portable backups, and release updates. Source excerpts confirm app routing, workout completion and gamification interactions, and update fetching; other feature wiring is represented only where documented, so uncertain calls are omitted.

Main entry points: [`src/app/App.tsx`](https://github.com/arijitwayne/fitdex/blob/main/src/app/App.tsx) (App routing), [`src/features/gamification/gamificationRepository.ts`](https://github.com/arijitwayne/fitdex/blob/main/src/features/gamification/gamificationRepository.ts) (RPG rewards), [`src/features/workout/workoutRepository.ts`](https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/workoutRepository.ts) (Workout sessions), [`src/App.tsx`](https://github.com/arijitwayne/fitdex/blob/main/src/App.tsx) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_entry["App entry<br/>[App.tsx]"]
  node_app_shell["App routing<br/>[App.tsx]"]
end

subgraph group_training["Training"]
  node_workout_page["Workout hub<br/>[WorkoutPage.tsx]"]
  node_workout_repo["Workout sessions"]
  node_routine_repo["Routine plans"]
  node_weekly_plan["Weekly plan<br/>[weeklyPlan.ts]"]
  node_exercise_dex["Exercise Dex<br/>[ExerciseDex.tsx]"]
  node_exercise_media["Exercise media"]
end

subgraph group_wellness["Nutrition and progress"]
  node_food_page["Food log<br/>[FoodPage.tsx]"]
  node_food_repo["Food records<br/>[foodRepository.ts]"]
  node_nutrition_targets["Nutrition targets"]
  node_progress_page["Progress review<br/>[ProgressPage.tsx]"]
  node_progress_repo["Progress analytics"]
  node_journal_page["Training journal<br/>[JournalPage.tsx]"]
end

subgraph group_engagement["Motivation and personalization"]
  node_gamification["RPG rewards"]
  node_profile["Profile and avatar"]
  node_audio["Retro audio<br/>[AudioProvider.tsx]"]
end

subgraph group_platform["Local data and services"]
  node_media_service["Media service"]
  node_backup["Portable backup<br/>[BackupSettings.tsx]"]
  node_database[("Local database<br/>[database.ts]")]
  node_updater["Release updates<br/>[updaterService.ts]"]
end

node_athlete(("Athlete"))
node_github["GitHub releases"]

node_athlete -->|"opens"| node_entry
node_entry -->|"renders"| node_app_shell
node_app_shell -->|"routes"| node_workout_page
node_app_shell -->|"routes"| node_food_page
node_app_shell -->|"routes"| node_progress_page
node_app_shell -->|"routes"| node_journal_page
node_workout_repo -->|"reads and writes"| node_database
node_workout_repo -->|"reconciles rewards"| node_gamification
node_gamification -->|"reads and writes"| node_database
node_gamification -->|"loads progress"| node_progress_repo
node_gamification -->|"evaluates targets"| node_nutrition_targets
node_exercise_media -.->|"streams demos"| node_media_service
node_updater -.->|"fetches releases"| node_github

click node_entry "https://github.com/arijitwayne/fitdex/blob/main/src/App.tsx"
click node_app_shell "https://github.com/arijitwayne/fitdex/blob/main/src/app/App.tsx"
click node_workout_page "https://github.com/arijitwayne/fitdex/blob/main/src/pages/WorkoutPage.tsx"
click node_workout_repo "https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/workoutRepository.ts"
click node_routine_repo "https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/routineRepository.ts"
click node_weekly_plan "https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/weeklyPlan.ts"
click node_exercise_dex "https://github.com/arijitwayne/fitdex/blob/main/src/features/exerciseDex/ExerciseDex.tsx"
click node_exercise_media "https://github.com/arijitwayne/fitdex/blob/main/src/features/exerciseMedia/exerciseMediaResolver.ts"
click node_food_page "https://github.com/arijitwayne/fitdex/blob/main/src/pages/FoodPage.tsx"
click node_food_repo "https://github.com/arijitwayne/fitdex/blob/main/src/features/food/foodRepository.ts"
click node_nutrition_targets "https://github.com/arijitwayne/fitdex/blob/main/src/features/nutritionTargets/nutritionTargetRepository.ts"
click node_progress_page "https://github.com/arijitwayne/fitdex/blob/main/src/pages/ProgressPage.tsx"
click node_progress_repo "https://github.com/arijitwayne/fitdex/blob/main/src/features/progress/progressRepository.ts"
click node_journal_page "https://github.com/arijitwayne/fitdex/blob/main/src/pages/JournalPage.tsx"
click node_gamification "https://github.com/arijitwayne/fitdex/blob/main/src/features/gamification/gamificationRepository.ts"
click node_profile "https://github.com/arijitwayne/fitdex/blob/main/src/features/profile/ProfileProvider.tsx"
click node_audio "https://github.com/arijitwayne/fitdex/blob/main/src/features/audio/AudioProvider.tsx"
click node_backup "https://github.com/arijitwayne/fitdex/blob/main/src/features/backup/BackupSettings.tsx"
click node_database "https://github.com/arijitwayne/fitdex/blob/main/src/data/database.ts"
click node_updater "https://github.com/arijitwayne/fitdex/blob/main/src/features/updater/updaterService.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_entry,node_app_shell toneBlue
class node_workout_page,node_workout_repo,node_routine_repo,node_weekly_plan,node_exercise_dex,node_exercise_media toneAmber
class node_food_page,node_food_repo,node_nutrition_targets,node_progress_page,node_progress_repo,node_journal_page toneMint
class node_gamification,node_profile,node_audio toneRose
class node_media_service,node_backup,node_database,node_updater,node_athlete,node_github toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/arijitwayne/fitdex/blob/main/src/App.tsx): `src/App.tsx`
- [App routing](https://github.com/arijitwayne/fitdex/blob/main/src/app/App.tsx): `src/app/App.tsx`

### Training

- [Workout hub](https://github.com/arijitwayne/fitdex/blob/main/src/pages/WorkoutPage.tsx): `src/pages/WorkoutPage.tsx`
- [Workout sessions](https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/workoutRepository.ts): `src/features/workout/workoutRepository.ts`
- [Routine plans](https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/routineRepository.ts): `src/features/workout/routineRepository.ts`
- [Weekly plan](https://github.com/arijitwayne/fitdex/blob/main/src/features/workout/weeklyPlan.ts): `src/features/workout/weeklyPlan.ts`
- [Exercise Dex](https://github.com/arijitwayne/fitdex/blob/main/src/features/exerciseDex/ExerciseDex.tsx): `src/features/exerciseDex/ExerciseDex.tsx`
- [Exercise media](https://github.com/arijitwayne/fitdex/blob/main/src/features/exerciseMedia/exerciseMediaResolver.ts): `src/features/exerciseMedia/exerciseMediaResolver.ts`

### Nutrition and progress

- [Food log](https://github.com/arijitwayne/fitdex/blob/main/src/pages/FoodPage.tsx): `src/pages/FoodPage.tsx`
- [Food records](https://github.com/arijitwayne/fitdex/blob/main/src/features/food/foodRepository.ts): `src/features/food/foodRepository.ts`
- [Nutrition targets](https://github.com/arijitwayne/fitdex/blob/main/src/features/nutritionTargets/nutritionTargetRepository.ts): `src/features/nutritionTargets/nutritionTargetRepository.ts`
- [Progress review](https://github.com/arijitwayne/fitdex/blob/main/src/pages/ProgressPage.tsx): `src/pages/ProgressPage.tsx`
- [Progress analytics](https://github.com/arijitwayne/fitdex/blob/main/src/features/progress/progressRepository.ts): `src/features/progress/progressRepository.ts`
- [Training journal](https://github.com/arijitwayne/fitdex/blob/main/src/pages/JournalPage.tsx): `src/pages/JournalPage.tsx`

### Motivation and personalization

- [RPG rewards](https://github.com/arijitwayne/fitdex/blob/main/src/features/gamification/gamificationRepository.ts): `src/features/gamification/gamificationRepository.ts`
- [Profile and avatar](https://github.com/arijitwayne/fitdex/blob/main/src/features/profile/ProfileProvider.tsx): `src/features/profile/ProfileProvider.tsx`
- [Retro audio](https://github.com/arijitwayne/fitdex/blob/main/src/features/audio/AudioProvider.tsx): `src/features/audio/AudioProvider.tsx`

### Local data and services

- **Media service**
- [Portable backup](https://github.com/arijitwayne/fitdex/blob/main/src/features/backup/BackupSettings.tsx): `src/features/backup/BackupSettings.tsx`
- [Local database](https://github.com/arijitwayne/fitdex/blob/main/src/data/database.ts): `src/data/database.ts`
- [Release updates](https://github.com/arijitwayne/fitdex/blob/main/src/features/updater/updaterService.ts): `src/features/updater/updaterService.ts`

### Other components

- **Athlete**
- **GitHub releases**

## Connections

- Athlete → App entry: opens
- App entry → App routing: renders
- App routing → Workout hub: routes
- App routing → Food log: routes
- App routing → Progress review: routes
- App routing → Training journal: routes
- Workout sessions → Local database: reads and writes
- Workout sessions → RPG rewards: reconciles rewards
- RPG rewards → Local database: reads and writes
- RPG rewards → Progress analytics: loads progress
- RPG rewards → Nutrition targets: evaluates targets
- Exercise media → Media service: streams demos
- Release updates → GitHub releases: fetches releases
