# florianfesti/boxes architecture

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

- Interactive diagram: https://gitdiagram.com/florianfesti/boxes
- Repository: https://github.com/florianfesti/boxes

## Overview

Boxes.py is a parametric laser-cut design generator: users choose a box or other design, set material and geometry parameters, and receive vector artwork. Its documented entry points include an online generator, an Inkscape plug-in, and a reusable Python library; the tree also exposes CLI and server entry points. The graph highlights generator families, geometric construction, and vector export. Several generator modules are unsampled, so their broader capabilities are represented at the directory level; links without direct evidence are omitted.

Main entry points: [`boxes/__init__.py`](https://github.com/florianfesti/boxes/blob/master/boxes/__init__.py) (Box construction), [`boxes/scripts/boxes_main.py`](https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxes_main.py) (CLI entry), [`boxes/scripts/boxesserver.py`](https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxesserver.py) (Web server), [`boxes/generators/__init__.py`](https://github.com/florianfesti/boxes/blob/master/boxes/generators/__init__.py) (Generator registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI entry<br/>[boxes_main.py]"]
  node_web["Web server<br/>[boxesserver.py]"]
  node_plugin["Inkscape plug-in<br/>[gears.py]"]
  node_generator_cli["Generator CLI<br/>[boxes_generator.py]"]
end

subgraph group_designs["Parametric designs"]
  node_registry["Generator registry<br/>[__init__.py]"]
  node_families["Design generators"]
end

subgraph group_geometry["Geometry engine"]
  node_core["Box construction<br/>[__init__.py]"]
  node_joints["Joints and edges<br/>[edges.py]"]
  node_lids["Lids and closures<br/>[lids.py]"]
  node_wall_edges["Wall edges<br/>[walledges.py]"]
  node_parts["Reusable parts<br/>[parts.py]"]
  node_gears["Gear designs<br/>[gears.py]"]
  node_pulleys["Pulley designs<br/>[pulley.py]"]
  node_vectors["Vector math<br/>[vectors.py]"]
end

subgraph group_output["Vector output"]
  node_drawing["Drawing context<br/>[drawing.py]"]
  node_formats["Vector formats<br/>[formats.py]"]
  node_merge["SVG merge<br/>[svgmerge.py]"]
end

node_user(("Designer"))

node_user -->|"configures"| node_cli
node_user -->|"configures"| node_web
node_user -->|"uses"| node_plugin
node_cli -->|"loads"| node_registry
node_cli -->|"uses"| node_core
node_cli -->|"invokes"| node_merge
node_web -->|"loads"| node_registry
node_web -->|"uses"| node_core
node_generator_cli -->|"loads"| node_registry
node_generator_cli -->|"uses"| node_core
node_registry -->|"registers"| node_families
node_families -.->|"constructs with"| node_core
node_core -->|"uses"| node_joints
node_core -->|"draws through"| node_drawing
node_core -->|"uses"| node_parts
node_core -->|"uses"| node_lids
node_core -->|"uses"| node_pulleys
node_core -->|"uses"| node_gears
node_joints -->|"references"| node_core
node_lids -->|"uses"| node_joints
node_wall_edges -->|"uses"| node_joints
node_parts -->|"uses"| node_vectors
node_pulleys -->|"uses"| node_vectors
node_gears -->|"uses"| node_vectors
node_drawing -.->|"exports through"| node_formats
node_formats -->|"converts"| node_drawing
node_cli -.->|"exports via"| node_formats
node_cli -.->|"serves online"| node_web

click node_cli "https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxes_main.py"
click node_web "https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxesserver.py"
click node_plugin "https://github.com/florianfesti/boxes/blob/master/boxes/gears.py"
click node_generator_cli "https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxes_generator.py"
click node_registry "https://github.com/florianfesti/boxes/blob/master/boxes/generators/__init__.py"
click node_families "https://github.com/florianfesti/boxes/tree/master/boxes/generators"
click node_core "https://github.com/florianfesti/boxes/blob/master/boxes/__init__.py"
click node_joints "https://github.com/florianfesti/boxes/blob/master/boxes/edges.py"
click node_lids "https://github.com/florianfesti/boxes/blob/master/boxes/lids.py"
click node_wall_edges "https://github.com/florianfesti/boxes/blob/master/boxes/walledges.py"
click node_parts "https://github.com/florianfesti/boxes/blob/master/boxes/parts.py"
click node_gears "https://github.com/florianfesti/boxes/blob/master/boxes/gears.py"
click node_pulleys "https://github.com/florianfesti/boxes/blob/master/boxes/pulley.py"
click node_vectors "https://github.com/florianfesti/boxes/blob/master/boxes/vectors.py"
click node_drawing "https://github.com/florianfesti/boxes/blob/master/boxes/drawing.py"
click node_formats "https://github.com/florianfesti/boxes/blob/master/boxes/formats.py"
click node_merge "https://github.com/florianfesti/boxes/blob/master/boxes/svgmerge.py"

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_cli,node_web,node_plugin,node_generator_cli toneBlue
class node_registry,node_families toneAmber
class node_core,node_joints,node_lids,node_wall_edges,node_parts,node_gears,node_pulleys,node_vectors toneMint
class node_drawing,node_formats,node_merge toneRose
class node_user toneIndigo
```

## Components

### User interfaces

- [CLI entry](https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxes_main.py): `boxes/scripts/boxes_main.py`
- [Web server](https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxesserver.py): `boxes/scripts/boxesserver.py`
- [Inkscape plug-in](https://github.com/florianfesti/boxes/blob/master/boxes/gears.py): `boxes/gears.py`
- [Generator CLI](https://github.com/florianfesti/boxes/blob/master/boxes/scripts/boxes_generator.py): `boxes/scripts/boxes_generator.py`

### Parametric designs

- [Generator registry](https://github.com/florianfesti/boxes/blob/master/boxes/generators/__init__.py): `boxes/generators/__init__.py`
- [Design generators](https://github.com/florianfesti/boxes/tree/master/boxes/generators): `boxes/generators`

### Geometry engine

- [Box construction](https://github.com/florianfesti/boxes/blob/master/boxes/__init__.py): `boxes/__init__.py`
- [Joints and edges](https://github.com/florianfesti/boxes/blob/master/boxes/edges.py): `boxes/edges.py`
- [Lids and closures](https://github.com/florianfesti/boxes/blob/master/boxes/lids.py): `boxes/lids.py`
- [Wall edges](https://github.com/florianfesti/boxes/blob/master/boxes/walledges.py): `boxes/walledges.py`
- [Reusable parts](https://github.com/florianfesti/boxes/blob/master/boxes/parts.py): `boxes/parts.py`
- [Gear designs](https://github.com/florianfesti/boxes/blob/master/boxes/gears.py): `boxes/gears.py`
- [Pulley designs](https://github.com/florianfesti/boxes/blob/master/boxes/pulley.py): `boxes/pulley.py`
- [Vector math](https://github.com/florianfesti/boxes/blob/master/boxes/vectors.py): `boxes/vectors.py`

### Vector output

- [Drawing context](https://github.com/florianfesti/boxes/blob/master/boxes/drawing.py): `boxes/drawing.py`
- [Vector formats](https://github.com/florianfesti/boxes/blob/master/boxes/formats.py): `boxes/formats.py`
- [SVG merge](https://github.com/florianfesti/boxes/blob/master/boxes/svgmerge.py): `boxes/svgmerge.py`

### Other components

- **Designer**

## Connections

- Designer → CLI entry: configures (evidence: `README.rst`)
- Designer → Web server: configures (evidence: `README.rst`)
- Designer → Inkscape plug-in: uses (evidence: `README.rst`)
- CLI entry → Generator registry: loads (evidence: `boxes/scripts/boxes_main.py`)
- CLI entry → Box construction: uses (evidence: `boxes/scripts/boxes_main.py`)
- CLI entry → SVG merge: invokes (evidence: `boxes/scripts/boxes_main.py`)
- Web server → Generator registry: loads (evidence: `boxes/scripts/boxesserver.py`)
- Web server → Box construction: uses (evidence: `boxes/scripts/boxesserver.py`)
- Generator CLI → Generator registry: loads (evidence: `boxes/scripts/boxes_generator.py`)
- Generator CLI → Box construction: uses (evidence: `boxes/scripts/boxes_generator.py`)
- Generator registry → Design generators: registers (evidence: `boxes/generators/__init__.py`)
- Design generators → Box construction: constructs with (evidence: `boxes/generators/can_storage.py`)
- Box construction → Joints and edges: uses (evidence: `boxes/__init__.py`)
- Box construction → Drawing context: draws through (evidence: `boxes/__init__.py`)
- Box construction → Reusable parts: uses (evidence: `boxes/__init__.py`)
- Box construction → Lids and closures: uses (evidence: `boxes/__init__.py`)
- Box construction → Pulley designs: uses (evidence: `boxes/__init__.py`)
- Box construction → Gear designs: uses (evidence: `boxes/__init__.py`)
- Joints and edges → Box construction: references (evidence: `boxes/edges.py`)
- Lids and closures → Joints and edges: uses (evidence: `boxes/lids.py`)
- Wall edges → Joints and edges: uses (evidence: `boxes/walledges.py`)
- Reusable parts → Vector math: uses (evidence: `boxes/parts.py`)
- Pulley designs → Vector math: uses (evidence: `boxes/pulley.py`)
- Gear designs → Vector math: uses (evidence: `boxes/gears.py`)
- Drawing context → Vector formats: exports through (evidence: `boxes/formats.py`)
- Vector formats → Drawing context: converts (evidence: `boxes/formats.py`)
- CLI entry → Vector formats: exports via
- CLI entry → Web server: serves online (evidence: `README.rst`)
