# dotabuff/d2vpkr architecture

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

- Interactive diagram: https://gitdiagram.com/dotabuff/d2vpkr
- Repository: https://github.com/dotabuff/d2vpkr

## Overview

D2VPKr tracks a selected subset of Dota 2 files and documents automatic VDF-to-JSON conversions. The sampled Go runtime is a small command-line VPK extractor: users provide an archive and destination, optionally filter files, and the tool writes selected entries. It also has a separate version-reporting mode that reads Steam’s steam.inf. The conversion mechanism is not represented in the sampled source, so its implementation and connections are omitted.

Main entry points: [`d2vpk.go`](https://github.com/dotabuff/d2vpkr/blob/master/d2vpk.go) (VPK Extractor)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_extractor["VPK Extractor<br/>[d2vpk.go]"]
node_archive["VPK Archive"]
node_vpklib["VPK Reader"]
node_output["Extracted Files"]
node_steam_inf["Steam steam.inf"]
node_tracked["Tracked Dota Files"]

node_user -->|"invokes"| node_extractor
node_archive -->|"supplies archive"| node_extractor
node_extractor -->|"reads entries"| node_vpklib
node_extractor -->|"writes selected files"| node_output
node_extractor -->|"reads version file"| node_steam_inf
node_extractor -->|"prints version"| node_user

click node_extractor "https://github.com/dotabuff/d2vpkr/blob/master/d2vpk.go"
click node_tracked "https://github.com/dotabuff/d2vpkr/tree/master/dota"

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_user toneBlue
class node_extractor,node_tracked toneTeal
class node_archive,node_vpklib,node_output,node_steam_inf toneIndigo
```

## Components

### Other components

- **User**
- [VPK Extractor](https://github.com/dotabuff/d2vpkr/blob/master/d2vpk.go): `d2vpk.go`
- **VPK Archive**
- **VPK Reader**
- **Extracted Files**
- **Steam steam.inf**
- [Tracked Dota Files](https://github.com/dotabuff/d2vpkr/tree/master/dota): `dota`

## Connections

- User → VPK Extractor: invokes (evidence: `d2vpk.go`)
- VPK Archive → VPK Extractor: supplies archive (evidence: `d2vpk.go`)
- VPK Extractor → VPK Reader: reads entries (evidence: `d2vpk.go`)
- VPK Extractor → Extracted Files: writes selected files (evidence: `d2vpk.go`)
- VPK Extractor → Steam steam.inf: reads version file (evidence: `d2vpk.go`)
- VPK Extractor → User: prints version (evidence: `d2vpk.go`)
