How jacobgeorgemathew/electrical_panel_design_automation works
This is a web application prototype for generating an electrical distribution-board design package. Users enter requirements, create a project, and request design generation; the backend validates requirements and coordinates electrical calculations, component selection, netlist and schematic generation, physical placement, routing, validation, and CAD-oriented outputs. The CEM and PDM carry traceable design data between stages. The README documents capabilities whose implementation was not sampled; edges for those documented flows cite it. The map omits internal calls not evidenced by the excerpts, index, or README.
Main entry points: orchestrator.py Design orchestrator · projectStore.ts Project state · main.py FastAPI routes · client.ts API client
Components 27
Frontend
- React application
frontend/src/App.tsx - Requirements form
frontend/src/components/requirements/Questionnaire.tsx - Project state
frontend/src/stores/projectStore.ts - API client
frontend/src/api/client.ts - Schematic view
frontend/src/components/schematic/SchematicViewer.tsx - 2D layout view
frontend/src/components/layout/Layout2DViewer.tsx - 3D panel editor
frontend/src/components/threeD/Panel3DViewer.tsx - Validation panel
frontend/src/components/validation/ValidationPanel.tsx - BOM table
frontend/src/components/bom/BOMTable.tsx
API and projects
- FastAPI routes
backend/app/main.py - Project repository
backend/app/repositories/project_repository.py
Electrical design
- Requirement engine
backend/app/services/requirement_engine.py - Canonical model
backend/app/models/cem.py - Engineering calculations
backend/app/services/calculation_engine.py - Component selection
backend/app/services/component_selector.py - Graph and netlist
backend/app/services/netlist_engine.py - Schematic generation
backend/app/services/schematic_engine.py
Physical design
- Design orchestrator
backend/app/services/orchestrator.py - Enclosure selection
backend/app/services/enclosure_engine.py - Constrained placement
backend/app/algorithms/cp_sat_placement.py - Wire routing
backend/app/algorithms/jps_theta_star.py - Physical model
backend/app/models/pdm.py - Physical validation
backend/app/services/validation_engine.py
Outputs and change
- CAD output
backend/app/services/cad_engine.py - Change propagation
backend/app/services/change_propagation.py - Bill of materials
backend/app/services/orchestrator.py
Other components
- User
Connections 32
- User → React application: uses
README.md - React application → API client: calls API
frontend/src/api/client.ts - User → Requirements form: enters requirements
README.md - Requirements form → Project state: updates state
frontend/src/components/requirements/Questionnaire.tsx - Project state → API client: requests design
frontend/src/stores/projectStore.ts - API client → FastAPI routes: sends REST
README.md - FastAPI routes → Project repository: reads and saves
- FastAPI routes → Design orchestrator: generates design
- FastAPI routes → Requirement engine: validates requirements
- Design orchestrator → Requirement engine: validates
backend/app/services/orchestrator.py - Design orchestrator → Canonical model: creates model
backend/app/services/orchestrator.py - Design orchestrator → Engineering calculations: calculates parameters
backend/app/services/orchestrator.py - Design orchestrator → Component selection: selects components
backend/app/services/orchestrator.py - Design orchestrator → Graph and netlist: builds netlist
README.md - Graph and netlist → Schematic generation: provides graph data
README.md - Design orchestrator → Enclosure selection: selects enclosure
README.md - Design orchestrator → Constrained placement: places components
backend/app/services/orchestrator.py - Design orchestrator → Wire routing: routes connections
backend/app/services/orchestrator.py - Design orchestrator → Physical model: produces physical model
README.md - Design orchestrator → Physical validation: validates layout
README.md - FastAPI routes → Physical validation: validates placement
- FastAPI routes → CAD output: requests CAD output
- Design orchestrator → CAD output: generates CAD data
backend/app/services/orchestrator.py - Design orchestrator → Bill of materials: assembles BOM
README.md - FastAPI routes → Change propagation: computes design diff
- Change propagation → Design orchestrator: regenerates designs
backend/app/api/routes_design.py - API client → Project state: returns results
frontend/src/stores/projectStore.ts - Project state → Schematic view: supplies schematic
README.md - Project state → 2D layout view: supplies layout
frontend/src/components/layout/Layout2DViewer.tsx - Project state → 3D panel editor: supplies PDM
frontend/src/components/threeD/Panel3DViewer.tsx - Project state → Validation panel: supplies violations
README.md - Project state → BOM table: supplies BOM
README.md