# alexeydesyatnik/gymlog architecture

> Architecture diagram of the GitHub repository alexeydesyatnik/gymlog, 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/alexeydesyatnik/gymlog
- Repository: https://github.com/alexeydesyatnik/gymlog

## Overview

GymLog is a phone-friendly strength-training log: a user signs in, creates or opens a workout, records planned and performed sets, and the client stores changes locally and synchronizes them with the server. The Owner can invite users and issue password-reset links. The graph includes the main workout, account, and synchronization capabilities documented in the README. Sampled source confirms the app entry, local journal, sync loop, and server routes; some screen and storage wiring is inferred only from module boundaries, so uncertain call edges are omitted.

Main entry points: [`packages/client/src/journal/journal.ts`](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/journal.ts) (Journal operations), [`packages/client/src/ui/App.tsx`](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/App.tsx) (App shell), [`packages/client/src/ui/WorkoutScreen.tsx`](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/WorkoutScreen.tsx) (Workout log), [`packages/server/src/server.ts`](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/server.ts) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workout experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_workout_list["Workout list"]
  node_workout_detail["Workout log<br/>[WorkoutScreen.tsx]"]
  node_plan_editor["Plan editor<br/>[PlanEditor.tsx]"]
  node_suggestions["Exercise suggestions<br/>[Suggestions.tsx]"]
  node_owner_ui["Account management<br/>[Owner.tsx]"]
  node_sign_in_ui["Sign-in screens<br/>[SignIn.tsx]"]
  node_entry_view["Entry presentation<br/>[entryView.ts]"]
end

subgraph group_journal["Local journal"]
  node_journal_api["Journal operations<br/>[journal.ts]"]
  node_local_store[("Device store<br/>[store.ts]")]
end

subgraph group_identity["Accounts"]
end

subgraph group_sync["Synchronization"]
  node_sync_loop["Sync coordinator<br/>[sync.ts]"]
  node_sync_api["Sync HTTP client<br/>[api.ts]"]
end

subgraph group_backend["Server and data"]
  node_server["HTTP API<br/>[server.ts]"]
  node_user_service["User and invite service<br/>[users.ts]"]
  node_database_schema[("PostgreSQL data<br/>[schema.ts]")]
  node_shared_rules["Shared record rules<br/>[validation.ts]"]
end

node_trainee(("Trainee"))
node_owner(("Owner"))
node_postgres[("PostgreSQL")]

node_trainee -->|"uses"| node_app
node_owner -->|"manages accounts"| node_owner_ui
node_app -->|"routes to"| node_workout_list
node_app -->|"routes to"| node_workout_detail
node_app -->|"shows"| node_sign_in_ui
node_workout_list -->|"reads workouts"| node_journal_api
node_workout_detail -->|"records training"| node_journal_api
node_workout_detail -->|"edits plan"| node_plan_editor
node_workout_detail -->|"offers exercises"| node_suggestions
node_journal_api -->|"reads and writes"| node_local_store
node_journal_api -->|"builds entry views"| node_entry_view
node_journal_api -->|"starts sync"| node_sync_loop
node_sync_loop -->|"reads and writes"| node_local_store
node_sync_loop -->|"requests sync"| node_sync_api
node_sync_api -->|"calls API"| node_server
node_sign_in_ui -->|"submits credentials"| node_journal_api
node_owner_ui -->|"requests account actions"| node_journal_api
node_server -->|"handles account routes"| node_user_service
node_server -->|"validates records"| node_shared_rules
node_server -->|"queries and updates"| node_database_schema
node_user_service -->|"queries and updates"| node_database_schema
node_database_schema -->|"defines persisted data"| node_postgres

click node_app "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/App.tsx"
click node_workout_list "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/WorkoutListScreen.tsx"
click node_workout_detail "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/WorkoutScreen.tsx"
click node_plan_editor "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/PlanEditor.tsx"
click node_suggestions "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/Suggestions.tsx"
click node_owner_ui "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/Owner.tsx"
click node_sign_in_ui "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/SignIn.tsx"
click node_entry_view "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/entryView.ts"
click node_journal_api "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/journal.ts"
click node_local_store "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/store.ts"
click node_sync_loop "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/sync/sync.ts"
click node_sync_api "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/sync/api.ts"
click node_server "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/server.ts"
click node_user_service "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/users.ts"
click node_database_schema "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/db/schema.ts"
click node_shared_rules "https://github.com/alexeydesyatnik/gymlog/blob/main/packages/shared/src/validation.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_app,node_workout_list,node_workout_detail,node_plan_editor,node_suggestions,node_owner_ui,node_sign_in_ui,node_entry_view toneBlue
class node_journal_api,node_local_store,node_postgres toneAmber
class node_sync_loop,node_sync_api toneRose
class node_server,node_user_service,node_database_schema,node_shared_rules,node_trainee,node_owner toneIndigo
```

## Components

### Workout experience

- [App shell](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/App.tsx): `packages/client/src/ui/App.tsx`
- [Workout list](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/WorkoutListScreen.tsx): `packages/client/src/ui/WorkoutListScreen.tsx`
- [Workout log](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/WorkoutScreen.tsx): `packages/client/src/ui/WorkoutScreen.tsx`
- [Plan editor](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/PlanEditor.tsx): `packages/client/src/ui/PlanEditor.tsx`
- [Exercise suggestions](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/Suggestions.tsx): `packages/client/src/ui/Suggestions.tsx`
- [Account management](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/Owner.tsx): `packages/client/src/ui/Owner.tsx`
- [Sign-in screens](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/ui/SignIn.tsx): `packages/client/src/ui/SignIn.tsx`
- [Entry presentation](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/entryView.ts): `packages/client/src/journal/entryView.ts`

### Local journal

- [Journal operations](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/journal.ts): `packages/client/src/journal/journal.ts`
- [Device store](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/journal/store.ts): `packages/client/src/journal/store.ts`

### Synchronization

- [Sync coordinator](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/sync/sync.ts): `packages/client/src/sync/sync.ts`
- [Sync HTTP client](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/client/src/sync/api.ts): `packages/client/src/sync/api.ts`

### Server and data

- [HTTP API](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/server.ts): `packages/server/src/server.ts`
- [User and invite service](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/users.ts): `packages/server/src/users.ts`
- [PostgreSQL data](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/server/src/db/schema.ts): `packages/server/src/db/schema.ts`
- [Shared record rules](https://github.com/alexeydesyatnik/gymlog/blob/main/packages/shared/src/validation.ts): `packages/shared/src/validation.ts`

### Other components

- **Trainee**
- **Owner**
- **PostgreSQL**

## Connections

- Trainee → App shell: uses
- Owner → Account management: manages accounts
- App shell → Workout list: routes to
- App shell → Workout log: routes to
- App shell → Sign-in screens: shows
- Workout list → Journal operations: reads workouts
- Workout log → Journal operations: records training
- Workout log → Plan editor: edits plan
- Workout log → Exercise suggestions: offers exercises
- Journal operations → Device store: reads and writes
- Journal operations → Entry presentation: builds entry views
- Journal operations → Sync coordinator: starts sync
- Sync coordinator → Device store: reads and writes
- Sync coordinator → Sync HTTP client: requests sync
- Sync HTTP client → HTTP API: calls API
- Sign-in screens → Journal operations: submits credentials
- Account management → Journal operations: requests account actions
- HTTP API → User and invite service: handles account routes
- HTTP API → Shared record rules: validates records
- HTTP API → PostgreSQL data: queries and updates
- User and invite service → PostgreSQL data: queries and updates
- PostgreSQL data → PostgreSQL: defines persisted data
