# dudechem466/power-project architecture

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

- Interactive diagram: https://gitdiagram.com/dudechem466/power-project
- Repository: https://github.com/dudechem466/power-project

## Overview

POWERPLAY is an offline-capable, single-page tracker for a 28-day cricket training protocol. Users review the day’s session, mark exercises complete, log body weight, and see progress and coaching that adapts to their weight trend. The main flow runs through the browser UI into shared state and persistence; the program rotation and coaching calculations are internal layers. The excerpts show these core calls and storage fallbacks. Other view details are represented only where the supplied excerpts or README support them.

Main entry points: [`src/main.js`](https://github.com/dudechem466/power-project/blob/main/src/main.js) (App controller), [`src/storage.js`](https://github.com/dudechem466/power-project/blob/main/src/storage.js) (Storage adapter), [`src/state.js`](https://github.com/dudechem466/power-project/blob/main/src/state.js) (Program state), [`src/data.js`](https://github.com/dudechem466/power-project/blob/main/src/data.js) (Session program)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App controller<br/>[main.js]"]
  node_today["Today session<br/>[main.js]"]
  node_plan["Plan view<br/>[main.js]"]
  node_progress_view["Progress view<br/>[main.js]"]
  node_weight_view["Weight view<br/>[main.js]"]
end

subgraph group_protocol["Training protocol"]
  node_program["Session program<br/>[data.js]"]
end

subgraph group_tracking["Progress and coaching"]
  node_state["Program state<br/>[state.js]"]
  node_progress["Completion tracking<br/>[state.js]"]
  node_weight_coach["Weight and coach<br/>[state.js]"]
end

subgraph group_persistence["Persistence"]
  node_storage["Storage adapter<br/>[storage.js]"]
  node_browser_store[("Browser storage")]
  node_artifact_store[("Artifact storage")]
end

node_user(("Athlete"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_today
node_app -->|"renders"| node_plan
node_app -->|"renders"| node_progress_view
node_app -->|"renders"| node_weight_view
node_app -->|"reads state"| node_state
node_app -->|"reads constants"| node_program
node_app -->|"saves progress"| node_storage
node_state -->|"uses rotation"| node_program
node_state -->|"loads and saves"| node_storage
node_today -->|"shows completion"| node_progress
node_weight_view -->|"shows trend"| node_weight_coach
node_progress_view -->|"summarizes days"| node_progress
node_progress_view -->|"shows projection"| node_weight_coach
node_storage -->|"reads and writes"| node_browser_store
node_storage -->|"reads and writes"| node_artifact_store

click node_app "https://github.com/dudechem466/power-project/blob/main/src/main.js"
click node_today "https://github.com/dudechem466/power-project/blob/main/src/main.js"
click node_plan "https://github.com/dudechem466/power-project/blob/main/src/main.js"
click node_progress_view "https://github.com/dudechem466/power-project/blob/main/src/main.js"
click node_weight_view "https://github.com/dudechem466/power-project/blob/main/src/main.js"
click node_program "https://github.com/dudechem466/power-project/blob/main/src/data.js"
click node_state "https://github.com/dudechem466/power-project/blob/main/src/state.js"
click node_progress "https://github.com/dudechem466/power-project/blob/main/src/state.js"
click node_weight_coach "https://github.com/dudechem466/power-project/blob/main/src/state.js"
click node_storage "https://github.com/dudechem466/power-project/blob/main/src/storage.js"

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_today,node_plan,node_progress_view,node_weight_view toneBlue
class node_program toneAmber
class node_state,node_progress,node_weight_coach toneMint
class node_storage,node_browser_store,node_artifact_store toneRose
class node_user toneIndigo
```

## Components

### App experience

- [App controller](https://github.com/dudechem466/power-project/blob/main/src/main.js): `src/main.js`
- [Today session](https://github.com/dudechem466/power-project/blob/main/src/main.js): `src/main.js`
- [Plan view](https://github.com/dudechem466/power-project/blob/main/src/main.js): `src/main.js`
- [Progress view](https://github.com/dudechem466/power-project/blob/main/src/main.js): `src/main.js`
- [Weight view](https://github.com/dudechem466/power-project/blob/main/src/main.js): `src/main.js`

### Training protocol

- [Session program](https://github.com/dudechem466/power-project/blob/main/src/data.js): `src/data.js`

### Progress and coaching

- [Program state](https://github.com/dudechem466/power-project/blob/main/src/state.js): `src/state.js`
- [Completion tracking](https://github.com/dudechem466/power-project/blob/main/src/state.js): `src/state.js`
- [Weight and coach](https://github.com/dudechem466/power-project/blob/main/src/state.js): `src/state.js`

### Persistence

- [Storage adapter](https://github.com/dudechem466/power-project/blob/main/src/storage.js): `src/storage.js`
- **Browser storage**
- **Artifact storage**

### Other components

- **Athlete**

## Connections

- Athlete → App controller: uses (evidence: `README.md`)
- App controller → Today session: renders (evidence: `src/main.js`)
- App controller → Plan view: renders (evidence: `src/main.js`)
- App controller → Progress view: renders (evidence: `src/main.js`)
- App controller → Weight view: renders (evidence: `src/main.js`)
- App controller → Program state: reads state (evidence: `src/main.js`)
- App controller → Session program: reads constants (evidence: `src/main.js`)
- App controller → Storage adapter: saves progress (evidence: `src/main.js`)
- Program state → Session program: uses rotation (evidence: `src/state.js`)
- Program state → Storage adapter: loads and saves (evidence: `src/state.js`)
- Today session → Completion tracking: shows completion (evidence: `src/main.js`)
- Weight view → Weight and coach: shows trend (evidence: `src/main.js`)
- Progress view → Completion tracking: summarizes days (evidence: `src/main.js`)
- Progress view → Weight and coach: shows projection (evidence: `src/main.js`)
- Storage adapter → Browser storage: reads and writes (evidence: `src/storage.js`)
- Storage adapter → Artifact storage: reads and writes (evidence: `src/storage.js`)
