DEV Community

Custom Dirt Bike Graphics
Custom Dirt Bike Graphics

Posted on

Cataloging 34 Golf Cart Body Styles as Flat JSON for Wrap Panel Mapping

When I started building a reference catalog for golf cart vinyl wraps, I expected a short lookup table by brand and year. That assumption broke down almost immediately once I looked at how manufacturers actually reuse and modify body shells.

A model name like "Club Car Onward" covers multiple distinct body footprints. A standard 2 passenger cart, a rear-facing 4 passenger cart, a lifted 4 passenger version, and a 6 passenger stretched frame share trim details, yet their side panel proportions and rear quarter layouts differ. The same pattern shows up across E-Z-GO (RXV, TXT, Express, Valor), Yamaha (Drive2, G29), Evolution, ICON, Bintelli, and Denago EV.

Why a flat JSON schema worked better than nested trees

My first draft grouped everything in a three-level tree: brand, model family, then seating variant. That looked tidy when reading the file by eye, until I needed to filter by body traits or export tabular rows for dataset viewers. Every downstream consumer had to flatten the tree again.

Switching to a single flat array of 34 objects removed that boilerplate. Each entry carries five plain fields:

{
  "id": "cc-onward4-lifted",
  "brand": "Club Car",
  "model": "Onward Lifted 4 Passenger",
  "reference_year": "2026",
  "body_configuration": "Lifted, rear-facing second row, gas, Glacier White"
}
Enter fullscreen mode Exit fullscreen mode

At the top level of the file, I kept only the shared catalog metadata: the four main wrap zones (Front cowl, Left side panel, Right side panel, Rear body), the four common vinyl finish categories (gloss, matte, chrome, holographic), and an explicit scope note stating that these entries represent visual body configurations for reference and do not specify cutting dimensions or cross-year template guarantees.

Keeping the scope explicit saved headaches later. In vehicle wrap work, body shells often look identical in photos while differing slightly around headlight cutouts, fender flares, or rear bag wells. Labeling the dataset honestly as a body-configuration reference keeps downstream tools from treating it as a CAD die-cut spec.

Shipping the same dataset without runtime file paths

Once the JSON stabilized, I wanted other small tools to read it without shipping fragile relative file paths or network fetches at startup. Go's //go:embed directive made that straightforward:

//go:embed models.json
var rawModels []byte
Enter fullscreen mode Exit fullscreen mode

Embedding the file directly into the binary keeps the module at zero external dependencies. The package parses the embedded bytes once into a slice and exposes simple lookup helpers (All(), ByBrand(), ByID(), and Brands()). Because the same models.json file sits at the repository root alongside a Markdown table and a standalone static browser viewer, updating one row keeps every format aligned without a build pipeline.

Small details that tripped me up

A few practical snags came up while putting the catalog together:

  1. Brand spelling consistency: E-Z-GO is typed five different ways in user queries (EZGO, EZ-GO, E-Z-Go, ezgo). Keeping the canonical manufacturer spelling in brand while normalizing hyphens and casing inside lookup functions avoided missed matches.
  2. Dataset viewer quirks: Nested JSON files often fail automatic table previewers on open dataset hosts. Generating a companion records.jsonl file (one flat JSON object per line) from the same source array fixed tabular previews immediately.
  3. Keeping left and right panels distinct: Treating side graphics as a mirrored single panel breaks text and logos on the opposite side of the cart. Keeping Left side panel and Right side panel as separate zones in the reference schema matches how real wrap layouts handle orientation.

The full 34-model JSON catalog, Markdown tables, static viewer, and Go package are open under the MIT license in dirt-bike-graphics/golf-cart-wraps. If you have worked with other niche vehicle fitment datasets (especially older pre-2010 body shells where model-year boundaries get fuzzy), I would be curious how you structure versioned chassis changes.

Top comments (0)