# xunyv666/shootlab architecture

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

- Interactive diagram: https://gitdiagram.com/xunyv666/shootlab
- Repository: https://github.com/xunyv666/shootlab

## Overview

ShootLab is a browser-based sports-video analysis site. The main user workflow is to select a project and analyze a local video: local pose estimation feeds project-specific measurements, which the interface presents alongside timelines and coaching or calibration features. Rope, long-jump, and push-up analysis are distinct branches sharing the pose engine. The repository also contains offline basketball research tools for extracting poses and calculating shot metrics. Edges reflect README statements and shown imports/calls; unsampled UI wiring is not inferred.

Main entry points: [`prototype/js/app.js`](https://github.com/xunyv666/shootlab/blob/main/prototype/js/app.js) (Analysis interface), [`prototype/js/pose-engine.js`](https://github.com/xunyv666/shootlab/blob/main/prototype/js/pose-engine.js) (Pose engine), [`prototype/js/rope-engine.js`](https://github.com/xunyv666/shootlab/blob/main/prototype/js/rope-engine.js) (Rope analysis), [`prototype/js/longjump-engine.js`](https://github.com/xunyv666/shootlab/blob/main/prototype/js/longjump-engine.js) (Long-jump analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser analysis"]
  node_browserui["Analysis interface<br/>[app.js]"]
  node_pose["Pose engine<br/>[pose-engine.js]"]
end

subgraph group_shooting["Basketball coaching"]
  node_shooting["Shot analysis<br/>[pose-engine.js]"]
  node_metrics["Metric scoring<br/>[metrics.js]"]
  node_zones["Court zones<br/>[zone.js]"]
  node_progress["Shot calibration<br/>[progress.js]"]
  node_coach["Coach narration<br/>[coach.js]"]
  node_ghost["Pose template<br/>[ghost.js]"]
end

subgraph group_projects["Movement projects"]
  node_ropeengine["Rope analysis<br/>[rope-engine.js]"]
  node_ropescreen["Rope results<br/>[rope.js]"]
  node_jumplongengine["Long-jump analysis<br/>[longjump-engine.js]"]
  node_jumplongscreen["Long-jump results<br/>[longjump.js]"]
  node_pushengine["Push-up analysis<br/>[pushup-engine.js]"]
  node_pushscreen["Push-up results<br/>[pushup.js]"]
end

subgraph group_offline["Offline research"]
  node_extract["Pose extraction<br/>[extract_pose.py]"]
  node_recompute["Metric recomputation"]
  node_experiment["Shot experiments<br/>[experiment.py]"]
  node_balltrack["Ball tracking<br/>[ball_track.py]"]
  node_buildexp["Experiment builder"]
  node_batch["Batch dataset<br/>[batch_dataset.py]"]
end

node_athlete(("Athlete"))
node_localvideo["Local video"]

node_athlete -->|"selects project"| node_browserui
node_localvideo -->|"provides video"| node_browserui
node_browserui -->|"starts analysis"| node_pose
node_pose -->|"analyzes poses"| node_shooting
node_shooting -->|"scores shots"| node_metrics
node_browserui -->|"configures shot"| node_zones
node_browserui -->|"records outcomes"| node_progress
node_browserui -->|"presents coaching"| node_coach
node_browserui -->|"shows template"| node_ghost
node_browserui -->|"runs rope analysis"| node_ropeengine
node_pose -->|"provides pose model"| node_ropeengine
node_ropeengine -->|"returns measurements"| node_ropescreen
node_browserui -->|"runs jump analysis"| node_jumplongengine
node_pose -->|"provides pose model"| node_jumplongengine
node_jumplongengine -->|"returns measurements"| node_jumplongscreen
node_browserui -->|"runs push-up analysis"| node_pushengine
node_pose -->|"provides pose model"| node_pushengine
node_pushengine -->|"returns measurements"| node_pushscreen
node_extract -->|"supplies pose data"| node_recompute
node_buildexp -->|"calculates metrics"| node_experiment
node_buildexp -->|"tracks ball"| node_balltrack
node_batch -->|"analyzes shots"| node_experiment
node_batch -->|"tracks ball"| node_balltrack

click node_browserui "https://github.com/xunyv666/shootlab/blob/main/prototype/js/app.js"
click node_pose "https://github.com/xunyv666/shootlab/blob/main/prototype/js/pose-engine.js"
click node_shooting "https://github.com/xunyv666/shootlab/blob/main/prototype/js/pose-engine.js"
click node_metrics "https://github.com/xunyv666/shootlab/blob/main/prototype/js/metrics.js"
click node_zones "https://github.com/xunyv666/shootlab/blob/main/prototype/js/zone.js"
click node_progress "https://github.com/xunyv666/shootlab/blob/main/prototype/js/progress.js"
click node_coach "https://github.com/xunyv666/shootlab/blob/main/prototype/js/coach.js"
click node_ghost "https://github.com/xunyv666/shootlab/blob/main/prototype/js/ghost.js"
click node_ropeengine "https://github.com/xunyv666/shootlab/blob/main/prototype/js/rope-engine.js"
click node_ropescreen "https://github.com/xunyv666/shootlab/blob/main/prototype/js/rope.js"
click node_jumplongengine "https://github.com/xunyv666/shootlab/blob/main/prototype/js/longjump-engine.js"
click node_jumplongscreen "https://github.com/xunyv666/shootlab/blob/main/prototype/js/longjump.js"
click node_pushengine "https://github.com/xunyv666/shootlab/blob/main/prototype/js/pushup-engine.js"
click node_pushscreen "https://github.com/xunyv666/shootlab/blob/main/prototype/js/pushup.js"
click node_extract "https://github.com/xunyv666/shootlab/blob/main/tools/extract_pose.py"
click node_recompute "https://github.com/xunyv666/shootlab/blob/main/tools/recompute_metrics.py"
click node_experiment "https://github.com/xunyv666/shootlab/blob/main/tools/experiment.py"
click node_balltrack "https://github.com/xunyv666/shootlab/blob/main/tools/ball_track.py"
click node_buildexp "https://github.com/xunyv666/shootlab/blob/main/tools/build_experiment.py"
click node_batch "https://github.com/xunyv666/shootlab/blob/main/tools/batch_dataset.py"

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_browserui,node_pose toneBlue
class node_shooting,node_metrics,node_zones,node_progress,node_coach,node_ghost toneAmber
class node_ropeengine,node_ropescreen,node_jumplongengine,node_jumplongscreen,node_pushengine,node_pushscreen toneMint
class node_extract,node_recompute,node_experiment,node_balltrack,node_buildexp,node_batch toneRose
class node_athlete,node_localvideo toneIndigo
```

## Components

### Browser analysis

- [Analysis interface](https://github.com/xunyv666/shootlab/blob/main/prototype/js/app.js): `prototype/js/app.js`
- [Pose engine](https://github.com/xunyv666/shootlab/blob/main/prototype/js/pose-engine.js): `prototype/js/pose-engine.js`

### Basketball coaching

- [Shot analysis](https://github.com/xunyv666/shootlab/blob/main/prototype/js/pose-engine.js): `prototype/js/pose-engine.js`
- [Metric scoring](https://github.com/xunyv666/shootlab/blob/main/prototype/js/metrics.js): `prototype/js/metrics.js`
- [Court zones](https://github.com/xunyv666/shootlab/blob/main/prototype/js/zone.js): `prototype/js/zone.js`
- [Shot calibration](https://github.com/xunyv666/shootlab/blob/main/prototype/js/progress.js): `prototype/js/progress.js`
- [Coach narration](https://github.com/xunyv666/shootlab/blob/main/prototype/js/coach.js): `prototype/js/coach.js`
- [Pose template](https://github.com/xunyv666/shootlab/blob/main/prototype/js/ghost.js): `prototype/js/ghost.js`

### Movement projects

- [Rope analysis](https://github.com/xunyv666/shootlab/blob/main/prototype/js/rope-engine.js): `prototype/js/rope-engine.js`
- [Rope results](https://github.com/xunyv666/shootlab/blob/main/prototype/js/rope.js): `prototype/js/rope.js`
- [Long-jump analysis](https://github.com/xunyv666/shootlab/blob/main/prototype/js/longjump-engine.js): `prototype/js/longjump-engine.js`
- [Long-jump results](https://github.com/xunyv666/shootlab/blob/main/prototype/js/longjump.js): `prototype/js/longjump.js`
- [Push-up analysis](https://github.com/xunyv666/shootlab/blob/main/prototype/js/pushup-engine.js): `prototype/js/pushup-engine.js`
- [Push-up results](https://github.com/xunyv666/shootlab/blob/main/prototype/js/pushup.js): `prototype/js/pushup.js`

### Offline research

- [Pose extraction](https://github.com/xunyv666/shootlab/blob/main/tools/extract_pose.py): `tools/extract_pose.py`
- [Metric recomputation](https://github.com/xunyv666/shootlab/blob/main/tools/recompute_metrics.py): `tools/recompute_metrics.py`
- [Shot experiments](https://github.com/xunyv666/shootlab/blob/main/tools/experiment.py): `tools/experiment.py`
- [Ball tracking](https://github.com/xunyv666/shootlab/blob/main/tools/ball_track.py): `tools/ball_track.py`
- [Experiment builder](https://github.com/xunyv666/shootlab/blob/main/tools/build_experiment.py): `tools/build_experiment.py`
- [Batch dataset](https://github.com/xunyv666/shootlab/blob/main/tools/batch_dataset.py): `tools/batch_dataset.py`

### Other components

- **Athlete**
- **Local video**

## Connections

- Athlete → Analysis interface: selects project (evidence: `README.md`)
- Local video → Analysis interface: provides video (evidence: `README.md`)
- Analysis interface → Pose engine: starts analysis (evidence: `README.md`)
- Pose engine → Shot analysis: analyzes poses (evidence: `README.md`)
- Shot analysis → Metric scoring: scores shots (evidence: `README.md`)
- Analysis interface → Court zones: configures shot (evidence: `README.md`)
- Analysis interface → Shot calibration: records outcomes (evidence: `README.md`)
- Analysis interface → Coach narration: presents coaching (evidence: `README.md`)
- Analysis interface → Pose template: shows template (evidence: `README.md`)
- Analysis interface → Rope analysis: runs rope analysis (evidence: `README.md`)
- Pose engine → Rope analysis: provides pose model (evidence: `prototype/js/rope-engine.js`)
- Rope analysis → Rope results: returns measurements (evidence: `README.md`)
- Analysis interface → Long-jump analysis: runs jump analysis (evidence: `README.md`)
- Pose engine → Long-jump analysis: provides pose model (evidence: `prototype/js/longjump-engine.js`)
- Long-jump analysis → Long-jump results: returns measurements (evidence: `README.md`)
- Analysis interface → Push-up analysis: runs push-up analysis (evidence: `README.md`)
- Pose engine → Push-up analysis: provides pose model (evidence: `prototype/js/pushup-engine.js`)
- Push-up analysis → Push-up results: returns measurements (evidence: `README.md`)
- Pose extraction → Metric recomputation: supplies pose data (evidence: `tools/recompute_metrics.py`)
- Experiment builder → Shot experiments: calculates metrics (evidence: `tools/build_experiment.py`)
- Experiment builder → Ball tracking: tracks ball (evidence: `tools/build_experiment.py`)
- Batch dataset → Shot experiments: analyzes shots (evidence: `tools/batch_dataset.py`)
- Batch dataset → Ball tracking: tracks ball (evidence: `tools/batch_dataset.py`)
