spicebook/Makefile
Ryan Malloy 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

49 lines
1.6 KiB
Makefile

.PHONY: dev prod down logs restart clean build
# Default target
dev: ## Start development environment
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d
@echo "SpiceBook dev started"
@echo " Frontend: http://localhost:4321"
@echo " Backend: http://localhost:$${BACKEND_PORT:-8099}"
@echo " API docs: http://localhost:$${BACKEND_PORT:-8099}/docs"
@sleep 3
docker compose -f docker-compose.yml -f docker-compose.dev.yml logs --tail=30
prod: ## Start production environment
docker compose -f docker-compose.yml -f docker-compose.prod.yml up --build -d
@echo "SpiceBook production started"
@sleep 3
docker compose -f docker-compose.yml -f docker-compose.prod.yml logs --tail=30
down: ## Stop all containers
docker compose down
logs: ## Show container logs
docker compose logs -f --tail=50
restart: ## Restart all containers
docker compose restart
@sleep 3
docker compose logs --tail=30
clean: ## Remove containers, volumes, and build artifacts
docker compose down -v --remove-orphans
rm -rf frontend/node_modules frontend/dist frontend/.astro
rm -rf backend/dist backend/build
build: ## Build containers without starting
docker compose -f docker-compose.yml -f docker-compose.dev.yml build
backend-logs: ## Show backend logs only
docker compose logs -f backend
frontend-logs: ## Show frontend logs only
docker compose logs -f frontend
backend-shell: ## Open shell in backend container
docker compose exec backend bash
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'