Open Source · TypeScript · Woodworking

Parametric design for the traditional Japanese toolbox

Japanese Toolbox Designer is a browser-based tool for designing the traditional Japanese toolbox with inset end walls, integral grab handles and the characteristic sliding lid secured by a captured tapered wedge.

The application calculates the interacting relationships between overall box dimensions, inset end walls, housing dados, end caps, asymmetric lid overlaps, release travel, locking batten and the captured tapered wedge.

React 19TypeScriptThree.jsReact Three FiberSVGpdf-libZodVitestPlaywright

The woodworking problem

The difficult part is the lid

The carcass of a Japanese toolbox is relatively straightforward joinery: long side boards, housed end walls, grab handles and a fastened bottom. But the traditional sliding lid mechanism contains a web of tightly interacting physical dimensions that are frustratingly awkward to calculate by hand.

When closed, the lid panel slides under fixed wooden end caps at both ends. To remove the lid, the tapered locking wedge is pulled out, allowing the lid to slide backwards into the locking-end pocket until the opposite end clears its end cap and can be lifted clear.

The lid cannot flex. The clearance required to lift one end must be fully provided by the backwards slide into the opposite pocket, while remaining mechanically retained when locked.

The application enforces the exact kinematic conditions required for this mechanism:

  • ·Asymmetric lid overlaps: Independent stop-end (6 mm) and locking-end (20 mm) overlaps maximise support while minimising required pocket depth.
  • ·Deterministic release travel: Validates that available travel exceeds the stop-end overlap with a positive safety margin so the lid never binds.
  • ·Compound locking wedge: Calculates a 2° plan taper for progressive clamping action and a 10° vertical undercut retention bevel that prevents the wedge from falling out if the toolbox is turned upside down.

Joinery and anatomy

Housed inset-end construction

The application models a traditional joinery arrangement designed for strength, functional handling and long-term timber stability.

Inset housed end walls

End walls are set in from the carcass ends and seated in 3 mm shallow housing dados cut into the side boards, resisting racking forces without exposed fasteners.

Integral grab handles

The side-board extensions create natural handle bays, spanned by thick solid grab handles that provide comfortable single-handed or two-handed carrying.

Independent bottom board

A full-footprint bottom board with configurable thickness, allowing heavier stock for the base without unnecessarily increasing carcass wall weight.

Captured wedge system

Fixed end caps, a straight stop batten, and a complementary tapered locking batten that traps the wedge against the side wall under tension.

Complete workshop workflow

Core features

Designed as a practical CAD tool for real workshop projects, from initial parameter sizing to technical drawings and printing a cutting schedule.

Parametric geometry

Change any dimension and the entire toolbox model recalculates instantly from one authoritative TypeScript domain engine.

Metric and Imperial

Exact millimetre precision internally with seamless display formatting between whole millimetres and 1/16-inch woodworking fractions.

Technical drawings

Interactive Front, Plan and End SVG vector drawings with architectural dimension lines, annotation callouts, zooming and panning.

Interactive 3D model

WebGL Three.js model showing 13 individual physical parts, compound dados, wood species materials and standard camera presets.

Local design library

Manage named designs locally in the browser with New, Save, Open, Rename, Duplicate and Delete workflows.

JSON interchange

Portable single-file JSON import and export for offline sharing, with automatic Schema V1 and V2 in-memory migration.

Wood species catalogue

9 bundled wood species (Hinoki, Japanese Cedar, Pine, Douglas Fir, Paulownia, Ash, Oak, Beech, Custom) with zero external asset requests.

Workshop cut list

Calculated stock blank bill of materials (8 line items, 12 blanks, 13 finished parts, 1 combined locking set blank).

23-step process plan

Deterministic joinery sequence covering stock preparation, carcass dados, handle shaping, lid fitting and compound wedge manufacture.

Client-generated workshop PDF

Structured multi-page A4 PDF generated entirely in the browser using pdf-lib, containing project specifications, vector technical drawings, a complete cut list table and paginated process instructions.

Architecture

One geometry model, many outputs

The fundamental architectural rule of the application is strict single-source geometry:

There is exactly one authoritative implementation of the toolbox geometry.

React form controls do not calculate joinery dimensions. SVG viewers do not compute cut lines. The Three.js 3D viewer does not derive part sizes. The cut list and PDF exporter do not independently reproduce formulas.

Every view, renderer and export pipeline is a pure projection of the canonical CalculatedToolboxGeometry data structure. This design rule made rapid iterative refactoring safe throughout development.

ToolboxDesign (Input Parameters)
↓
CalculatedToolboxGeometry (Authoritative Engine)
┌──────────────┬──────────────┬──────────────┬──────────────┐
2D SVG
3D WebGL
Cut List
Process Plan
└──────────────┴──────────────┴──────────────┴──────────────┘
↓
Client-Side Workshop PDF (pdf-lib)

Technology stack

Modern, lightweight and zero-dependency

Built with a modern TypeScript and React 19 toolchain, relying on browser standards rather than server infrastructure.

React 19 & TypeScript

Strict type checking, modern component state and deterministic property flow.

Three.js & R3F

Hardware-accelerated 3D rendering with lazy chunk loading (~935 kB deferred).

SVG & pdf-lib

Vector technical drawings and client-side multi-page A4 document composition.

Vitest & Playwright

Comprehensive unit, component and cross-browser testing across Chromium, Firefox and WebKit.

Engineering method

Human judgement, ChatGPT and Junie

Japanese Toolbox Designer was not built by asking an AI model to write an entire application at once. It was created through a disciplined three-way engineering collaboration where each participant had distinct, complementary responsibilities.

Product & Engineering Direction

Paul Cunningham

  • ·Identified the original woodworking problem and requirements.
  • ·Evaluated physical joinery and mechanical clearance constraints.
  • ·Reviewed UI layouts, SVG drawings, 3D meshes and PDF exports.
  • ·Identified incorrect construction assumptions and real-world issues.
  • ·Decided when designs were mechanically and visually acceptable.

Reasoning & Specifications

ChatGPT

  • ·Reasoned through mechanical joinery and lid kinematic formulas.
  • ·Structured requirements into formal PRDs and phased architecture.
  • ·Authored detailed specifications and prompts for each phase.
  • ·Reviewed Junie's implementation summaries against requirements.
  • ·Diagnosed mathematical edge cases and proposed refinements.

Implementation & Verification

JetBrains Junie AI

  • ·Worked directly in the WebStorm repository workspace.
  • ·Implemented each specified phase in TypeScript, React, SVG and Three.js.
  • ·Wrote extensive Vitest and Playwright test suites.
  • ·Ran build, lint and test verification after every phase.
  • ·Maintained technical documentation and reported completed work.

Disciplined delivery

AI-assisted engineering, not one-shot "vibe coding"

The project was deliberately developed through a sequence of small, reviewable, testable phases rather than an unconstrained single prompt.

AI accelerated code generation and refactoring dramatically, but the quality of the finished software relied entirely on maintaining tight feedback loops and rigorous engineering standards.

The Engineering Feedback Loop

1. Problem or requirement definition
↓
2. Human discussion and mechanical engineering decision
↓
3. ChatGPT specification and structured phase prompt
↓
4. Junie autonomous implementation in WebStorm
↓
5. Automated unit, component and browser test suites
↓
6. Human visual and mechanical review in browser and PDF
↓
7. Correction or advance to next phase

Real-world learning

The design changed when the evidence changed

Genuine engineering is demonstrated when initial assumptions are challenged and corrected through evidence during development.

The carcass model was corrected

An early prototype placed the end walls flush at the carcass ends. Physical evaluation showed this lacked traditional racking resistance and lost the integral grab handles.

The domain model was revised to support inset end walls, 3 mm housing dados, handle recesses, solid grab handles and independent bottom thickness. All views, 3D meshes and migrations were updated seamlessly.

The lid geometry evolved

The first implementation assumed symmetrical lid overlaps at both ends. Practical dimension testing revealed that symmetric overlaps forced end caps to be unnecessarily wide.

The geometry engine was generalised to support independent asymmetric overlaps (6 mm stop end, 20 mm locking end), with automatic migration preserving existing user designs.

Visual output was verified visually

Subtle layout issues — such as clipped dimension text in generated PDFs, overlapping Plan annotations, and sub-optimal wide-monitor space usage — were discovered through direct human inspection.

Each issue was isolated and resolved in dedicated follow-up phases backed by visual regression tests.

Quality assurance

Tested as the design evolved

Automated testing was written alongside feature code rather than added as an afterthought.

Critical woodworking relationships are tested against hand-calculated mathematical fixtures rather than simply duplicating production formulas.

296

Vitest unit & component tests

36

Playwright E2E browser tests

332

Total test definitions

Multi-tier testing strategy

  • ·Pure domain geometry calculations and hand-verified fixture assertions.
  • ·Schema validation, unit conversions and fractional Imperial parsing.
  • ·React Testing Library component tests for editors, managers and workshop views.
  • ·Renderer-neutral 2D vector projections and 3D mesh model generation.
  • ·Cross-browser Playwright E2E coverage across Chromium, Firefox and WebKit.
  • ·GitHub Actions continuous integration with strict type checking and linting.

Simplicity & Privacy

Zero-backend, browser-only architecture

The entire application runs client-side inside the user's browser without requiring a server or database.

No accounts or telemetry

No login required, no tracking cookies, and zero user data transmitted across the network.

Local storage & JSON files

Designs persist in browser local storage and export as portable single-file JSON documents.

Static edge hosting

Deployed directly to GitHub Pages with instant loading and near-zero operational complexity.

Fast client generation

3D WebGL scenes, vector SVG drawings and multi-page A4 PDFs render directly on the client machine.

Future roadmap

What comes next for V2

Potential candidates for future exploration and enhancement planned for V2:

Exploded 3D view

Visualise separate component parts in 3D space to clarify joinery and assembly relationships.

Animated lid and wedge operation

Interactive kinematics visualising wedge removal, backwards lid sliding, lifting and seating.

Richer wood rendering

Procedural timber grain shaders and realistic texturing while maintaining zero external downloads.

Alternative Japanese constructions

Support for through dovetails, finger joints and alternative traditional toolbox arrangements.

Internal trays and fittings

Optional removable nested trays, tool dividers and internal storage compartments.

Stock cutting layout optimisation

Automated nesting algorithms to calculate efficient cutting layouts from standard timber stock with kerf allowance.

Weight and cost estimation

Calculate estimated finished weight and board-foot material costs using timber density tables.

DXF and 3D export

Export 2D vector technical drawings to DXF and 3D geometry to STL / GLTF mesh formats.

Printable PDF drawing scales

Explicit printable architectural scales such as 1:5 or 1:10 for workshop use.

Shareable design URLs

Encode complete design parameters into lightweight, portable and shareable web links.

Installable Progressive Web App (PWA)

Offline installation manifest allowing woodworkers to use the application in the workshop without an internet connection.

Engineering reflection

Software engineering with AI

AI accelerated the implementation, but the finished application came from repeated cycles of modelling, testing, review and correction. The useful part of AI-assisted software engineering is not generating a lot of code quickly; it is using the tools within a disciplined engineering process.

Free and open source

Japanese Toolbox Designer is released under the permissive MIT licence and is freely available for woodworkers and developers.

MIT LicenceOpen SourceTypeScript & React

Try Japanese Toolbox Designer

Launch the live browser application to design a custom toolbox, or explore the TypeScript and Three.js source code on GitHub.