Professional circuit editor with a modern UI, SVG/LaTeX export, and asynchronous API analysis (mesh/nodal workflows).
- Drag-and-drop circuit editor with snapping, labeling, and rotation.
- Dedicated component inspector (labels, electrical parameters, unknown flags).
- Export pipeline:
- SVG (clean presentation output)
- LaTeX (
circuitikz)
- Async analysis API with job polling.
- Mesh analysis pipeline with current-source constraints and supermesh-aware equations.
- Rich analysis report page:
- interactive graph panel
- incidence and mesh matrices
- equation steps
- branch table (
I, V, P) - power-balance card
- Stack:
Vite + React + TypeScript - Main entry:
web/src/main.ts - Key controllers:
web/src/controller/canvasController.ts: canvas state + interaction coreweb/src/controller/componentInspectorController.ts: selected-component editingweb/src/controller/navbarController.ts: sidebar controls (theme/grid/export/analysis)web/src/controller/analysisController.ts: analysis job submission
- Analysis report:
web/pages/analysis.htmlweb/src/analysis/analysisMain.tsweb/src/analysis/analysisRenderer.ts
- Stack:
FastAPI + SymPy (+ Lcapy available in environment) - API entrypoint:
api/app/main.py - Analysis routes:
api/app/routes/analysis.py - General orchestration:
api/app/core/analysis_engine.py - Mesh-specific algorithm:
api/app/core/mesh_analysis.py - Shared utilities:
api/app/core/analysis_common.py - In-memory job store:
api/app/core/job_store.py
macOS/Linux:
npm install
npm run devWindows CMD:
npm install
npm run devDefault dev URL: http://127.0.0.1:5173
macOS/Linux (Unix):
cd api
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m uvicorn app.main:app --reload --port 8000Windows CMD:
cd api
py -m venv .venv
.venv\Scripts\activate.bat
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m uvicorn app.main:app --reload --port 8000Note:
- Avvio corretto API:
python -m uvicorn app.main:app --reload --port 8000 - Non usare
python app/main.py. - Per uscire dalla virtualenv:
deactivate
Health check:
curl http://127.0.0.1:8000/healthnpm run buildBase URL: http://127.0.0.1:8000/api/v1
POST /analysis/jobs- Creates a new async analysis job.
GET /analysis/jobs/{job_id}- Returns job status (
queued|running|completed|failed).
- Returns job status (
GET /analysis/jobs/{job_id}/result- Returns result payload when completed.
Notes:
- Circuit integrity is validated before job enqueueing.
- Missing required electrical parameters are rejected early.
- Build a circuit in the editor.
- Set component parameters in Inspector.
- Run
Analisi NodiorAnalisi Maglie. - A report tab opens (
/pages/analysis.html?job=...) and auto-polls results. - Review graph/matrices/equations/table/power-balance.
.
├─ web/
│ ├─ src/ # Web source (React + controllers)
│ ├─ public/static/ # Static UI fragments (navbar/grid/inspector)
│ ├─ pages/
│ │ ├─ editor.html
│ │ └─ analysis.html
│ └─ index.html
├─ config/ # Build/TypeScript configuration
├─ api/
│ ├─ app/
│ │ ├─ main.py # FastAPI app bootstrap + health
│ │ ├─ routes/
│ │ │ └─ analysis.py # Analysis endpoints
│ │ └─ core/
│ │ ├─ analysis_engine.py # General dispatcher and validation
│ │ ├─ mesh_analysis.py # Mesh analysis algorithm
│ │ ├─ analysis_common.py # Shared graph/latex/svg helpers
│ │ ├─ models.py # Pydantic schemas
│ │ └─ job_store.py # In-memory job store
│ └─ requirements.txt
└─ package.json
- Editor and analysis pages are theme-aware (
light/dark) via localStorage. - API debug traces can be enabled with:
export ANALYSIS_DEBUG=1- Full nodal solver parity with the current mesh reporting quality.
- Stronger supermesh detection/annotation in the report UI.
- Import/save persistence workflow (currently UI placeholders exist).
- E2E regression tests for editor -> API -> report pipeline.
- Optional persistent API job storage (Redis/PostgreSQL).
Specify project license here (e.g. MIT) before publishing.