# jackseg80/tire_management architecture

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

- Interactive diagram: https://gitdiagram.com/jackseg80/tire_management
- Repository: https://github.com/jackseg80/tire_management

## Overview

TeslaMate Tire Management tracks tire models and installation periods, calculates performance statistics from TeslaMate drive data, and presents comparisons in Grafana. The documented workflow is to install the SQL schema, enter or change tire-set records, run the statistics update (manually or with the supplied script), then view results through the dashboard. The README documents the database function’s filters and metrics, but no source excerpts were provided, so internal SQL calls and dashboard query details are not independently verified.

Main entry points: [`tire_management.sql`](https://github.com/jackseg80/tire_management/blob/main/tire_management.sql) (Statistics Update), [`tire_dashboard.json`](https://github.com/jackseg80/tire_management/blob/main/tire_dashboard.json) (Tire Dashboard), [`update_current_tire.sh`](https://github.com/jackseg80/tire_management/blob/main/update_current_tire.sh) (Update Script)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Tire Data"]
  node_tire_records[("Tire Records")]
end

subgraph group_analytics["Statistics"]
  node_stats["Statistics Update"]
  node_update_script["Update Script"]
  node_stats_view[("Statistics View")]
end

subgraph group_visualization["Dashboard"]
  node_dashboard["Tire Dashboard"]
end

node_owner(("Tire Manager"))
node_teslamate_db[("TeslaMate PostgreSQL")]
node_grafana["Grafana"]

node_owner -->|"manages sets"| node_tire_records
node_owner -->|"runs update"| node_stats
node_update_script -->|"triggers update"| node_stats
node_stats -->|"reads drives"| node_teslamate_db
node_stats -->|"updates metrics"| node_stats_view
node_grafana -->|"imports"| node_dashboard
node_dashboard -->|"displays statistics"| node_stats_view

click node_tire_records "https://github.com/jackseg80/tire_management/blob/main/tire_management.sql"
click node_stats "https://github.com/jackseg80/tire_management/blob/main/tire_management.sql"
click node_update_script "https://github.com/jackseg80/tire_management/blob/main/update_current_tire.sh"
click node_stats_view "https://github.com/jackseg80/tire_management/blob/main/tire_management.sql"
click node_dashboard "https://github.com/jackseg80/tire_management/blob/main/tire_dashboard.json"

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_tire_records toneBlue
class node_stats,node_update_script,node_stats_view,node_teslamate_db toneAmber
class node_dashboard toneMint
class node_owner,node_grafana toneIndigo
```

## Components

### Tire Data

- [Tire Records](https://github.com/jackseg80/tire_management/blob/main/tire_management.sql): `tire_management.sql`

### Statistics

- [Statistics Update](https://github.com/jackseg80/tire_management/blob/main/tire_management.sql): `tire_management.sql`
- [Update Script](https://github.com/jackseg80/tire_management/blob/main/update_current_tire.sh): `update_current_tire.sh`
- [Statistics View](https://github.com/jackseg80/tire_management/blob/main/tire_management.sql): `tire_management.sql`

### Dashboard

- [Tire Dashboard](https://github.com/jackseg80/tire_management/blob/main/tire_dashboard.json): `tire_dashboard.json`

### Other components

- **Tire Manager**
- **TeslaMate PostgreSQL**
- **Grafana**

## Connections

- Tire Manager → Tire Records: manages sets (evidence: `README.md`)
- Tire Manager → Statistics Update: runs update (evidence: `README.md`)
- Update Script → Statistics Update: triggers update (evidence: `README.md`)
- Statistics Update → TeslaMate PostgreSQL: reads drives (evidence: `README.md`)
- Statistics Update → Statistics View: updates metrics (evidence: `README.md`)
- Grafana → Tire Dashboard: imports (evidence: `README.md`)
- Tire Dashboard → Statistics View: displays statistics (evidence: `README.md`)
