# skunsky00/gymbro-ios architecture

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

- Interactive diagram: https://gitdiagram.com/skunsky00/gymbro-ios
- Repository: https://github.com/skunsky00/gymbro-ios

## Overview

Gym Bro is an iOS fitness-social app for finding workout partners and, optionally, dating matches. The user journey runs from phone authentication through profile and photo onboarding into discovery, likes, and mutual-match conversations or proposed gym sessions; profile preferences, premium access, and safety tools support that journey. The graph includes the central routing, feature views/view models, and service layer. Several feature implementations were not sampled, so their relationships are shown only where imports or excerpts support them; unverified links are omitted.

Main entry points: [`Gym Bro/Features/MainTab/MainTabView.swift`](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/MainTab/MainTabView.swift) (Main Tabs), [`Gym Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift`](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift) (Profile Setup), [`Gym Bro/Features/Authentication/ViewModel/AuthViewModel.swift`](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Authentication/ViewModel/AuthViewModel.swift) (Authentication), [`Gym Bro/Features/Likes/View/LikesView.swift`](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Likes/View/LikesView.swift) (Incoming Likes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Shell"]
  node_router["App Router<br/>[AppRouter.swift]"]
  node_main_tabs["Main Tabs<br/>[MainTabView.swift]"]
end

subgraph group_setup["Account Setup"]
  node_auth_ui["Phone Entry"]
  node_auth_vm["Authentication"]
  node_onboarding_ui["Onboarding Flow"]
  node_onboarding_vm["Profile Setup"]
end

subgraph group_social["Social Discovery"]
  node_discover_ui["Discover<br/>[DiscoverView.swift]"]
  node_discover_vm["Discovery Logic"]
  node_likes_ui["Incoming Likes<br/>[LikesView.swift]"]
  node_likes_vm["Likes Logic"]
end

subgraph group_engagement["Engagement"]
  node_match_ui["Matches and Chat<br/>[MatchesView.swift]"]
  node_chat_vm["Chat Logic"]
  node_session_ui["Gym Sessions"]
  node_profile_ui["Profile and Settings<br/>[ProfileView.swift]"]
  node_paywall["Premium Paywall<br/>[PaywallView.swift]"]
  node_safety["Reporting and Blocking<br/>[ReportView.swift]"]
end

subgraph group_platform["Services and Models"]
  node_auth_service["Phone Auth Service<br/>[AuthService.swift]"]
  node_storage["Photo Moderation"]
  node_user_service["User Profiles<br/>[UserService.swift]"]
  node_user_model["User Profile Model<br/>[AppUser.swift]"]
  node_discover_service["Candidate Search"]
  node_prefs_model["Discovery Preferences"]
  node_match_service["Match and Messaging<br/>[MatchService.swift]"]
  node_purchase_service["Purchases"]
  node_entitlement["Premium Entitlements"]
  node_safety_service["Safety Service"]
end

node_user(("Gym-goer"))
node_firebase_auth{{"Firebase Auth"}}
node_firebase_storage{{"Firebase Storage and Functions"}}
node_firestore[("Cloud Firestore")]
node_revenuecat{{"RevenueCat"}}

node_user -->|"enters phone"| node_auth_ui
node_auth_ui -->|"submits code"| node_auth_vm
node_auth_vm -->|"requests verification"| node_auth_service
node_auth_service -->|"verifies identity"| node_firebase_auth
node_auth_vm -.->|"continues after sign-in"| node_onboarding_ui
node_onboarding_ui -->|"collects profile"| node_onboarding_vm
node_onboarding_vm -->|"loads and saves"| node_user_service
node_onboarding_vm -->|"uploads profile photos"| node_storage
node_storage -->|"uploads and moderates"| node_firebase_storage
node_user_service -.->|"persists profiles"| node_firestore
node_onboarding_vm -->|"builds profile data"| node_user_model
node_user_model -->|"contains preferences"| node_prefs_model
node_main_tabs -->|"routes tabs"| node_router
node_main_tabs -->|"opens discovery"| node_discover_ui
node_main_tabs -->|"opens likes"| node_likes_ui
node_main_tabs -->|"opens matches"| node_match_ui
node_main_tabs -->|"opens profile"| node_profile_ui
node_discover_ui -.->|"presents results"| node_discover_vm
node_discover_vm -.->|"loads candidates"| node_discover_service
node_discover_service -->|"queries profiles"| node_firestore
node_likes_ui -->|"renders incoming likes"| node_likes_vm
node_likes_vm -->|"likes back"| node_discover_service
node_likes_ui -->|"offers upgrade"| node_paywall
node_match_ui -.->|"opens conversations"| node_chat_vm
node_chat_vm -.->|"loads and sends messages"| node_match_service
node_session_ui -.->|"proposes sessions"| node_match_service
node_paywall -->|"starts purchase"| node_purchase_service
node_purchase_service -->|"purchases packages"| node_revenuecat
node_purchase_service -->|"refreshes status"| node_entitlement
node_safety -.->|"submits reports"| node_safety_service

click node_router "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/App/AppRouter.swift"
click node_main_tabs "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/MainTab/MainTabView.swift"
click node_auth_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Authentication/View/PhoneEntryView.swift"
click node_auth_vm "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Authentication/ViewModel/AuthViewModel.swift"
click node_auth_service "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/AuthService.swift"
click node_onboarding_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Onboarding/View/OnbaordingFlowView.swift"
click node_onboarding_vm "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift"
click node_storage "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/StorageService.swift"
click node_user_service "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/UserService.swift"
click node_user_model "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Models/AppUser.swift"
click node_discover_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Discover/View/DiscoverView.swift"
click node_discover_vm "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Discover/ViewModel/DiscoverViewModel.swift"
click node_discover_service "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/DiscoverService.swift"
click node_prefs_model "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Models/DiscoveryPrefs.swift"
click node_likes_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Likes/View/LikesView.swift"
click node_likes_vm "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Likes/ViewModel/LikesViewModel.swift"
click node_match_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Matches/View/MatchesView.swift"
click node_chat_vm "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Matches/ViewModel/ChatViewModel.swift"
click node_session_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Matches/View/ProposeSessionView.swift"
click node_match_service "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/MatchService.swift"
click node_profile_ui "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Profile/View/ProfileView.swift"
click node_paywall "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Paywall/View/PaywallView.swift"
click node_purchase_service "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/PurchaseService.swift"
click node_entitlement "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/EntitlementService.swift"
click node_safety "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Saftey/View/ReportView.swift"
click node_safety_service "https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/SafteyService.swift"

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_router,node_main_tabs toneBlue
class node_auth_ui,node_auth_vm,node_onboarding_ui,node_onboarding_vm,node_firebase_storage,node_firestore toneAmber
class node_discover_ui,node_discover_vm,node_likes_ui,node_likes_vm toneMint
class node_match_ui,node_chat_vm,node_session_ui,node_profile_ui,node_paywall,node_safety toneRose
class node_auth_service,node_storage,node_user_service,node_user_model,node_discover_service,node_prefs_model,node_match_service,node_purchase_service,node_entitlement,node_safety_service,node_user,node_firebase_auth,node_revenuecat toneIndigo
```

## Components

### App Shell

- [App Router](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/App/AppRouter.swift): `Gym Bro/App/AppRouter.swift`
- [Main Tabs](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/MainTab/MainTabView.swift): `Gym Bro/Features/MainTab/MainTabView.swift`

### Account Setup

- [Phone Entry](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Authentication/View/PhoneEntryView.swift): `Gym Bro/Features/Authentication/View/PhoneEntryView.swift`
- [Authentication](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Authentication/ViewModel/AuthViewModel.swift): `Gym Bro/Features/Authentication/ViewModel/AuthViewModel.swift`
- [Onboarding Flow](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Onboarding/View/OnbaordingFlowView.swift): `Gym Bro/Features/Onboarding/View/OnbaordingFlowView.swift`
- [Profile Setup](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift): `Gym Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift`

### Social Discovery

- [Discover](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Discover/View/DiscoverView.swift): `Gym Bro/Features/Discover/View/DiscoverView.swift`
- [Discovery Logic](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Discover/ViewModel/DiscoverViewModel.swift): `Gym Bro/Features/Discover/ViewModel/DiscoverViewModel.swift`
- [Incoming Likes](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Likes/View/LikesView.swift): `Gym Bro/Features/Likes/View/LikesView.swift`
- [Likes Logic](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Likes/ViewModel/LikesViewModel.swift): `Gym Bro/Features/Likes/ViewModel/LikesViewModel.swift`

### Engagement

- [Matches and Chat](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Matches/View/MatchesView.swift): `Gym Bro/Features/Matches/View/MatchesView.swift`
- [Chat Logic](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Matches/ViewModel/ChatViewModel.swift): `Gym Bro/Features/Matches/ViewModel/ChatViewModel.swift`
- [Gym Sessions](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Matches/View/ProposeSessionView.swift): `Gym Bro/Features/Matches/View/ProposeSessionView.swift`
- [Profile and Settings](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Profile/View/ProfileView.swift): `Gym Bro/Features/Profile/View/ProfileView.swift`
- [Premium Paywall](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Paywall/View/PaywallView.swift): `Gym Bro/Features/Paywall/View/PaywallView.swift`
- [Reporting and Blocking](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Features/Saftey/View/ReportView.swift): `Gym Bro/Features/Saftey/View/ReportView.swift`

### Services and Models

- [Phone Auth Service](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/AuthService.swift): `Gym Bro/Services/AuthService.swift`
- [Photo Moderation](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/StorageService.swift): `Gym Bro/Services/StorageService.swift`
- [User Profiles](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/UserService.swift): `Gym Bro/Services/UserService.swift`
- [User Profile Model](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Models/AppUser.swift): `Gym Bro/Models/AppUser.swift`
- [Candidate Search](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/DiscoverService.swift): `Gym Bro/Services/DiscoverService.swift`
- [Discovery Preferences](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Models/DiscoveryPrefs.swift): `Gym Bro/Models/DiscoveryPrefs.swift`
- [Match and Messaging](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/MatchService.swift): `Gym Bro/Services/MatchService.swift`
- [Purchases](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/PurchaseService.swift): `Gym Bro/Services/PurchaseService.swift`
- [Premium Entitlements](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/EntitlementService.swift): `Gym Bro/Services/EntitlementService.swift`
- [Safety Service](https://github.com/skunsky00/gymbro-ios/blob/main/Gym%20Bro/Services/SafteyService.swift): `Gym Bro/Services/SafteyService.swift`

### Other components

- **Gym-goer**
- **Firebase Auth**
- **Firebase Storage and Functions**
- **Cloud Firestore**
- **RevenueCat**

## Connections

- Gym-goer → Phone Entry: enters phone (evidence: `Gym Bro/Features/Authentication/View/PhoneEntryView.swift`)
- Phone Entry → Authentication: submits code (evidence: `Gym Bro/Features/Authentication/View/PhoneEntryView.swift`)
- Authentication → Phone Auth Service: requests verification (evidence: `Gym Bro/Features/Authentication/ViewModel/AuthViewModel.swift`)
- Phone Auth Service → Firebase Auth: verifies identity (evidence: `Gym Bro/Services/AuthService.swift`)
- Authentication → Onboarding Flow: continues after sign-in (evidence: `Gym Bro/Features/Onboarding/View/OnbaordingFlowView.swift`)
- Onboarding Flow → Profile Setup: collects profile (evidence: `Gym Bro/Features/Onboarding/View/OnbaordingFlowView.swift`)
- Profile Setup → User Profiles: loads and saves (evidence: `Gym Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift`)
- Profile Setup → Photo Moderation: uploads profile photos (evidence: `Gym Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift`)
- Photo Moderation → Firebase Storage and Functions: uploads and moderates (evidence: `Gym Bro/Services/StorageService.swift`)
- User Profiles → Cloud Firestore: persists profiles
- Profile Setup → User Profile Model: builds profile data (evidence: `Gym Bro/Features/Onboarding/ViewModel/OnboardingViewModel.swift`)
- User Profile Model → Discovery Preferences: contains preferences (evidence: `Gym Bro/Models/AppUser.swift`)
- Main Tabs → App Router: routes tabs (evidence: `Gym Bro/Features/MainTab/MainTabView.swift`)
- Main Tabs → Discover: opens discovery (evidence: `Gym Bro/Features/MainTab/MainTabView.swift`)
- Main Tabs → Incoming Likes: opens likes (evidence: `Gym Bro/Features/MainTab/MainTabView.swift`)
- Main Tabs → Matches and Chat: opens matches (evidence: `Gym Bro/Features/MainTab/MainTabView.swift`)
- Main Tabs → Profile and Settings: opens profile (evidence: `Gym Bro/Features/MainTab/MainTabView.swift`)
- Discover → Discovery Logic: presents results
- Discovery Logic → Candidate Search: loads candidates
- Candidate Search → Cloud Firestore: queries profiles (evidence: `Gym Bro/Services/DiscoverService.swift`)
- Incoming Likes → Likes Logic: renders incoming likes (evidence: `Gym Bro/Features/Likes/View/LikesView.swift`)
- Likes Logic → Candidate Search: likes back (evidence: `Gym Bro/Features/Likes/ViewModel/LikesViewModel.swift`)
- Incoming Likes → Premium Paywall: offers upgrade (evidence: `Gym Bro/Features/Likes/View/LikesView.swift`)
- Matches and Chat → Chat Logic: opens conversations
- Chat Logic → Match and Messaging: loads and sends messages
- Gym Sessions → Match and Messaging: proposes sessions
- Premium Paywall → Purchases: starts purchase (evidence: `Gym Bro/Features/Paywall/View/PaywallView.swift`)
- Purchases → RevenueCat: purchases packages (evidence: `Gym Bro/Services/PurchaseService.swift`)
- Purchases → Premium Entitlements: refreshes status (evidence: `Gym Bro/Services/PurchaseService.swift`)
- Reporting and Blocking → Safety Service: submits reports
