bootstrap: README + CLAUDE.md (architecture sketch, no CLI)

Visual interface + SQLite inventory + mExDraw integration. Seeded from m's existing Cable-Management.excalidraw. Backend Go, frontend TBD.
This commit is contained in:
m
2026-05-15 12:17:55 +02:00
parent eaf2d968dd
commit a94e8d9f60
2 changed files with 102 additions and 1 deletions

67
CLAUDE.md Normal file
View File

@@ -0,0 +1,67 @@
# mCables — Project Instructions
## Project Overview
Cable management tool for m's setup. Visual web interface backed by a Go HTTP API and a tiny SQLite inventory. Generates and updates Excalidraw drawings via mExDraw.
**Memory group_id:** `mcables`
**No CLI.** Frontend-first — every interaction is through the visual interface. The backend serves the UI and the API; there's no `mcables`-binary for shell users.
## Goal
- Inventory of devices, ports, cables, cable types, bundles, frames.
- Visual editor in the browser: drag devices around, click ports to connect, pick cable types from a legend.
- Live-sync with an Excalidraw drawing on mxdrw.msbls.de — pick up m's existing drawing as the seed, keep it as the authoritative visual.
- Bundle detection: parallel cables along the same path get grouped + colour-bundled in the diagram.
## Architecture
| Layer | Tech | Notes |
|---|---|---|
| DB | SQLite | `~/.m/mcables.db` (per-user). Schema migrations in `internal/db/migrations/`. |
| Backend | Go | HTTP API + static frontend serving. Standard library + minimal deps. |
| Frontend | TBD (vanilla TS / Svelte / Preact — first design pass decides) | No build-step preferred if vanilla works. |
| Diagram I/O | mExDraw MCP (`mcp__mexdraw__*`) | Read existing drawings to import, write to update. |
## Branch Strategy
- `main` = production-deployable.
- `feat/*` / `fix/*` = short-lived branches via mai worker workflow.
- No `dev` branch — too small a project for staging.
- Merge with `--no-ff` to main, delete branches after merge.
## Tech Stack
- **Go** for the backend (matches m's other tools: `m`, `mai`, youpcms).
- **SQLite** as inventory store. Driver: `modernc.org/sqlite` (cgo-free) or `mattn/go-sqlite3` (cgo) — design pass decides.
- **mExDraw MCP** for diagram I/O — never touch raw `.excalidraw` files outside the MCP.
- No deploy yet — runs locally on m's machine as `go run ./cmd/mcables` (or similar). Production deploy can come later if needed.
## Seed Data
m's existing Excalidraw drawing on `mxdrw.msbls.de/draw/Cable-Management.excalidraw` is the bootstrap. Devices found there (NAS, eQ, fritz, Switch, IOx3/IOx6/IOx8 hubs, ChromeCast, Soundbar, TV, PC, Mac, SteamLink, Notebooks) + their port topology should map to the initial DB rows.
Conventions used in the drawing:
- **Devices** = rectangles with a text label.
- **Ports** = small ellipses (~12×9) positioned on the device edge.
- **Cables** = arrows from port-ellipse to port-ellipse (Excalidraw bindings via `from=` / `to=`).
- **Cable types** = colour, with a legend at top-left listing RJ45, DP, HDMI, USB, Power.
- **IO labels** (diamond shapes) mark interface clusters.
- **Frames** group setups by location (one frame per room / rack).
The importer should preserve this convention so m's existing layout doesn't get rewritten.
## Out of scope (for now)
- Multi-user. mCables is m-only.
- Mobile / responsive — desktop browser only.
- Cable inventory beyond visual structure (no length tracking, no purchase history, no SKU mapping — add later if useful).
- Auth / sharing — runs locally.
## Worker Preferences
- **First shift = inventor** (design pass): pick frontend stack, sketch UI flows, define schema, plan importer for existing drawing. Output: `docs/design.md` + open questions for m.
- **Second shift = coder** (after m's go on the design): bootstrap repo skeleton (Go module, SQLite migrations, importer skeleton, server, frontend scaffold).
- Use **Sonnet** for both — this is greenfield, structure matters more than depth.

View File

@@ -1,3 +1,37 @@
# mCables # mCables
Cable management — visual interface + SQLite inventory, integrates with mExDraw for diagrams. Cable management for m's setup — visual interface + SQLite inventory, generating + updating Excalidraw diagrams via mExDraw.
## Status
Bootstrap. Architecture sketch below; implementation pending.
## Goal
Track devices, ports, and cables across m's setups (server rack, office, living room). Generate / update Excalidraw diagrams from the inventory. Detect bundles of parallel cables. Visualise cable types by colour (RJ45, DP, HDMI, USB, Power, …).
m's existing drawing is the seed: https://mxdrw.msbls.de/draw/Cable-Management.excalidraw — devices are rectangles, ports are ellipses positioned on the device, cables are arrows from port to port, cable type is encoded via colour with a legend.
## Architecture sketch
| Layer | Tech | Role |
|---|---|---|
| Storage | SQLite (`~/.m/mcables.db`) | `devices`, `ports`, `cables`, `cable_types`, `bundles`, `frames` |
| Backend | Go | HTTP API serving the visual frontend, mExDraw integration for diagram I/O |
| Frontend | Visual web UI | Browser-based editor (no CLI). Add/edit devices and cables, see live preview |
| Output | mExDraw via MCP | Render + update Excalidraw drawings |
| Project tracking | mBrian `topic-mcables` | Decisions, status, links to drawings — not the data itself |
## Tech decisions (open)
- Frontend stack — vanilla TS + small UI lib, or a framework (Svelte / Preact)?
- Diagram import from the existing `Cable-Management.excalidraw` — one-shot migration script that parses bindings → DB rows.
- Layout algorithm for bundle suggestions — parallel cables along the same path get bundled visually.
These get resolved in the first design pass.
## Refs
- m's seed drawing: https://mxdrw.msbls.de/draw/Cable-Management.excalidraw
- mExDraw MCP: `mcp__mexdraw__*`
- Related: mBrian `topic-msbls` (infrastructure inventory)