# Drawing board

A place for Mike to mark up the sculpture drawings himself. Basic drawing tools
over the real drawing, a box to say what he wants changed, and one Save button.

**This is his input channel to the render team.** Everything he saves is written
into the project where the workers read it.

## Open it

```
http://10.0.0.177:8082          on the home network
http://100.101.221.93:8082      over Tailscale, from anywhere
```

Password: **the same one as the book manager** — the server reads
`/home/mike/bookapp/auth.json`, so there is one password per host, not one per app.
It asks for it the moment you open the page.

## Using it

- **Pick a drawing** in the top-left dropdown. Every `.png` in `output/` shows up,
  so a new sculpture's drawings appear here as soon as they are rendered.
- **Draw:** Pen, Line, Arrow, Box, Circle, Text. Pick a colour, set the width.
  Works with a finger on a phone and with a mouse on a desktop.
- **Zoom** with `–` / `+` for fine detail — a 3000-px drawing on a phone needs it.
- **Undo** steps back one mark. **Clear** wipes the drawing's marks.
- **"Changes I want"** — type it in words. Words and marks travel together.
- **Save my changes.** Say *both* kinds of thing you want changed, drawn and typed:
  a mark points at the spot, the words say what should happen there.

## Where a save goes

`output/markup/`, one pair of files per save:

```
<drawing>-markup-<stamp>.png    the drawing with the marks burned onto it
<drawing>-markup-<stamp>.json   the same marks as data, plus the typed notes
index.json                      every save, newest first
```

The JSON is the part that matters to a worker:

```json
{
  "drawing": "slow-bloom-elevation.png",
  "drawing_size": [3060, 3130],
  "saved_local": "2026-11-08 03:12:54",
  "notes": "The blooms should sit lower — drop them all 6 in.",
  "marks": [{"tool": "arrow", "colour": "#ac3a2a", "width": 5,
             "points": [[1908, 940], [2350, 1180]]}]
}
```

**Mark coordinates are in IMAGE space, not screen space**, so a mark points at the
same spot whatever size the drawing was displayed at, and a worker can convert one
straight into drawing coordinates. Nothing about display size is baked in.

## Running it

```
systemctl --user status drawingboard      # is it up
systemctl --user restart drawingboard     # kick it
journalctl --user -u drawingboard -f      # watch requests
```

A systemd **user** service, so it needs no sudo, and linger is on so it survives
logout and reboot. It uses only the Python standard library — no venv, no packages,
no Node.

Environment overrides if the defaults ever clash: `DRAWING_BOARD_PORT` (8082),
`DRAWING_BOARD_HOST` (0.0.0.0), `DRAWING_BOARD_AUTH` (the book manager's auth file).

## What it deliberately does not do

- **It does not edit the drawing.** The board writes a *new* marked-up copy; the
  rendered drawing underneath is never touched. Nothing he draws can corrupt a
  render — and the workers, not this app, decide what a change means for the design.
- **It does not change the design, the BOM or a price.** It records what he wants.
- **It will not serve without a password.** If the auth file is missing, it refuses
  to start rather than exposing the drawings.
