# mikhail0vvlad/powerlifting-assistant-android architecture

> Architecture diagram of the GitHub repository mikhail0vvlad/powerlifting-assistant-android, 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/mikhail0vvlad/powerlifting-assistant-android
- Repository: https://github.com/mikhail0vvlad/powerlifting-assistant-android
- Video tour (about a minute): https://gitdiagram.com/mikhail0vvlad/powerlifting-assistant-android/video

## Overview

Powerlifting Assistant is an Android training and nutrition client. Users enter through Firebase-backed authentication, then navigate to training programs, recovery, workout logging/history, nutrition and food search, profile, achievements, and utility screens; ViewModels and domain use cases coordinate repository operations, with REST-backed data cached locally. The README documents the broader screen set and MVVM/Clean Architecture; sampled repository code confirms API, token, and cache ownership for program, nutrition, and workout operations. Some unsampled screen-to-use-case wiring is therefore shown only at subsystem level.

Main entry points: [`app/src/main/java/com/powerlifting/assistant/presentation/viewmodel`](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/presentation/viewmodel) (ViewModels), [`app/src/main/java/com/powerlifting/assistant/data/repo`](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/data/repo) (Repository implementations), [`app/src/main/java/com/powerlifting/assistant/presentation/navigation/RootNav.kt`](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/presentation/navigation/RootNav.kt) (Auth navigation), [`app/src/main/java/com/powerlifting/assistant/MainActivity.kt`](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/MainActivity.kt) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_root["Auth navigation<br/>[RootNav.kt]"]
  node_screens["Compose screens"]
  node_viewmodels["ViewModels"]
  node_activity["App entry<br/>[MainActivity.kt]"]
end

subgraph group_domain["Domain"]
  node_usecases["Use cases"]
  node_models["Domain models"]
  node_interfaces["Repository contracts"]
  node_food["Food search"]
end

subgraph group_data["Data access"]
  node_implementations["Repository implementations"]
  node_api["REST API client<br/>[PowerliftingApi.kt]"]
  node_cache["Memory cache<br/>[AppCache.kt]"]
  node_token["Firebase token provider"]
end

subgraph group_local["Local services"]
  node_preferences[("App preferences<br/>[AppPreferences.kt]")]
  node_notifications["Reminder worker<br/>[ReminderWorker.kt]"]
  node_notificationutils["Notification utility"]
end

subgraph group_external["External services"]
  node_backend["Powerlifting REST server"]
  node_firebase["Firebase Authentication"]
  node_workmanager["WorkManager"]
end

node_person(("Athlete"))

node_person -->|"opens app"| node_root
node_root -->|"routes"| node_screens
node_screens -->|"dispatches actions"| node_viewmodels
node_viewmodels -->|"invokes"| node_usecases
node_usecases -->|"requests operations"| node_interfaces
node_interfaces -->|"implemented by"| node_implementations
node_implementations -->|"makes requests"| node_api
node_implementations -->|"gets bearer token"| node_token
node_token -->|"gets ID token"| node_firebase
node_api -->|"sends REST requests"| node_backend
node_implementations -->|"reads and invalidates"| node_cache
node_viewmodels -->|"searches products"| node_food
node_food -->|"stores selection history"| node_preferences
node_activity -->|"hosts navigation"| node_root
node_activity -->|"schedules reminders"| node_workmanager
node_workmanager -->|"runs worker"| node_notifications
node_notifications -->|"shows reminder"| node_notificationutils
node_viewmodels -->|"presents domain data"| node_models

click node_root "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/presentation/navigation/RootNav.kt"
click node_screens "https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/presentation/screens"
click node_viewmodels "https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/presentation/viewmodel"
click node_usecases "https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/domain/usecase"
click node_models "https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/domain/model"
click node_interfaces "https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/domain/repository"
click node_implementations "https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/data/repo"
click node_api "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/api/PowerliftingApi.kt"
click node_cache "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/cache/AppCache.kt"
click node_token "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/auth/FirebaseTokenProvider.kt"
click node_food "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/repo/FoodRepositoryImpl.kt"
click node_preferences "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/local/AppPreferences.kt"
click node_notifications "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/notifications/ReminderWorker.kt"
click node_notificationutils "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/notifications/NotificationUtils.kt"
click node_activity "https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/MainActivity.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_root,node_screens,node_viewmodels,node_activity toneBlue
class node_usecases,node_models,node_interfaces,node_food toneAmber
class node_implementations,node_api,node_cache,node_token toneMint
class node_preferences,node_notifications,node_notificationutils toneRose
class node_backend,node_firebase,node_workmanager,node_person toneIndigo
```

## Components

### Presentation

- [Auth navigation](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/presentation/navigation/RootNav.kt): `app/src/main/java/com/powerlifting/assistant/presentation/navigation/RootNav.kt`
- [Compose screens](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/presentation/screens): `app/src/main/java/com/powerlifting/assistant/presentation/screens`
- [ViewModels](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/presentation/viewmodel): `app/src/main/java/com/powerlifting/assistant/presentation/viewmodel`
- [App entry](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/MainActivity.kt): `app/src/main/java/com/powerlifting/assistant/MainActivity.kt`

### Domain

- [Use cases](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/domain/usecase): `app/src/main/java/com/powerlifting/assistant/domain/usecase`
- [Domain models](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/domain/model): `app/src/main/java/com/powerlifting/assistant/domain/model`
- [Repository contracts](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/domain/repository): `app/src/main/java/com/powerlifting/assistant/domain/repository`
- [Food search](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/repo/FoodRepositoryImpl.kt): `app/src/main/java/com/powerlifting/assistant/data/repo/FoodRepositoryImpl.kt`

### Data access

- [Repository implementations](https://github.com/mikhail0vvlad/powerlifting-assistant-android/tree/main/app/src/main/java/com/powerlifting/assistant/data/repo): `app/src/main/java/com/powerlifting/assistant/data/repo`
- [REST API client](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/api/PowerliftingApi.kt): `app/src/main/java/com/powerlifting/assistant/data/api/PowerliftingApi.kt`
- [Memory cache](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/cache/AppCache.kt): `app/src/main/java/com/powerlifting/assistant/data/cache/AppCache.kt`
- [Firebase token provider](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/auth/FirebaseTokenProvider.kt): `app/src/main/java/com/powerlifting/assistant/data/auth/FirebaseTokenProvider.kt`

### Local services

- [App preferences](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/data/local/AppPreferences.kt): `app/src/main/java/com/powerlifting/assistant/data/local/AppPreferences.kt`
- [Reminder worker](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/notifications/ReminderWorker.kt): `app/src/main/java/com/powerlifting/assistant/notifications/ReminderWorker.kt`
- [Notification utility](https://github.com/mikhail0vvlad/powerlifting-assistant-android/blob/main/app/src/main/java/com/powerlifting/assistant/notifications/NotificationUtils.kt): `app/src/main/java/com/powerlifting/assistant/notifications/NotificationUtils.kt`

### External services

- **Powerlifting REST server**
- **Firebase Authentication**
- **WorkManager**

### Other components

- **Athlete**

## Connections

- Athlete → Auth navigation: opens app
- Auth navigation → Compose screens: routes
- Compose screens → ViewModels: dispatches actions
- ViewModels → Use cases: invokes
- Use cases → Repository contracts: requests operations
- Repository contracts → Repository implementations: implemented by
- Repository implementations → REST API client: makes requests
- Repository implementations → Firebase token provider: gets bearer token
- Firebase token provider → Firebase Authentication: gets ID token
- REST API client → Powerlifting REST server: sends REST requests
- Repository implementations → Memory cache: reads and invalidates
- ViewModels → Food search: searches products
- Food search → App preferences: stores selection history
- App entry → Auth navigation: hosts navigation
- App entry → WorkManager: schedules reminders
- WorkManager → Reminder worker: runs worker
- Reminder worker → Notification utility: shows reminder
- ViewModels → Domain models: presents domain data
