# nin-jat/beans-wheels architecture

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

- Interactive diagram: https://gitdiagram.com/nin-jat/beans-wheels
- Repository: https://github.com/nin-jat/beans-wheels

## Overview

This repository combines a BeamNG wheel-data asset, a Node.js catalog post-processor, and a static browser catalog. The browser workflow loads its JSON catalog, then lets users browse wheels by brand or size, search names, and open wheel details with tire information. The ingest script parses game data and wheel images into a generated JSON structure, but its output is named `output.json` while the web app fetches `web/wheels.json`; the available evidence does not establish how those datasets are connected. The BeamNG and HTML files were not sampled, so their internal behavior is not inferred.

Main entry points: [`web/script.js`](https://github.com/nin-jat/beans-wheels/blob/main/web/script.js) (Browse and details), [`post-processor/ingest.js`](https://github.com/nin-jat/beans-wheels/blob/main/post-processor/ingest.js) (Catalog ingester), [`web/index.html`](https://github.com/nin-jat/beans-wheels/blob/main/web/index.html) (Catalog page), [`web/wheels.json`](https://github.com/nin-jat/beans-wheels/blob/main/web/wheels.json) (Browser catalog data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game assets"]
  node_beamng_wheels["Wheel definitions<br/>[wheels.lua]"]
end

subgraph group_processing["Catalog processing"]
  node_ingest["Catalog ingester<br/>[ingest.js]"]
  node_generated_catalog["Generated catalog"]
end

subgraph group_web["Wheel browser"]
  node_web_catalog["Browser catalog data<br/>[wheels.json]"]
  node_page["Catalog page<br/>[index.html]"]
  node_browser["Browse and details<br/>[script.js]"]
  node_wheel_images["Wheel images"]
end

node_visitor(("Catalog visitor"))
node_game_input["Game data and images"]

node_game_input -->|"reads data and images"| node_ingest
node_ingest -->|"writes JSON"| node_generated_catalog
node_visitor -.->|"browses catalog"| node_browser
node_browser -->|"fetches JSON"| node_web_catalog
node_browser -->|"references images"| node_wheel_images
node_page -->|"provides page elements"| node_browser

click node_beamng_wheels "https://github.com/nin-jat/beans-wheels/blob/main/beamng/wheels.lua"
click node_ingest "https://github.com/nin-jat/beans-wheels/blob/main/post-processor/ingest.js"
click node_web_catalog "https://github.com/nin-jat/beans-wheels/blob/main/web/wheels.json"
click node_page "https://github.com/nin-jat/beans-wheels/blob/main/web/index.html"
click node_browser "https://github.com/nin-jat/beans-wheels/blob/main/web/script.js"
click node_wheel_images "https://github.com/nin-jat/beans-wheels/tree/main/web/wheels"

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_beamng_wheels toneBlue
class node_ingest,node_generated_catalog toneAmber
class node_web_catalog,node_page,node_browser,node_wheel_images toneMint
class node_visitor,node_game_input toneIndigo
```

## Components

### Game assets

- [Wheel definitions](https://github.com/nin-jat/beans-wheels/blob/main/beamng/wheels.lua): `beamng/wheels.lua`

### Catalog processing

- [Catalog ingester](https://github.com/nin-jat/beans-wheels/blob/main/post-processor/ingest.js): `post-processor/ingest.js`
- **Generated catalog**

### Wheel browser

- [Browser catalog data](https://github.com/nin-jat/beans-wheels/blob/main/web/wheels.json): `web/wheels.json`
- [Catalog page](https://github.com/nin-jat/beans-wheels/blob/main/web/index.html): `web/index.html`
- [Browse and details](https://github.com/nin-jat/beans-wheels/blob/main/web/script.js): `web/script.js`
- [Wheel images](https://github.com/nin-jat/beans-wheels/tree/main/web/wheels): `web/wheels`

### Other components

- **Catalog visitor**
- **Game data and images**

## Connections

- Game data and images → Catalog ingester: reads data and images (evidence: `post-processor/ingest.js`)
- Catalog ingester → Generated catalog: writes JSON (evidence: `post-processor/ingest.js`)
- Catalog visitor → Browse and details: browses catalog
- Browse and details → Browser catalog data: fetches JSON (evidence: `web/script.js`)
- Browse and details → Wheel images: references images (evidence: `web/script.js`)
- Catalog page → Browse and details: provides page elements (evidence: `web/script.js`)
