Skip to content

Under the hood of the 3D closet configurator

One rule governs the codebase: nobody computes geometry except the engine. The 3D layer only draws the engine's parts list, and pricing only measures it.

Pure layers in the middle, frameworks at the edges

The engine, pricing, catalogue, units and room layers import no React, Next.js or three.js, which a lint rule enforces. They run in node for tests and on the server for the price endpoint.

Shop JSON

limits · rules · materials · prices

Catalogue

Zod-validated

Configuration

the customer's design

Engine

layout · parts · rules · autofix

Resolved model

parts · compartments · fronts · issues

3D scene

draws the parts list

Pricing

measures the parts list

Cart and share link

Price API

A few decisions that keep it simple

Integer millimetres

Everywhere inside. Inches and centimetres exist only at the interface edge.

Every change goes through autofix

The store never holds an invalid state, and each repair becomes a visible notice.

Integer minor units

Prices are cents; tax-inclusive shops store gross prices.

One coordinate frame

Origin at the bottom-left-back corner, compartments listed top-down; the 3D layer divides by a thousand.

Tested where it matters

The engine has unit tests per rule and two fuzz suites that throw random configurations and random room sessions at it. The browser tests drive the real 3D scene: configuring, sharing, the imperial shop, the cart, drag and drop, sloped ceilings, drawers, the room planner, and an axe accessibility audit.

  • Unit tests on units, catalogue, engine, pricing, store, room and codecs
  • 1 500 random configurations and 250 random room sessions
  • End-to-end flows with 3D picking in Chromium
  • A 16 ms budget on resolving a full cabinet

Deploys as a plain Next.js app

No database and no external services: a shared design lives in the URL, the cart in the browser. The shop catalogues are read from disk at request time. It runs on Vercel or any Node host.