11 Commits

Author SHA1 Message Date
42f4428295 Add 7 advanced example notebooks with real-world circuits
Buck converter, Class AB amplifier, AM radio receiver, Dickson
charge pump, transmission line signal integrity, 4th-order
Sallen-Key filter, and Colpitts RF oscillator. Multi-cell
notebooks with engineering narratives and multiple simulation
views per circuit.
2026-02-13 04:29:33 -07:00
da3532c1aa Add example notebook population script
Creates 8 curated example notebooks via the API:
- RC Lowpass Filter (AC analysis)
- Voltage Divider (DC operating point)
- RC Step Response (transient)
- RLC Bandpass Filter (AC analysis)
- Diode Half-Wave Rectifier (transient)
- LED I-V Characteristic (DC sweep)
- Inverting Op-Amp Amplifier (transient)
- CMOS Inverter (DC transfer characteristic)
2026-02-13 03:55:55 -07:00
9b2737ef77 Set PUBLIC_API_URL at build time for production
Vite inlines import.meta.env.PUBLIC_* at build time, not runtime.
Without this, the frontend falls back to localhost:8099 which doesn't
exist from the browser. Empty string means same-origin requests,
letting Caddy route /api/* to the backend.
2026-02-13 03:45:23 -07:00
fb5b911ea1 Use named volume for notebooks in production
Bind mounts inherit host UID which conflicts with the container's
non-root user. Named volumes are initialized from the image layer,
preserving the chown from the Dockerfile.
2026-02-13 03:43:09 -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
a24375accb Fix Docker build: remove missing readme ref, disable astro telemetry 2026-02-13 03:39:00 -07:00
5aa36b252a Remove unsupported --no-editable flag from backend Dockerfile 2026-02-13 03:38:08 -07:00
4600a7b0a9 Production deployment: SSR frontend, Caddy path routing
Update frontend Dockerfile prod stage from Caddy static to Node.js
running Astro SSR server. Configure caddy-docker-proxy labels to
route /api/* to backend and everything else to frontend on the same
domain. Support empty PUBLIC_API_URL for same-origin API calls.
2026-02-13 03:37:14 -07:00
5a2c5730c0 Add project README and screenshots
Document architecture, features, quick start, file format, API
endpoints, configuration, roadmap, and tech stack. Include screenshots
of the notebook with AC Bode plot and transient step response.
2026-02-13 02:33:13 -07:00
72eb073787 Clean URLs and waveform rendering fixes
Switch from query-param routing (/notebook/?id=X) to Astro dynamic
routes (/notebook/rc-lowpass-filter). Add @astrojs/node adapter with
output: 'server' for on-demand route handling.

Fix formatEng/formatAxisValue crash on null values passed by uPlot
axis tick formatters. Add CORS origin for port 4322.
2026-02-13 02:16:11 -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