# raulmoracode/kiboar architecture

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

- Interactive diagram: https://gitdiagram.com/raulmoracode/kiboar
- Repository: https://github.com/raulmoracode/kiboar

## Overview

Kiboar is a keyboard brand repository spanning a public website, an online catalogue, a Medusa shop with POS and sales reporting, a KiCad design library, and Kiboar Studio for detecting and flashing boards. The main user paths are browsing the brand or shop catalogue, and using Studio to select a board and firmware artifact before flashing. The README also identifies documentation as a product, but its source tree is not included here. Relationships below are limited to README statements and the shown excerpts or SOURCE INDEX references; unsampled internals are represented at their supported directory level.

Main entry points: [`shop/storefront/src/components/App.tsx`](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/App.tsx) (Storefront app), [`software/app/src-tauri/src/commands.rs`](https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/commands.rs) (Tauri commands), [`software/app/src/App.tsx`](https://github.com/raulmoracode/kiboar/blob/main/software/app/src/App.tsx) (Studio interface), [`software/app/src-tauri/src/flash.rs`](https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/flash.rs) (Firmware flashing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Brand website"]
  node_webapp["Web router<br/>[App.tsx]"]
  node_webpages["Brand pages"]
end

subgraph group_shop["Shop and POS"]
  node_storeapp["Storefront app<br/>[App.tsx]"]
  node_storeapi["Store API client<br/>[api.ts]"]
  node_catalogue["Product catalogue<br/>[Catalogue.tsx]"]
  node_product["Product details<br/>[ProductPage.tsx]"]
  node_bag["Shopping bag<br/>[Bag.tsx]"]
  node_bagstorage[("Bag persistence<br/>[bagStorage.ts]")]
  node_medusa["Medusa service"]
  node_pos["Point of sale"]
  node_salesui["Sales register UI<br/>[page.tsx]"]
  node_salesroute["Sales report API<br/>[route.ts]"]
  node_salesmodel["Sales mapping<br/>[sales.ts]"]
end

subgraph group_studio["Board Studio"]
  node_studioapp["Studio interface<br/>[App.tsx]"]
  node_studiostore["Studio state<br/>[store.ts]"]
  node_tauri["Tauri commands<br/>[commands.rs]"]
  node_scanner["Device scanner<br/>[scanner.rs]"]
  node_registry["Board registry<br/>[registry.rs]"]
  node_flasher["Firmware flashing<br/>[flash.rs]"]
  node_deviceprotocol["Device protocol<br/>[protocol.rs]"]
  node_uf2["UF2 artifacts<br/>[uf2.rs]"]
end

subgraph group_hardware["KiCad library"]
  node_library[("KiCad library")]
  node_sexpr["KiCad S-expression tools<br/>[kicad_sexpr.py]"]
  node_courtyard["Courtyard generation<br/>[gen_courtyard.py]"]
  node_libdocs["Library documentation generation<br/>[gen_docs.py]"]
end

subgraph group_shared["Shared schemas"]
  node_boardschema["Board definitions<br/>[board.ts]"]
end

node_visitor(("Visitor"))
node_shopper(("Shopper"))
node_studio_user(("Studio user"))
node_docs["Product documentation"]

node_visitor -->|"browses"| node_webapp
node_webapp -->|"routes to"| node_webpages
node_shopper -->|"browses"| node_storeapp
node_storeapp -->|"loads products"| node_storeapi
node_storeapp -->|"renders"| node_catalogue
node_storeapp -->|"renders"| node_product
node_storeapp -->|"renders"| node_bag
node_storeapp -->|"loads and saves"| node_bagstorage
node_storeapi -->|"requests catalogue"| node_medusa
node_pos -->|"uses service"| node_medusa
node_salesui -->|"fetches report"| node_salesroute
node_salesroute -->|"maps orders"| node_salesmodel
node_studio_user -->|"manages board"| node_studioapp
node_studioapp -->|"dispatches actions"| node_studiostore
node_studiostore -.->|"invokes commands"| node_tauri
node_tauri -->|"dispatches scans"| node_scanner
node_tauri -->|"dispatches lookups"| node_registry
node_tauri -->|"dispatches flashing"| node_flasher
node_flasher -->|"uses registry"| node_registry
node_studioapp -->|"uses board types"| node_boardschema
node_library -->|"includes tooling"| node_sexpr
node_courtyard -->|"uses parser"| node_sexpr
node_libdocs -->|"uses parser"| node_sexpr
node_visitor -->|"learns to build"| node_docs
node_shopper -.->|"learns to build"| node_docs
node_deviceprotocol -.->|"supports detection"| node_studioapp
node_uf2 -.->|"supports flashing"| node_flasher

click node_webapp "https://github.com/raulmoracode/kiboar/blob/main/web/src/App.tsx"
click node_webpages "https://github.com/raulmoracode/kiboar/tree/main/web/src/pages"
click node_storeapp "https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/App.tsx"
click node_storeapi "https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/lib/api.ts"
click node_catalogue "https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/Catalogue.tsx"
click node_product "https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/ProductPage.tsx"
click node_bag "https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/Bag.tsx"
click node_bagstorage "https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/lib/bagStorage.ts"
click node_medusa "https://github.com/raulmoracode/kiboar/tree/main/shop"
click node_pos "https://github.com/raulmoracode/kiboar/tree/main/shop/pos"
click node_salesui "https://github.com/raulmoracode/kiboar/blob/main/shop/src/admin/routes/sales/page.tsx"
click node_salesroute "https://github.com/raulmoracode/kiboar/blob/main/shop/src/api/admin/reports/sales/route.ts"
click node_salesmodel "https://github.com/raulmoracode/kiboar/blob/main/shop/src/lib/sales.ts"
click node_studioapp "https://github.com/raulmoracode/kiboar/blob/main/software/app/src/App.tsx"
click node_studiostore "https://github.com/raulmoracode/kiboar/blob/main/software/app/src/store.ts"
click node_tauri "https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/commands.rs"
click node_scanner "https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/scanner.rs"
click node_registry "https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/registry.rs"
click node_flasher "https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/flash.rs"
click node_deviceprotocol "https://github.com/raulmoracode/kiboar/blob/main/software/crates/kiboar-device/src/protocol.rs"
click node_uf2 "https://github.com/raulmoracode/kiboar/blob/main/software/crates/kiboar-flash/src/uf2.rs"
click node_library "https://github.com/raulmoracode/kiboar/tree/main/library"
click node_sexpr "https://github.com/raulmoracode/kiboar/blob/main/library/tools/kicad_sexpr.py"
click node_courtyard "https://github.com/raulmoracode/kiboar/blob/main/library/tools/gen_courtyard.py"
click node_libdocs "https://github.com/raulmoracode/kiboar/blob/main/library/tools/gen_docs.py"
click node_boardschema "https://github.com/raulmoracode/kiboar/blob/main/software/packages/core/src/schema/board.ts"
click node_docs "https://github.com/raulmoracode/kiboar/tree/main/docs"

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_webapp,node_webpages,node_studio_user toneBlue
class node_storeapp,node_storeapi,node_catalogue,node_product,node_bag,node_bagstorage,node_medusa,node_pos,node_salesui,node_salesroute,node_salesmodel toneAmber
class node_studioapp,node_studiostore,node_tauri,node_scanner,node_registry,node_flasher,node_deviceprotocol,node_uf2 toneMint
class node_library,node_sexpr,node_courtyard,node_libdocs toneRose
class node_boardschema,node_visitor,node_shopper toneIndigo
class node_docs toneTeal
```

## Components

### Brand website

- [Web router](https://github.com/raulmoracode/kiboar/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Brand pages](https://github.com/raulmoracode/kiboar/tree/main/web/src/pages): `web/src/pages`

### Shop and POS

- [Storefront app](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/App.tsx): `shop/storefront/src/components/App.tsx`
- [Store API client](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/lib/api.ts): `shop/storefront/src/lib/api.ts`
- [Product catalogue](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/Catalogue.tsx): `shop/storefront/src/components/Catalogue.tsx`
- [Product details](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/ProductPage.tsx): `shop/storefront/src/components/ProductPage.tsx`
- [Shopping bag](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/components/Bag.tsx): `shop/storefront/src/components/Bag.tsx`
- [Bag persistence](https://github.com/raulmoracode/kiboar/blob/main/shop/storefront/src/lib/bagStorage.ts): `shop/storefront/src/lib/bagStorage.ts`
- [Medusa service](https://github.com/raulmoracode/kiboar/tree/main/shop): `shop`
- [Point of sale](https://github.com/raulmoracode/kiboar/tree/main/shop/pos): `shop/pos`
- [Sales register UI](https://github.com/raulmoracode/kiboar/blob/main/shop/src/admin/routes/sales/page.tsx): `shop/src/admin/routes/sales/page.tsx`
- [Sales report API](https://github.com/raulmoracode/kiboar/blob/main/shop/src/api/admin/reports/sales/route.ts): `shop/src/api/admin/reports/sales/route.ts`
- [Sales mapping](https://github.com/raulmoracode/kiboar/blob/main/shop/src/lib/sales.ts): `shop/src/lib/sales.ts`

### Board Studio

- [Studio interface](https://github.com/raulmoracode/kiboar/blob/main/software/app/src/App.tsx): `software/app/src/App.tsx`
- [Studio state](https://github.com/raulmoracode/kiboar/blob/main/software/app/src/store.ts): `software/app/src/store.ts`
- [Tauri commands](https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/commands.rs): `software/app/src-tauri/src/commands.rs`
- [Device scanner](https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/scanner.rs): `software/app/src-tauri/src/scanner.rs`
- [Board registry](https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/registry.rs): `software/app/src-tauri/src/registry.rs`
- [Firmware flashing](https://github.com/raulmoracode/kiboar/blob/main/software/app/src-tauri/src/flash.rs): `software/app/src-tauri/src/flash.rs`
- [Device protocol](https://github.com/raulmoracode/kiboar/blob/main/software/crates/kiboar-device/src/protocol.rs): `software/crates/kiboar-device/src/protocol.rs`
- [UF2 artifacts](https://github.com/raulmoracode/kiboar/blob/main/software/crates/kiboar-flash/src/uf2.rs): `software/crates/kiboar-flash/src/uf2.rs`

### KiCad library

- [KiCad library](https://github.com/raulmoracode/kiboar/tree/main/library): `library`
- [KiCad S-expression tools](https://github.com/raulmoracode/kiboar/blob/main/library/tools/kicad_sexpr.py): `library/tools/kicad_sexpr.py`
- [Courtyard generation](https://github.com/raulmoracode/kiboar/blob/main/library/tools/gen_courtyard.py): `library/tools/gen_courtyard.py`
- [Library documentation generation](https://github.com/raulmoracode/kiboar/blob/main/library/tools/gen_docs.py): `library/tools/gen_docs.py`

### Shared schemas

- [Board definitions](https://github.com/raulmoracode/kiboar/blob/main/software/packages/core/src/schema/board.ts): `software/packages/core/src/schema/board.ts`

### Other components

- **Visitor**
- **Shopper**
- **Studio user**
- [Product documentation](https://github.com/raulmoracode/kiboar/tree/main/docs): `docs`

## Connections

- Visitor → Web router: browses (evidence: `README.md`)
- Web router → Brand pages: routes to (evidence: `web/src/App.tsx`)
- Shopper → Storefront app: browses (evidence: `README.md`)
- Storefront app → Store API client: loads products (evidence: `shop/storefront/src/components/App.tsx`)
- Storefront app → Product catalogue: renders (evidence: `shop/storefront/src/components/App.tsx`)
- Storefront app → Product details: renders (evidence: `shop/storefront/src/components/App.tsx`)
- Storefront app → Shopping bag: renders (evidence: `shop/storefront/src/components/App.tsx`)
- Storefront app → Bag persistence: loads and saves (evidence: `shop/storefront/src/components/App.tsx`)
- Store API client → Medusa service: requests catalogue (evidence: `shop/storefront/src/lib/api.ts`)
- Point of sale → Medusa service: uses service (evidence: `README.md`)
- Sales register UI → Sales report API: fetches report (evidence: `shop/src/admin/routes/sales/page.tsx`)
- Sales report API → Sales mapping: maps orders (evidence: `shop/src/api/admin/reports/sales/route.ts`)
- Studio user → Studio interface: manages board (evidence: `README.md`)
- Studio interface → Studio state: dispatches actions (evidence: `software/app/src/App.tsx`)
- Studio state → Tauri commands: invokes commands
- Tauri commands → Device scanner: dispatches scans (evidence: `software/app/src-tauri/src/commands.rs`)
- Tauri commands → Board registry: dispatches lookups (evidence: `software/app/src-tauri/src/commands.rs`)
- Tauri commands → Firmware flashing: dispatches flashing (evidence: `software/app/src-tauri/src/commands.rs`)
- Firmware flashing → Board registry: uses registry (evidence: `software/app/src-tauri/src/flash.rs`)
- Studio interface → Board definitions: uses board types (evidence: `software/app/src/App.tsx`)
- KiCad library → KiCad S-expression tools: includes tooling (evidence: `README.md`)
- Courtyard generation → KiCad S-expression tools: uses parser (evidence: `library/tools/gen_courtyard.py`)
- Library documentation generation → KiCad S-expression tools: uses parser (evidence: `library/tools/gen_docs.py`)
- Visitor → Product documentation: learns to build (evidence: `README.md`)
- Shopper → Product documentation: learns to build
- Device protocol → Studio interface: supports detection
- UF2 artifacts → Firmware flashing: supports flashing
