# buildwithtrace/trace architecture

> Architecture diagram of the GitHub repository buildwithtrace/trace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/buildwithtrace/trace
- Repository: https://github.com/buildwithtrace/trace

## Overview

Trace is a KiCad-derived electronics-design suite whose documented user journey runs from natural-language circuit requests and component discovery through schematic and PCB editing, routing, and design-rule checking. The README also highlights cloud collaboration and 3D viewing, represented as parallel capabilities. AI implementation evidence is limited to sampled common-layer modules; the broader editor and routing relationships follow the README and repository tree, not inspected call sites.

Main entry points: [`pcbnew`](https://github.com/buildwithtrace/trace/tree/main/pcbnew) (PCB editor), [`common/ai_backend_client.cpp`](https://github.com/buildwithtrace/trace/blob/main/common/ai_backend_client.cpp) (AI assistant), [`kicad/kicad_manager_frame.cpp`](https://github.com/buildwithtrace/trace/blob/main/kicad/kicad_manager_frame.cpp) (Project manager), [`common/conversation_sync.cpp`](https://github.com/buildwithtrace/trace/blob/main/common/conversation_sync.cpp) (Design sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ai["AI design"]
  node_assistant["AI assistant"]
  node_ai_tools["AI tool execution"]
  node_edit_translation["Edit translation"]
  node_vector_search["Component search"]
end

subgraph group_eda["EDA workflow"]
  node_schematic["Schematic editor"]
  node_symbol_libraries["Symbol libraries"]
  node_pcb_editor["PCB editor"]
  node_router["PCB routing"]
  node_drc["Rule checking<br/>[drc_engine.cpp]"]
  node_project_manager["Project manager"]
end

subgraph group_collab["Cloud collaboration"]
  node_cloud_sync["Design sync"]
  node_conversation_store[("Conversation storage")]
end

subgraph group_visual["Visualization"]
  node_viewer["3D viewer"]
  node_model_cache["3D model cache<br/>[3d_cache.cpp]"]
  node_rendering["3D rendering"]
end

node_engineer(("Engineer"))
node_cloud_service["Cloud service"]

node_engineer -->|"requests design"| node_assistant
node_assistant -->|"dispatches tools"| node_ai_tools
node_assistant -->|"searches parts"| node_vector_search
node_ai_tools -->|"translates edits"| node_edit_translation
node_engineer -->|"creates circuits"| node_schematic
node_schematic -->|"uses symbols"| node_symbol_libraries
node_engineer -->|"edits board"| node_pcb_editor
node_pcb_editor -->|"routes traces"| node_router
node_pcb_editor -->|"checks rules"| node_drc
node_engineer -->|"opens project"| node_project_manager
node_project_manager -->|"opens design"| node_schematic
node_project_manager -->|"opens design"| node_pcb_editor
node_engineer -->|"syncs designs"| node_cloud_sync
node_cloud_sync -.->|"syncs remotely"| node_cloud_service
node_cloud_sync -->|"stores conversations"| node_conversation_store
node_engineer -->|"views board"| node_viewer
node_viewer -->|"loads models"| node_model_cache
node_viewer -->|"renders scene"| node_rendering

click node_assistant "https://github.com/buildwithtrace/trace/blob/main/common/ai_backend_client.cpp"
click node_ai_tools "https://github.com/buildwithtrace/trace/blob/main/common/ai_tool_executor.cpp"
click node_edit_translation "https://github.com/buildwithtrace/trace/blob/main/common/ai_edit_translator.cpp"
click node_vector_search "https://github.com/buildwithtrace/trace/blob/main/common/vector_search_engine.cpp"
click node_schematic "https://github.com/buildwithtrace/trace/tree/main/eeschema"
click node_symbol_libraries "https://github.com/buildwithtrace/trace/blob/main/eeschema/symbol_library_manager.cpp"
click node_pcb_editor "https://github.com/buildwithtrace/trace/tree/main/pcbnew"
click node_router "https://github.com/buildwithtrace/trace/tree/main/pcbnew/router"
click node_drc "https://github.com/buildwithtrace/trace/blob/main/pcbnew/drc/drc_engine.cpp"
click node_project_manager "https://github.com/buildwithtrace/trace/blob/main/kicad/kicad_manager_frame.cpp"
click node_cloud_sync "https://github.com/buildwithtrace/trace/blob/main/common/conversation_sync.cpp"
click node_conversation_store "https://github.com/buildwithtrace/trace/blob/main/common/conversation_db.cpp"
click node_viewer "https://github.com/buildwithtrace/trace/blob/main/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp"
click node_model_cache "https://github.com/buildwithtrace/trace/blob/main/3d-viewer/3d_cache/3d_cache.cpp"
click node_rendering "https://github.com/buildwithtrace/trace/tree/main/3d-viewer/3d_rendering"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_assistant,node_ai_tools,node_edit_translation,node_vector_search toneBlue
class node_schematic,node_symbol_libraries,node_pcb_editor,node_router,node_drc,node_project_manager toneAmber
class node_cloud_sync,node_conversation_store toneMint
class node_viewer,node_model_cache,node_rendering toneRose
class node_engineer,node_cloud_service toneIndigo
```

## Components

### AI design

- [AI assistant](https://github.com/buildwithtrace/trace/blob/main/common/ai_backend_client.cpp): `common/ai_backend_client.cpp`
- [AI tool execution](https://github.com/buildwithtrace/trace/blob/main/common/ai_tool_executor.cpp): `common/ai_tool_executor.cpp`
- [Edit translation](https://github.com/buildwithtrace/trace/blob/main/common/ai_edit_translator.cpp): `common/ai_edit_translator.cpp`
- [Component search](https://github.com/buildwithtrace/trace/blob/main/common/vector_search_engine.cpp): `common/vector_search_engine.cpp`

### EDA workflow

- [Schematic editor](https://github.com/buildwithtrace/trace/tree/main/eeschema): `eeschema`
- [Symbol libraries](https://github.com/buildwithtrace/trace/blob/main/eeschema/symbol_library_manager.cpp): `eeschema/symbol_library_manager.cpp`
- [PCB editor](https://github.com/buildwithtrace/trace/tree/main/pcbnew): `pcbnew`
- [PCB routing](https://github.com/buildwithtrace/trace/tree/main/pcbnew/router): `pcbnew/router`
- [Rule checking](https://github.com/buildwithtrace/trace/blob/main/pcbnew/drc/drc_engine.cpp): `pcbnew/drc/drc_engine.cpp`
- [Project manager](https://github.com/buildwithtrace/trace/blob/main/kicad/kicad_manager_frame.cpp): `kicad/kicad_manager_frame.cpp`

### Cloud collaboration

- [Design sync](https://github.com/buildwithtrace/trace/blob/main/common/conversation_sync.cpp): `common/conversation_sync.cpp`
- [Conversation storage](https://github.com/buildwithtrace/trace/blob/main/common/conversation_db.cpp): `common/conversation_db.cpp`

### Visualization

- [3D viewer](https://github.com/buildwithtrace/trace/blob/main/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp): `3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp`
- [3D model cache](https://github.com/buildwithtrace/trace/blob/main/3d-viewer/3d_cache/3d_cache.cpp): `3d-viewer/3d_cache/3d_cache.cpp`
- [3D rendering](https://github.com/buildwithtrace/trace/tree/main/3d-viewer/3d_rendering): `3d-viewer/3d_rendering`

### Other components

- **Engineer**
- **Cloud service**

## Connections

- Engineer → AI assistant: requests design
- AI assistant → AI tool execution: dispatches tools
- AI assistant → Component search: searches parts
- AI tool execution → Edit translation: translates edits
- Engineer → Schematic editor: creates circuits
- Schematic editor → Symbol libraries: uses symbols
- Engineer → PCB editor: edits board
- PCB editor → PCB routing: routes traces
- PCB editor → Rule checking: checks rules
- Engineer → Project manager: opens project
- Project manager → Schematic editor: opens design
- Project manager → PCB editor: opens design
- Engineer → Design sync: syncs designs
- Design sync → Cloud service: syncs remotely
- Design sync → Conversation storage: stores conversations
- Engineer → 3D viewer: views board
- 3D viewer → 3D model cache: loads models
- 3D viewer → 3D rendering: renders scene
