
E304b803-63fb-4bbf b541-487a68e12ce0
Nandini-6126/Router_PCB_WEB_AI
Upload a KiCad .kicadpcb, parse it to JSON, run an A\ router, and download the results — all from a simple web UI (FastAPI backend + Vite/React frontend).

Upload a KiCad .kicadpcb, parse it to JSON, run an A\ router, and download the results — all from a simple web UI (FastAPI backend + Vite/React frontend).
4b2183a2-dd1e-42be-9764-910de50a3e22 is an open-source printed circuit board by Nandini-6126, from the Nandini-6126/Router_PCB_WEB_AI repository on GitHub. It is a 4-layer board of 25 × 15 mm with 7 parts on 6 nets, routed with 75 tracks and 4 vias.
It is built around the LM2574HVM-3.3. Its parts include 3 resistors, 1 capacitor, 1 IC, 1 diode and 1 connector.
Upload a KiCad .kicad_pcb, parse it to JSON, run an A* router, and download the results — all from a simple web UI (FastAPI backend + Vite/React frontend).
Current status
- ✅ Step 1–2 end-to-end: Upload → Parse → Route → Download
- ⚠️ Step 3 “Inject into
.kicad_pcb” is a stub (currently copies the original file). You can view routing fromoutput.json, and later we’ll replace the stub with a real KiCad writer.
py --list or python --versionnode -v and npm -vcd backend-pcb-routing
# Create & activate venv
py -3.11 -m venv .venv # or: python -m venv .venv
. .venv\Scripts\Activate.ps1
# Install deps
pip install fastapi uvicorn pydantic python-multipart
# Run API (http://127.0.0.1:8000)
uvicorn main:app --reload --port 8000
# Health check:
# http://127.0.0.1:8000/health -> {"ok": true}
# API docs:
# http://127.0.0.1:8000/docscd frontend
npm install
# Configure backend URL and enable Inject UI:
# Preferred: create a file frontend/.env.local with:
# VITE_API_BASE=http://127.0.0.1:8000
# VITE_ENABLE_INJECT=true
#
# One-time session alternative (PowerShell):
$env:VITE_API_BASE="http://127.0.0.1:8000"
$env:VITE_ENABLE_INJECT="true"
npm run dev
# Open http://localhost:5173Upload & Parse (Step 1)
Upload your .kicad_pcb. The backend runs parser.py and creates jobs/<job_id>/parsed_input.json. A summary (bbox, pads, nets, footprints) appears.
Route (Step 2)
Adjust parameters (trace width, clearance, via cost/size/drill, grid step). Click Run A* Route. The backend runs astar.py, writes jobs/<job_id>/output.json, and returns a summary (segments, vias, length).
Download
Use the buttons to download parsed_input.json, output.json, and (optionally) routed.kicad_pcb.
Inject (Step 3 – optional, stub)
The “Inject to .kicad_pcb” button currently copies the original file to routed.kicad_pcb so the flow is end-to-end. Replace this with a real KiCad writer later.
pcb-routing-ui/
backend-pcb-routing/
main.py # FastAPI server (calls parser.py & astar.py)
parser.py # KiCad .kicad_pcb -> parsed_input.json
astar.py # parsed_input.json -> output.json (routes)
jobs/ # per-run job folders (ignored in git)
frontend/
src/
components/
UploadCard.tsx
ParamsForm.tsx
Downloads.tsx
StatusBar.tsx
lib/
api.ts
types.ts
index.html
package.json
.env.local # VITE_API_BASE, VITE_ENABLE_INJECTBase URL: http://127.0.0.1:8000
GET /health → { "ok": true }POST /api/parse (multipart, field file: .kicad_pcb){ ok, job_id, parsed_path, meta }POST /api/route (JSON: { job_id, params }){ ok, output_path, summary } and writes output.jsonPOST /api/inject (JSON: { job_id }){ ok, routed_path } (currently copy of original)GET /api/download?path=<abs_path_under_jobs> → file downloadNotes
jobs/ root.parsed_input.json (from parser.py){
"board": {
"boundary": [[x1,y1], [x2,y1], [x2,y2], [x1,y2] ],
"layers": ["F.Cu", "B.Cu"]
},
"rules": {
"trace_width": 0.25,
"clearance": 0.30,
"via_cost": 10,
"grid_step": 0.25,
"via_size": 0.8,
"via_drill": 0.4
},
"obstacles": [ /* pads and polygon obstacles */ ],
"tasks": [
{
"net": "Net-(U1-Pad1)",
"net_id": 1,
"start": { "x": 10.2, "y": 30.1, "layer": "F.Cu" },
"goal": { "x": 42.8, "y": 12.6, "layer": "F.Cu" }
}
]
}output.json (from astar.py){
"summary": {
"segments": 20,
"vias": 3,
"nets_routed": 8,
"total_length_mm": 55.2
},
"segments": [
{ "net": "Net-(U1-Pad1)", "start": [x,y], "end": [x,y], "layer": "F.Cu", "width": 0.25 }
],
"vias": [
{ "net": "Net-(U1-Pad1)", "at": [x,y], "from": "F.Cu", "to": "B.Cu", "size": 0.8, "drill": 0.4 }
],
"routes": [ /* per-net grouping (for reference) */ ]
}To visualize in KiCad, you’ll eventually implement an injector that writes these segments/vias as KiCad S-expressions back into a new
.kicad_pcb. For now, the backend exposes a stub that copies the file so the pipeline is complete.
Run the tools by hand if needed:
# Parser
python parser.py path\to\board.kicad_pcb [parsed_output.json]
# Router (merges JSON params into parsed rules)
python astar.py parsed_input.json output.json "{\"trace_width\":0.25,\"clearance\":0.3}"“Failed to fetch” in frontend
Ensure backend is running and set frontend env:
frontend/.env.local
VITE_API_BASE=http://127.0.0.1:8000
VITE_ENABLE_INJECT=trueRestart npm run dev.
Setting env vars on Windows
Use PowerShell style (don’t paste VITE_...=... like in bash):
$env:VITE_API_BASE="http://127.0.0.1:8000"
$env:VITE_ENABLE_INJECT="true"CORS
Backend allows http://localhost:5173 and http://127.0.0.1:5173 by default.
Override with ALLOW_ORIGINS before starting uvicorn:
$env:ALLOW_ORIGINS="http://localhost:5173,http://127.0.0.1:5173"
uvicorn main:app --reload --port 8000“.kicad_pcb only” error on upload
The filename must end with .kicad_pcb.
Unicode/emoji print crashes
Backend forces UTF-8 for child processes. Avoid fancy emojis in subprocess prints on Windows consoles.
py -3.11 not found
Install Python 3.11 or use python -m venv .venv. Check py --list.
Happy routing! 🧭✨
| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | R | Resistor_SMD:R_0402_1005Metric | R1, R2, R3 |
| 1 | C | Capacitor_SMD:C_0805_2012Metric | C1 |
| 1 | Conn_01x02_Pin | Connector_Wuerth:Wuerth_WR-WTB_64800211622_1x02_P1.50mm_Vertical | J1 |
| 1 | LED | LED_SMD:LED_0603_1608Metric | D1 |
| 1 | LM2574HVM-3.3 | Package_SO:SOIC-14W_7.5x9mm_P1.27mm | U1 |

Nandini-6126/Router_PCB_WEB_AI
Upload a KiCad .kicadpcb, parse it to JSON, run an A\ router, and download the results — all from a simple web UI (FastAPI backend + Vite/React frontend).



MicroCoreLabs/Projects
Ted Fried's MicroCore Labs Projects - FPGA CPU cores and emulators for the 8088, 8086, 8051, 6502, 68000, Z80, Risc-V, and also Typewriter and EPROM Emulator projects.


agranlund/raven
Homemade MC68060 + DSP56303 Atari-compatible computer. Hardware, firmware, and software stack

rjwalters/kicad-tools
Standalone Python tools for parsing and manipulating KiCad schematic and PCB files

Board-Folk/MegaCD-Main-BD
Reproductions of main board PCBs for Sega's Mega CD/Sega CD add-on for the Mega Drive/Genesis console.

shibukawa/bdf
BDF is a browser document-preview suite: it combines converters for many formats (Go/WASM), a browser renderer of about 23 KB gzipped, and a compact intermediate format.
It measures 25 × 15 mm and has 4 copper layers, 1.6 mm thick.
7 parts, built around the LM2574HVM-3.3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the Nandini-6126/Router_PCB_WEB_AI repository on GitHub, at the commit this page was made from: the board is backend-pcb-routing/jobs/4b2183a2-dd1e-42be-9764-910de50a3e22/routed.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask Nandini-6126 before reusing the design.