# kennethhuang7/courtvision architecture

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

- Interactive diagram: https://gitdiagram.com/kennethhuang7/courtvision
- Repository: https://github.com/kennethhuang7/courtvision

## Overview

CourtVision is an archived Electron desktop app for NBA player analytics and predictions, backed by a Python data and ML pipeline. The user-facing flow is routed through the app to prediction, analysis, discovery, and social screens; the README describes ensemble forecasts and confidence scoring. The backend is retired, so live account, prediction, and social workflows are unavailable. Source excerpts support the app entry and feature-engineering links; other unsampled connections are omitted or marked unverified.

Main entry points: [`app/src/App.tsx`](https://github.com/kennethhuang7/courtvision/blob/main/app/src/App.tsx) (App router), [`src/predictions/predict_games.py`](https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/predict_games.py) (Game prediction), [`src/feature_engineering/build_features.py`](https://github.com/kennethhuang7/courtvision/blob/main/src/feature_engineering/build_features.py) (Feature engineering), [`app/electron/main.ts`](https://github.com/kennethhuang7/courtvision/blob/main/app/electron/main.ts) (Electron shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_electron["Electron shell<br/>[main.ts]"]
  node_entry["App router<br/>[App.tsx]"]
  node_auth["Account screens<br/>[Register.tsx]"]
end

subgraph group_product["Analytics features"]
  node_predictions_ui["Predictions<br/>[Predictions.tsx]"]
  node_player_analysis["Player analysis<br/>[PlayerAnalysis.tsx]"]
  node_pick_finder["Pick discovery<br/>[PickFinder.tsx]"]
  node_trends["Trend analysis<br/>[Trends.tsx]"]
  node_saved["Saved picks<br/>[SavedPicks.tsx]"]
  node_analytics["Analytics<br/>[Analytics.tsx]"]
  node_performance["Model performance"]
  node_community["Community<br/>[Community.tsx]"]
  node_messages["Messaging<br/>[Messages.tsx]"]
  node_streamlit["Streamlit dashboard<br/>[Home.py]"]
end

subgraph group_ml["Prediction pipeline"]
  node_predict["Game prediction<br/>[predict_games.py]"]
  node_confidence["Confidence scoring"]
  node_explanations["Feature explanations"]
  node_features["Feature engineering<br/>[build_features.py]"]
  node_team_stats["Team statistics"]
  node_model_training["Model training<br/>[train_catboost.py]"]
end

subgraph group_data["Data operations"]
  node_collection["Data collection"]
  node_pipeline["Daily pipeline<br/>[daily_pipeline.py]"]
  node_db[("NBA data store")]
end

node_user(("Desktop user"))
node_backend["Hosted backend"]

node_user -->|"launches"| node_electron
node_electron -.->|"hosts"| node_entry
node_entry -->|"routes"| node_auth
node_entry -->|"routes"| node_predictions_ui
node_entry -->|"routes"| node_player_analysis
node_entry -->|"routes"| node_pick_finder
node_entry -.->|"routes"| node_trends
node_entry -.->|"routes"| node_saved
node_entry -.->|"routes"| node_analytics
node_entry -.->|"routes"| node_performance
node_entry -.->|"routes"| node_community
node_entry -.->|"routes"| node_messages
node_predictions_ui -.->|"requests live data"| node_backend
node_community -.->|"social services"| node_backend
node_messages -.->|"messaging services"| node_backend
node_predict -->|"scores confidence"| node_confidence
node_predict -->|"builds explanations"| node_explanations
node_predict -->|"uses team stats"| node_team_stats
node_features -->|"calculates ratings"| node_team_stats
node_model_training -.->|"publishes predictions"| node_backend
node_pipeline -.->|"runs collection"| node_collection
node_collection -.->|"writes game data"| node_db
node_features -.->|"reads historical data"| node_db
node_streamlit -.->|"queries analytics"| node_db

click node_electron "https://github.com/kennethhuang7/courtvision/blob/main/app/electron/main.ts"
click node_entry "https://github.com/kennethhuang7/courtvision/blob/main/app/src/App.tsx"
click node_auth "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/Register.tsx"
click node_predictions_ui "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Predictions.tsx"
click node_player_analysis "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/PlayerAnalysis.tsx"
click node_pick_finder "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/PickFinder.tsx"
click node_trends "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Trends.tsx"
click node_saved "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/SavedPicks.tsx"
click node_analytics "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Analytics.tsx"
click node_performance "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/ModelPerformance.tsx"
click node_community "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Community.tsx"
click node_messages "https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Messages.tsx"
click node_predict "https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/predict_games.py"
click node_confidence "https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/confidence_scoring.py"
click node_explanations "https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/feature_explanations.py"
click node_features "https://github.com/kennethhuang7/courtvision/blob/main/src/feature_engineering/build_features.py"
click node_team_stats "https://github.com/kennethhuang7/courtvision/blob/main/src/feature_engineering/team_stats_calculator.py"
click node_model_training "https://github.com/kennethhuang7/courtvision/blob/main/src/models/train_catboost.py"
click node_collection "https://github.com/kennethhuang7/courtvision/blob/main/src/data_collection/update_yesterday_games.py"
click node_pipeline "https://github.com/kennethhuang7/courtvision/blob/main/src/automation/daily_pipeline.py"
click node_streamlit "https://github.com/kennethhuang7/courtvision/blob/main/streamlit/streamlit_app/Home.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_electron,node_entry,node_auth,node_user toneBlue
class node_predictions_ui,node_player_analysis,node_pick_finder,node_trends,node_saved,node_analytics,node_performance,node_community,node_messages,node_streamlit toneAmber
class node_predict,node_confidence,node_explanations,node_features,node_team_stats,node_model_training toneMint
class node_collection,node_pipeline,node_db toneRose
class node_backend toneIndigo
```

## Components

### Desktop client

- [Electron shell](https://github.com/kennethhuang7/courtvision/blob/main/app/electron/main.ts): `app/electron/main.ts`
- [App router](https://github.com/kennethhuang7/courtvision/blob/main/app/src/App.tsx): `app/src/App.tsx`
- [Account screens](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/Register.tsx): `app/src/pages/Register.tsx`

### Analytics features

- [Predictions](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Predictions.tsx): `app/src/pages/dashboard/Predictions.tsx`
- [Player analysis](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/PlayerAnalysis.tsx): `app/src/pages/dashboard/PlayerAnalysis.tsx`
- [Pick discovery](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/PickFinder.tsx): `app/src/pages/dashboard/PickFinder.tsx`
- [Trend analysis](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Trends.tsx): `app/src/pages/dashboard/Trends.tsx`
- [Saved picks](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/SavedPicks.tsx): `app/src/pages/dashboard/SavedPicks.tsx`
- [Analytics](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Analytics.tsx): `app/src/pages/dashboard/Analytics.tsx`
- [Model performance](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/ModelPerformance.tsx): `app/src/pages/dashboard/ModelPerformance.tsx`
- [Community](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Community.tsx): `app/src/pages/dashboard/Community.tsx`
- [Messaging](https://github.com/kennethhuang7/courtvision/blob/main/app/src/pages/dashboard/Messages.tsx): `app/src/pages/dashboard/Messages.tsx`
- [Streamlit dashboard](https://github.com/kennethhuang7/courtvision/blob/main/streamlit/streamlit_app/Home.py): `streamlit/streamlit_app/Home.py`

### Prediction pipeline

- [Game prediction](https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/predict_games.py): `src/predictions/predict_games.py`
- [Confidence scoring](https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/confidence_scoring.py): `src/predictions/confidence_scoring.py`
- [Feature explanations](https://github.com/kennethhuang7/courtvision/blob/main/src/predictions/feature_explanations.py): `src/predictions/feature_explanations.py`
- [Feature engineering](https://github.com/kennethhuang7/courtvision/blob/main/src/feature_engineering/build_features.py): `src/feature_engineering/build_features.py`
- [Team statistics](https://github.com/kennethhuang7/courtvision/blob/main/src/feature_engineering/team_stats_calculator.py): `src/feature_engineering/team_stats_calculator.py`
- [Model training](https://github.com/kennethhuang7/courtvision/blob/main/src/models/train_catboost.py): `src/models/train_catboost.py`

### Data operations

- [Data collection](https://github.com/kennethhuang7/courtvision/blob/main/src/data_collection/update_yesterday_games.py): `src/data_collection/update_yesterday_games.py`
- [Daily pipeline](https://github.com/kennethhuang7/courtvision/blob/main/src/automation/daily_pipeline.py): `src/automation/daily_pipeline.py`
- **NBA data store**

### Other components

- **Desktop user**
- **Hosted backend**

## Connections

- Desktop user → Electron shell: launches (evidence: `README.md`)
- Electron shell → App router: hosts
- App router → Account screens: routes (evidence: `app/src/App.tsx`)
- App router → Predictions: routes (evidence: `app/src/App.tsx`)
- App router → Player analysis: routes (evidence: `app/src/App.tsx`)
- App router → Pick discovery: routes (evidence: `app/src/App.tsx`)
- App router → Trend analysis: routes (evidence: `app/src/App.tsx`)
- App router → Saved picks: routes (evidence: `app/src/App.tsx`)
- App router → Analytics: routes (evidence: `app/src/App.tsx`)
- App router → Model performance: routes (evidence: `app/src/App.tsx`)
- App router → Community: routes (evidence: `app/src/App.tsx`)
- App router → Messaging: routes (evidence: `app/src/App.tsx`)
- Predictions → Hosted backend: requests live data
- Community → Hosted backend: social services
- Messaging → Hosted backend: messaging services
- Game prediction → Confidence scoring: scores confidence (evidence: `src/predictions/predict_games.py`)
- Game prediction → Feature explanations: builds explanations (evidence: `src/predictions/predict_games.py`)
- Game prediction → Team statistics: uses team stats (evidence: `src/predictions/predict_games.py`)
- Feature engineering → Team statistics: calculates ratings (evidence: `src/feature_engineering/build_features.py`)
- Model training → Hosted backend: publishes predictions
- Daily pipeline → Data collection: runs collection
- Data collection → NBA data store: writes game data
- Feature engineering → NBA data store: reads historical data
- Streamlit dashboard → NBA data store: queries analytics
