# cyerifor/lift-app architecture

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

- Interactive diagram: https://gitdiagram.com/cyerifor/lift-app
- Repository: https://github.com/cyerifor/lift-app

## Overview

Lift App is a coach–athlete strength-training product. Coaches create training blocks and prescriptions; athletes follow scheduled sessions and submit set logs; coaches review performance and analytics. Authentication and role-specific access support both workflows. The sampled code shows block generation, log processing, and shared persistence/authentication layers. Several screens and API routes are present in the tree, but their request wiring was not excerpted, so those links are marked unverified rather than asserted.

Main entry points: [`lib/db.ts`](https://github.com/cyerifor/lift-app/blob/main/lib/db.ts) (Application Database), [`lib/get-coach.ts`](https://github.com/cyerifor/lift-app/blob/main/lib/get-coach.ts) (Coach Access), [`app/api/coach`](https://github.com/cyerifor/lift-app/tree/main/app/api/coach) (Coach Routes), [`app/api/session-logs`](https://github.com/cyerifor/lift-app/tree/main/app/api/session-logs) (Session Logging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Identity &amp; Access"]
  node_auth_ui["Sign-in &amp; Signup"]
  node_auth_api["Account Routes"]
  node_auth_helpers["Password Auth<br/>[auth.ts]"]
  node_session["Session Access<br/>[session.ts]"]
end

subgraph group_coach["Coach Planning"]
  node_coach_ui["Coach Dashboard"]
  node_coach_routes["Coach Routes"]
  node_block_editor["Block Editor API<br/>[route.ts]"]
  node_block_creation["Block Creation API<br/>[route.ts]"]
  node_review_analytics["Reviews &amp; Analytics"]
end

subgraph group_athlete["Athlete Training"]
  node_athlete_ui["Athlete Screens"]
  node_athlete_routes["Athlete Routes"]
  node_session_capture["Session Logging"]
end

subgraph group_shared["Training Services"]
  node_engine["Progression Engine<br/>[engine.ts]"]
  node_exercise_library["Exercise Library<br/>[exercise-seeds.ts]"]
  node_coach_access["Coach Access<br/>[get-coach.ts]"]
  node_athlete_access["Athlete Access<br/>[get-athlete.ts]"]
  node_database[("Application Database<br/>[db.ts]")]
end

node_coach_actor(("Coach"))
node_athlete_actor(("Athlete"))

node_coach_actor -.->|"signs up"| node_auth_ui
node_athlete_actor -.->|"signs in"| node_auth_ui
node_auth_ui -.->|"submits credentials"| node_auth_api
node_auth_api -->|"hashes passwords"| node_auth_helpers
node_auth_api -->|"creates sessions"| node_session
node_auth_helpers -->|"uses adapter"| node_database
node_session -->|"reads/writes sessions"| node_database
node_coach_actor -.->|"plans training"| node_coach_ui
node_coach_ui -.->|"requests data"| node_coach_routes
node_coach_routes -->|"checks coach"| node_coach_access
node_coach_access -->|"checks role"| node_session
node_coach_routes -->|"queries training data"| node_database
node_block_creation -->|"checks coach"| node_coach_access
node_block_creation -->|"creates block schedule"| node_database
node_block_editor -->|"checks coach"| node_coach_access
node_block_editor -->|"reads/writes prescriptions"| node_database
node_block_editor -->|"generates weeks"| node_engine
node_coach_routes -->|"uses seed data"| node_exercise_library
node_coach_actor -.->|"reviews progress"| node_review_analytics
node_review_analytics -->|"checks coach"| node_coach_access
node_review_analytics -->|"reads review data"| node_database
node_athlete_actor -.->|"follows sessions"| node_athlete_ui
node_athlete_ui -.->|"requests schedule"| node_athlete_routes
node_athlete_ui -.->|"submits set logs"| node_session_capture
node_athlete_routes -->|"checks athlete"| node_athlete_access
node_athlete_access -->|"checks role"| node_session
node_athlete_routes -->|"reads athlete data"| node_database
node_session_capture -->|"checks athlete"| node_athlete_access
node_session_capture -->|"calculates summaries"| node_engine
node_session_capture -->|"stores logs and analytics"| node_database

click node_auth_ui "https://github.com/cyerifor/lift-app/tree/main/app/auth"
click node_auth_api "https://github.com/cyerifor/lift-app/tree/main/app/api/auth"
click node_auth_helpers "https://github.com/cyerifor/lift-app/blob/main/lib/auth.ts"
click node_session "https://github.com/cyerifor/lift-app/blob/main/lib/session.ts"
click node_coach_ui "https://github.com/cyerifor/lift-app/tree/main/app/dashboard"
click node_athlete_ui "https://github.com/cyerifor/lift-app/tree/main/app/athlete"
click node_coach_routes "https://github.com/cyerifor/lift-app/tree/main/app/api/coach"
click node_block_editor "https://github.com/cyerifor/lift-app/blob/main/app/api/coach/blocks/%5BblockId%5D/route.ts"
click node_block_creation "https://github.com/cyerifor/lift-app/blob/main/app/api/coach/blocks/route.ts"
click node_review_analytics "https://github.com/cyerifor/lift-app/tree/main/app/api/coach/reviews"
click node_athlete_routes "https://github.com/cyerifor/lift-app/tree/main/app/api/athlete"
click node_session_capture "https://github.com/cyerifor/lift-app/tree/main/app/api/session-logs"
click node_engine "https://github.com/cyerifor/lift-app/blob/main/lib/engine.ts"
click node_exercise_library "https://github.com/cyerifor/lift-app/blob/main/lib/exercise-seeds.ts"
click node_coach_access "https://github.com/cyerifor/lift-app/blob/main/lib/get-coach.ts"
click node_athlete_access "https://github.com/cyerifor/lift-app/blob/main/lib/get-athlete.ts"
click node_database "https://github.com/cyerifor/lift-app/blob/main/lib/db.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_auth_ui,node_auth_api,node_auth_helpers,node_session toneBlue
class node_coach_ui,node_coach_routes,node_block_editor,node_block_creation,node_review_analytics toneAmber
class node_athlete_ui,node_athlete_routes,node_session_capture toneMint
class node_engine,node_exercise_library,node_coach_access,node_athlete_access,node_database toneRose
class node_coach_actor,node_athlete_actor toneIndigo
```

## Components

### Identity & Access

- [Sign-in & Signup](https://github.com/cyerifor/lift-app/tree/main/app/auth): `app/auth`
- [Account Routes](https://github.com/cyerifor/lift-app/tree/main/app/api/auth): `app/api/auth`
- [Password Auth](https://github.com/cyerifor/lift-app/blob/main/lib/auth.ts): `lib/auth.ts`
- [Session Access](https://github.com/cyerifor/lift-app/blob/main/lib/session.ts): `lib/session.ts`

### Coach Planning

- [Coach Dashboard](https://github.com/cyerifor/lift-app/tree/main/app/dashboard): `app/dashboard`
- [Coach Routes](https://github.com/cyerifor/lift-app/tree/main/app/api/coach): `app/api/coach`
- [Block Editor API](https://github.com/cyerifor/lift-app/blob/main/app/api/coach/blocks/%5BblockId%5D/route.ts): `app/api/coach/blocks/[blockId]/route.ts`
- [Block Creation API](https://github.com/cyerifor/lift-app/blob/main/app/api/coach/blocks/route.ts): `app/api/coach/blocks/route.ts`
- [Reviews & Analytics](https://github.com/cyerifor/lift-app/tree/main/app/api/coach/reviews): `app/api/coach/reviews`

### Athlete Training

- [Athlete Screens](https://github.com/cyerifor/lift-app/tree/main/app/athlete): `app/athlete`
- [Athlete Routes](https://github.com/cyerifor/lift-app/tree/main/app/api/athlete): `app/api/athlete`
- [Session Logging](https://github.com/cyerifor/lift-app/tree/main/app/api/session-logs): `app/api/session-logs`

### Training Services

- [Progression Engine](https://github.com/cyerifor/lift-app/blob/main/lib/engine.ts): `lib/engine.ts`
- [Exercise Library](https://github.com/cyerifor/lift-app/blob/main/lib/exercise-seeds.ts): `lib/exercise-seeds.ts`
- [Coach Access](https://github.com/cyerifor/lift-app/blob/main/lib/get-coach.ts): `lib/get-coach.ts`
- [Athlete Access](https://github.com/cyerifor/lift-app/blob/main/lib/get-athlete.ts): `lib/get-athlete.ts`
- [Application Database](https://github.com/cyerifor/lift-app/blob/main/lib/db.ts): `lib/db.ts`

### Other components

- **Coach**
- **Athlete**

## Connections

- Coach → Sign-in & Signup: signs up
- Athlete → Sign-in & Signup: signs in
- Sign-in & Signup → Account Routes: submits credentials
- Account Routes → Password Auth: hashes passwords (evidence: `app/api/auth/signup/route.ts`)
- Account Routes → Session Access: creates sessions (evidence: `app/api/auth/signup/route.ts`)
- Password Auth → Application Database: uses adapter (evidence: `lib/auth.ts`)
- Session Access → Application Database: reads/writes sessions (evidence: `lib/session.ts`)
- Coach → Coach Dashboard: plans training
- Coach Dashboard → Coach Routes: requests data
- Coach Routes → Coach Access: checks coach (evidence: `app/api/coach/blocks/route.ts`)
- Coach Access → Session Access: checks role (evidence: `lib/get-coach.ts`)
- Coach Routes → Application Database: queries training data (evidence: `app/api/coach/blocks/route.ts`)
- Block Creation API → Coach Access: checks coach (evidence: `app/api/coach/blocks/route.ts`)
- Block Creation API → Application Database: creates block schedule (evidence: `app/api/coach/blocks/route.ts`)
- Block Editor API → Coach Access: checks coach (evidence: `app/api/coach/blocks/[blockId]/route.ts`)
- Block Editor API → Application Database: reads/writes prescriptions (evidence: `app/api/coach/blocks/[blockId]/route.ts`)
- Block Editor API → Progression Engine: generates weeks (evidence: `app/api/coach/blocks/[blockId]/route.ts`)
- Coach Routes → Exercise Library: uses seed data (evidence: `app/api/coach/exercise-library/route.ts`)
- Coach → Reviews & Analytics: reviews progress
- Reviews & Analytics → Coach Access: checks coach (evidence: `app/api/coach/reviews/route.ts`)
- Reviews & Analytics → Application Database: reads review data (evidence: `app/api/coach/reviews/route.ts`)
- Athlete → Athlete Screens: follows sessions
- Athlete Screens → Athlete Routes: requests schedule
- Athlete Screens → Session Logging: submits set logs
- Athlete Routes → Athlete Access: checks athlete (evidence: `app/api/athlete/blocks/active/route.ts`)
- Athlete Access → Session Access: checks role (evidence: `lib/get-athlete.ts`)
- Athlete Routes → Application Database: reads athlete data (evidence: `app/api/athlete/blocks/active/route.ts`)
- Session Logging → Athlete Access: checks athlete (evidence: `app/api/session-logs/sync/route.ts`)
- Session Logging → Progression Engine: calculates summaries (evidence: `app/api/session-logs/sync/route.ts`)
- Session Logging → Application Database: stores logs and analytics (evidence: `app/api/session-logs/sync/route.ts`)
