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:
67
CLAUDE.md
Normal file
67
CLAUDE.md
Normal 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.
|
||||
Reference in New Issue
Block a user