One graphics kit, eleven bikes: storing dirt bike fitment as data
When I started building a graphics kit designer for dirt bikes, I assumed every bike needed its own kit. It doesn't. Manufacturers reuse plastics across years and engine sizes, so a kit cut for one bike often lines up on
When I started building a graphics kit designer for dirt bikes, I assumed every bike needed its own kit. It doesn't. Manufacturers reuse plastics across years and engine sizes, so a kit cut for one bike often lines up on several others. The 2023 Yamaha YZ450F kit, for example, also fits the YZ450FX, the YZ250F and the YZ250FX across 2024 to 2026. That is eleven model and year combinations from one set of panel shapes.
So the useful unit of data is a reference bike plus the list of everything that shares its plastics.
The shape I ended up with
Each entry is one reference bike, and fitment is a flat list of strings:
{
"id": "honda-crf450r-2025",
"brand": "Honda",
"model": "CRF450R",
"reference_year": "2025",
"category": "MX",
"fits": ["2025 CRF450R", "2026 CRF450R", "2025 CRF250R", "2026 CRF250R"]
}
A flat list is easy to search and easy to show under a bike in the UI. Grouping by model can happen at render time.
Things that broke my assumptions
Names are not consistent. The bike is the KTM 450 SX-F, but its fitment entries read SXF450, SXF350 and so on. Kawasaki's KX450 shows up as KXF450. I store the display name on the reference bike and keep the fitment strings as they are, so the two never have to match.
Electric bikes have no model year. The Stark Varg fits by version instead, "1.0 VARG MX" and "1.5 VARG MX", so reference_year had to be nullable.
Fitment also runs forward. The KTM 450 EXC-F kit is built on 2025 plastics, and its list already includes 2027 models. A field that only tracked past years would not have held that.
What is still missing
Aftermarket plastics. Brands like Acerbis and Polisport often follow the stock shape, but not always, and I have no clean source for the exceptions yet. If you have tracked this kind of data before, I would like to hear how.
I use this list in the designer I am building at customdirtbikegraphics.com, where the fitment shows up next to each bike.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.