# masayukita/shuttle-scope architecture

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

- Interactive diagram: https://gitdiagram.com/masayukita/shuttle-scope
- Repository: https://github.com/masayukita/shuttle-scope

## Overview

ShuttleScope is a local-first badminton annotation, review, and analysis workbench. Its main workflow is match setup and rally annotation, followed by video-assisted processing and dashboard review; prediction, research, LAN sharing, and cluster inference are additional capabilities. The graph follows documented product flows and the shown pipeline/API excerpts; many routes and advanced subsystems were not sampled, so their internal links are omitted rather than inferred.

Main entry points: [`shuttlescope/src/App.tsx`](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/src/App.tsx) (Desktop Workbench), [`shuttlescope/backend/pipeline/video_pipeline.py`](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/pipeline/video_pipeline.py) (Video Analysis Pipeline), [`shuttlescope/backend/routers`](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/routers) (Match and Player Setup), [`shuttlescope/backend/routers/uploads.py`](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/uploads.py) (Video Capture and Import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_work["Annotation and Review"]
  node_desktop["Desktop Workbench<br/>[App.tsx]"]
  node_matches["Match and Player Setup"]
  node_annotation["Rally Annotation"]
  node_review["Review Tools"]
end

subgraph group_video["Video and CV"]
  node_video_input["Video Capture and Import<br/>[uploads.py]"]
  node_video_store[("Recording and Video Data<br/>[models.py]")]
  node_video_pipeline["Video Analysis Pipeline<br/>[video_pipeline.py]"]
  node_cv["CV Detection and Candidates"]
  node_calibration["Court Calibration"]
end

subgraph group_analysis["Analysis and Prediction"]
  node_dashboard["Dashboard Review"]
  node_analytics["Match Analytics"]
  node_prediction["Match Prediction"]
  node_advice["Advice Chat"]
end

subgraph group_platform["Backend and Sharing"]
  node_cluster["Cluster Inference"]
  node_sessions["LAN Sessions<br/>[sessions.py]"]
  node_database[("Application Database<br/>[database.py]")]
end

node_analyst(("Coach / Analyst"))

node_analyst -->|"uses"| node_desktop
node_desktop -->|"sets up"| node_matches
node_desktop -->|"annotates rallies"| node_annotation
node_desktop -->|"reviews matches"| node_review
node_desktop -->|"imports or captures"| node_video_input
node_video_input -->|"stores recordings"| node_video_store
node_video_pipeline -->|"selects detectors"| node_cv
node_desktop -->|"configures court"| node_calibration
node_desktop -->|"reviews analysis"| node_dashboard
node_dashboard -.->|"presents"| node_analytics
node_desktop -->|"views forecasts"| node_prediction
node_desktop -->|"asks for advice"| node_advice
node_desktop -->|"configures routing"| node_cluster
node_desktop -->|"shares sessions"| node_sessions
node_matches -.->|"persists match data"| node_database
node_video_pipeline -->|"reads and writes"| node_video_store

click node_desktop "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/src/App.tsx"
click node_matches "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/routers"
click node_annotation "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/src"
click node_review "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/routers"
click node_video_input "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/uploads.py"
click node_video_store "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/db/models.py"
click node_video_pipeline "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/pipeline/video_pipeline.py"
click node_cv "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/cv"
click node_calibration "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/court_calibration.py"
click node_dashboard "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/src/components/analysis"
click node_analytics "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/analysis"
click node_prediction "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/analysis/prediction_engine.py"
click node_advice "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/analysis/insights"
click node_cluster "https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/cluster"
click node_sessions "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/sessions.py"
click node_database "https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/db/database.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_desktop,node_matches,node_annotation,node_review toneBlue
class node_video_input,node_video_store,node_video_pipeline,node_cv,node_calibration toneAmber
class node_dashboard,node_analytics,node_prediction,node_advice toneMint
class node_cluster,node_sessions,node_database toneRose
class node_analyst toneIndigo
```

## Components

### Annotation and Review

- [Desktop Workbench](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/src/App.tsx): `shuttlescope/src/App.tsx`
- [Match and Player Setup](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/routers): `shuttlescope/backend/routers`
- [Rally Annotation](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/src): `shuttlescope/src`
- [Review Tools](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/routers): `shuttlescope/backend/routers`

### Video and CV

- [Video Capture and Import](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/uploads.py): `shuttlescope/backend/routers/uploads.py`
- [Recording and Video Data](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/db/models.py): `shuttlescope/backend/db/models.py`
- [Video Analysis Pipeline](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/pipeline/video_pipeline.py): `shuttlescope/backend/pipeline/video_pipeline.py`
- [CV Detection and Candidates](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/cv): `shuttlescope/backend/cv`
- [Court Calibration](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/court_calibration.py): `shuttlescope/backend/routers/court_calibration.py`

### Analysis and Prediction

- [Dashboard Review](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/src/components/analysis): `shuttlescope/src/components/analysis`
- [Match Analytics](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/analysis): `shuttlescope/backend/analysis`
- [Match Prediction](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/analysis/prediction_engine.py): `shuttlescope/backend/analysis/prediction_engine.py`
- [Advice Chat](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/analysis/insights): `shuttlescope/backend/analysis/insights`

### Backend and Sharing

- [Cluster Inference](https://github.com/masayukita/shuttle-scope/tree/main/shuttlescope/backend/cluster): `shuttlescope/backend/cluster`
- [LAN Sessions](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/routers/sessions.py): `shuttlescope/backend/routers/sessions.py`
- [Application Database](https://github.com/masayukita/shuttle-scope/blob/main/shuttlescope/backend/db/database.py): `shuttlescope/backend/db/database.py`

### Other components

- **Coach / Analyst**

## Connections

- Coach / Analyst → Desktop Workbench: uses (evidence: `README.md`)
- Desktop Workbench → Match and Player Setup: sets up (evidence: `README.md`)
- Desktop Workbench → Rally Annotation: annotates rallies (evidence: `README.md`)
- Desktop Workbench → Review Tools: reviews matches (evidence: `README.md`)
- Desktop Workbench → Video Capture and Import: imports or captures (evidence: `README.md`)
- Video Capture and Import → Recording and Video Data: stores recordings (evidence: `shuttlescope/backend/routers/uploads.py`)
- Video Analysis Pipeline → CV Detection and Candidates: selects detectors (evidence: `shuttlescope/backend/pipeline/video_pipeline.py`)
- Desktop Workbench → Court Calibration: configures court (evidence: `README.md`)
- Desktop Workbench → Dashboard Review: reviews analysis (evidence: `README.md`)
- Dashboard Review → Match Analytics: presents
- Desktop Workbench → Match Prediction: views forecasts (evidence: `README.md`)
- Desktop Workbench → Advice Chat: asks for advice (evidence: `README.md`)
- Desktop Workbench → Cluster Inference: configures routing (evidence: `README.md`)
- Desktop Workbench → LAN Sessions: shares sessions (evidence: `README.md`)
- Match and Player Setup → Application Database: persists match data (evidence: `shuttlescope/backend/routers/pipeline.py`)
- Video Analysis Pipeline → Recording and Video Data: reads and writes (evidence: `shuttlescope/backend/pipeline/video_pipeline.py`)
