# nick-hageman/smartdart architecture

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

- Interactive diagram: https://gitdiagram.com/nick-hageman/smartdart
- Repository: https://github.com/nick-hageman/smartdart

## Overview

SmartDart combines a Raspberry Pi scoring station with an iOS companion app. In the documented workflow, a camera captures throws, the vision model localizes darts and calibration points to predict scores, and a Tkinter GUI displays scores and synchronizes them through Firebase. Players use the app for ongoing games, score corrections, accounts, history, and Elo rankings. The README also describes model fine-tuning and augmentation. No source excerpts were available, so relationships below are limited to README-documented behavior.

Main entry points: [`SmartDart-Computer-Vision`](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision) (Dart Detection), [`SmartDart-GUI`](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI) (Throw Capture), [`SmartDart-App`](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App) (iOS Companion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Embedded Vision"]
  node_camera["Board Camera"]
  node_capture["Throw Capture"]
  node_detection["Dart Detection"]
  node_calibration["Board Calibration"]
  node_scoring["Score Prediction"]
  node_training["Model Fine-Tuning"]
  node_display["Score Display"]
  node_sync["Score Sync"]
end

subgraph group_mobile["Mobile App"]
  node_app["iOS Companion"]
  node_correction["Score Correction"]
  node_accounts["User Accounts"]
  node_gameplay["Game Management"]
  node_history["Game History"]
  node_rankings["Elo Rankings"]
end

subgraph group_cloud["Shared Services"]
  node_firebase[("Firebase")]
end

node_players(("Players"))

node_camera -->|"captures throws"| node_capture
node_capture -->|"provides images"| node_detection
node_detection -->|"detects keypoints"| node_calibration
node_calibration -->|"maps dart positions"| node_scoring
node_training -->|"fine-tunes model"| node_detection
node_scoring -->|"displays scores"| node_display
node_display -->|"synchronizes scores"| node_sync
node_sync -->|"syncs through"| node_firebase
node_players -->|"uses"| node_app
node_app -->|"connects for accounts and games"| node_firebase
node_players -->|"corrects predictions"| node_correction
node_players -->|"manages games"| node_gameplay
node_players -->|"tracks history"| node_history
node_players -->|"monitors rankings"| node_rankings

click node_capture "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI"
click node_detection "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision"
click node_calibration "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision"
click node_scoring "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision"
click node_training "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision"
click node_display "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI"
click node_sync "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI"
click node_app "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App"
click node_correction "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App"
click node_accounts "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App"
click node_gameplay "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App"
click node_history "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App"
click node_rankings "https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App"

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_camera,node_capture,node_detection,node_calibration,node_scoring,node_training,node_display,node_sync toneBlue
class node_app,node_correction,node_accounts,node_gameplay,node_history,node_rankings toneAmber
class node_firebase toneMint
class node_players toneIndigo
```

## Components

### Embedded Vision

- **Board Camera**
- [Throw Capture](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI): `SmartDart-GUI`
- [Dart Detection](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision): `SmartDart-Computer-Vision`
- [Board Calibration](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision): `SmartDart-Computer-Vision`
- [Score Prediction](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision): `SmartDart-Computer-Vision`
- [Model Fine-Tuning](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-Computer-Vision): `SmartDart-Computer-Vision`
- [Score Display](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI): `SmartDart-GUI`
- [Score Sync](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-GUI): `SmartDart-GUI`

### Mobile App

- [iOS Companion](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App): `SmartDart-App`
- [Score Correction](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App): `SmartDart-App`
- [User Accounts](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App): `SmartDart-App`
- [Game Management](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App): `SmartDart-App`
- [Game History](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App): `SmartDart-App`
- [Elo Rankings](https://github.com/nick-hageman/smartdart/tree/main/SmartDart-App): `SmartDart-App`

### Shared Services

- **Firebase**

### Other components

- **Players**

## Connections

- Board Camera → Throw Capture: captures throws (evidence: `README.md`)
- Throw Capture → Dart Detection: provides images (evidence: `README.md`)
- Dart Detection → Board Calibration: detects keypoints (evidence: `README.md`)
- Board Calibration → Score Prediction: maps dart positions (evidence: `README.md`)
- Model Fine-Tuning → Dart Detection: fine-tunes model (evidence: `README.md`)
- Score Prediction → Score Display: displays scores (evidence: `README.md`)
- Score Display → Score Sync: synchronizes scores (evidence: `README.md`)
- Score Sync → Firebase: syncs through (evidence: `README.md`)
- Players → iOS Companion: uses (evidence: `README.md`)
- iOS Companion → Firebase: connects for accounts and games (evidence: `README.md`)
- Players → Score Correction: corrects predictions (evidence: `README.md`)
- Players → Game Management: manages games (evidence: `README.md`)
- Players → Game History: tracks history (evidence: `README.md`)
- Players → Elo Rankings: monitors rankings (evidence: `README.md`)
