How psdwtf/ai-pcb-generator works
This is a FastAPI web studio and REST API for turning circuit descriptions, netlists, or schematic images into routed KiCad boards and manufacturing exports. Its main workflow submits a generation job, builds a board, optionally simulates and checks it, routes it, exports artifacts, then exposes status, preview, and downloads. The README documents the end-to-end KiCad/FreeRouting/export stages; source-index references and excerpts support the backend links. Some service internals and UI wiring were not sampled, so those relationships are omitted where not documented.
Main entry points: job_manager.py Job Pipeline · main.py FastAPI Application · kicad_service.py KiCad Export & Import · pcb.py PCB Endpoints
Components 24
Web Interface
- Web Dashboard
app/routes/ui.py - Interactive UI
app/static/js/app.js
API & Jobs
- PCB Endpoints
app/routes/pcb.py - Job Status & Files
app/routes/jobs.py - Job Pipeline
app/services/job_manager.py - Job State & Artifacts
app/services/job_manager.py - Request & Job Models
app/models/schemas.py - Runtime Configuration
app/config.py - FastAPI Application
app/main.py
Circuit Design
- Schematic Image Parser
app/services/image_parser.py - AI Circuit Design
app/services/llm.py - Board Generator
app/services/circuit_generator.py - Hardware Guidance
app/services/hardware_assistant.py
Analysis & Checks
- SPICE Simulation
app/services/simulator.py - Thermal Trace DRC
app/services/drc.py - Trace Calculator
app/services/calculator.py - Legacy Netlist Audit
app/llm_auditor.py - Audit Records
app/db.py
Routing & Fabrication
- KiCad Export & Import
app/services/kicad_service.py - Auto-Router
app/services/freerouting_service.py - KiCad CLI
- Java FreeRouting
Other components
- Circuit Designer
- Gemini API
Connections 27
- Circuit Designer → Web Dashboard: uses
README.md - Web Dashboard → Interactive UI: serves
README.md - Circuit Designer → PCB Endpoints: submits design
README.md - PCB Endpoints → Job Pipeline: queues job
app/routes/pcb.py - PCB Endpoints → Schematic Image Parser: parses upload
app/routes/pcb.py - Job Pipeline → Job State & Artifacts: updates
app/services/job_manager.py - Job Status & Files → Job State & Artifacts: reads status
app/routes/jobs.py - Job Status & Files → Job State & Artifacts: serves artifacts
app/routes/jobs.py - FastAPI Application → PCB Endpoints: registers routes
app/main.py - FastAPI Application → Job Status & Files: registers routes
app/main.py - Job Pipeline → AI Circuit Design: requests design
app/services/job_manager.py - Job Pipeline → Board Generator: generates board
README.md - Job Pipeline → SPICE Simulation: runs simulation
app/services/job_manager.py - Job Pipeline → Thermal Trace DRC: checks traces
app/services/job_manager.py - Job Pipeline → KiCad Export & Import: exports layout
README.md - Job Pipeline → Auto-Router: routes board
README.md - KiCad Export & Import → Auto-Router: exports DSN
README.md - Auto-Router → Java FreeRouting: runs routing
app/services/freerouting_service.py - Auto-Router → KiCad Export & Import: returns SES
README.md - KiCad Export & Import → KiCad CLI: exports fabrication
README.md - AI Circuit Design → Gemini API: requests generation
app/services/llm.py - FastAPI Application → Trace Calculator: calculates traces
app/main.py - FastAPI Application → Hardware Guidance: gets guidance
app/main.py - FastAPI Application → Legacy Netlist Audit: calls legacy audit
app/main.py - FastAPI Application → Audit Records: reads audit records
app/main.py - Circuit Designer → Job Status & Files: polls and downloads
README.md - KiCad Export & Import → Job State & Artifacts: stores exports
app/services/job_manager.py