5 Commits

Author SHA1 Message Date
1ec22c82dc Add gated LTspice engine via Wine 11.10
Wire mcltspice into the backend image: WineHQ 11.10 (matching the dev host),
i386 multiarch, Mesa software GL, a build-time Wine prefix seeded with the
LTspice.ini first-run config, and an entrypoint that starts Xvfb. The LTspice
install (exe/lib/examples) mounts from the host; the engine reads LTSPICE_DIR.

Gated for now: LTspice v26 stalls at graphics init under headless Wine in the
slim image (runs fine on a full desktop). The mount + LTSPICE_DIR are commented
in docker-compose.prod.yml so the engine fails fast as 'unavailable' rather than
hanging. ngspice is unaffected.
2026-06-20 07:43:08 -06:00
896a8535cf Add LTspice simulation engine via mcltspice
Wire up LTspice as a second simulation engine using mcltspice (Wine-based
LTspice runner). The backend architecture already had the ABC + factory
pattern; this connects the ltspice branch.

- Extract shared raw_to_waveform() into raw_convert.py with Protocol typing
  so both ngspice and mcltspice RawFile objects work without coupling
- Add LtspiceEngine with deferred mcltspice import for graceful degradation
- Register "ltspice" in get_engine() with availability check
  (mcltspice + Wine + LTspice.exe must all be present)
- Add startup validation log for LTspice availability
- Add mcltspice as optional dependency: pip install spicebook[ltspice]
- Integration tests auto-skip when LTspice is unavailable (Docker/CI)
2026-03-05 15:06:41 -07:00
7ffd3f1bd3 Fix notebook directory permissions for non-root user
Pre-create /app/notebooks/{user,examples} with correct ownership
before switching to the spicebook user. Without this, the app crashes
with PermissionError when it tries to create these directories at
runtime.
2026-02-13 03:41:42 -07:00
5aa36b252a Remove unsupported --no-editable flag from backend Dockerfile 2026-02-13 03:38:08 -07:00
8abd7719bf Initial SpiceBook MVP: notebook interface for circuit simulation
Phase 1 implementation with ngspice backend and Astro/React frontend:

Backend (FastAPI):
- ngspice subprocess engine with custom .raw file parser
- Notebook CRUD with .spicebook JSON format (filesystem storage)
- Simulation endpoints (standalone + cell-in-notebook)
- SVG waveform export endpoint
- 18 REST API routes, 5 passing tests

Frontend (Astro 5 + React 19):
- Notebook editor as React island with Zustand state management
- CodeMirror 6 with custom SPICE language mode (syntax highlighting
  for dot commands, components, engineering notation, comments)
- uPlot waveform viewer with transient and AC/Bode plot modes
- Markdown cells with edit/preview toggle
- Notebook list with card grid UI
- Dark theme, Tailwind CSS 4, Lucide icons

Infrastructure:
- Docker Compose with dev/prod targets
- Caddy-based frontend prod serving
- 3 example notebooks (RC filter, voltage divider, CE amplifier)
2026-02-13 01:44:38 -07:00