# arduino/arduino-ide architecture

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

- Interactive diagram: https://gitdiagram.com/arduino/arduino-ide
- Repository: https://github.com/arduino/arduino-ide

## Overview

1. This repo is the Arduino IDE 2.x desktop application: a Theia-based IDE packaged with Electron. It is a monorepo, but the architectural center is the `arduino-ide-extension` package, which contains most product behavior.

2. The application is split into three runtime boundaries:
   - Electron main process: app/window lifecycle, packaging, native integration.
   - Renderer/browser process: Theia UI, React widgets, menus, dialogs, editor shell.
   - Node backend: host services for filesystem, CLI execution, discovery, upload, settings, and device interaction.

3. The main UI lives under `arduino-ide-extension/src/browser`. It is organized as Theia contributions plus custom widgets/dialogs. This layer owns the visible IDE experience: sketch editing, boards selection, libraries, serial monitor/plotter, preferences, notifications, cloud sketchbook, and update dialogs.

4. Domain-specific UI features are implemented as separate browser subsystems:
   - `boards/` for board selection/configuration and auto-install flows.
   - `widgets/sketchbook/` and `widgets/cloud-sketchbook/` for local and cloud project browsing.
   - `serial/monitor` and `serial/plotter` for live board I/O.
   - `dialogs/` for firmware upload, certificate upload, settings, IDE update, and account-related flows.

5. The backend logic lives under `arduino-ide-extension/src/node`. This layer implements the services behind the UI: sketches, boards, libraries, core installation, config, executable resolution, formatter, monitor management, notifications, and update-related services. It also owns host-state concerns such as local settings, paths, keychain access, and filesystem watching.

6. A major architectural dependency is `arduino-cli` running in daemon mode. The IDE does not compile or upload itself; instead, node-side service implementations delegate build, upload, core, board, and monitor operations to the CLI daemon over generated gRPC/protobuf bindings in `src/node/cli-protocol`.

7. The protocol layer in `src/common/protocol` is the contract between frontend and backend. It defines the service interfaces shared across browser and node, keeping the renderer thin and the backend authoritative for host operations. This boundary is important for the architecture diagram because it is where UI commands become backend requests.

8. Electron-specific code is separated into `src/electron-main` and `src/electron-browser`. The main process manages the native app window, updater integration, and platform behavior; the browser side bridges menu/window/dialog behavior into Theia. There is also a preload layer, which is the security boundary for controlled renderer access to Electron APIs.

9. The repo heavily customizes Theia rather than building a generic app. The `src/browser/theia` and `src/node/theia` trees adapt core IDE concepts such as editor management, navigation, output channels, terminal, SCM, search, debug, workspace, preferences, and plugin hosting to Arduino’s workflows.

10. Data flow typically looks like: user action in a React/Theia widget -> browser contribution/command -> shared protocol service -> node backend implementation -> local filesystem, CLI daemon, serial device, or external service -> progress/notification result back to the UI. Long-running tasks are surfaced through progress/notification abstractions rather than blocking the interface.

11. The repo also includes product-level integrations that affect architecture:
   - Authentication and cloud-sketch flows.
   - IDE and component update checks.
   - Board/core/example/library installation and discovery.
   - Serial port monitoring and plotting.
   These are not passive UI features; they are service-backed workflows spanning frontend, backend, and sometimes remote endpoints.

12. Packaging and distribution are handled outside the core app logic in `electron-app/` and the repository scripts. This includes platform packaging, notarization/signing, archives, and release artifacts. CI workflows under `.github/workflows` cover build, test, dependency checks, i18n sync, theme sync, and container/image publishing.

13. Internationalization and theming are first-class subsystems. Translation files live in `i18n/`, with scripts for Transifex sync; theme assets and generators are under `scripts/themes` and browser style/theme resources. These affect the UI layer but are separate from the runtime service architecture.

14. Tests are split by runtime boundary as well: browser tests validate UI state and contributions, node tests validate backend services, and electron-app tests cover packaging/archive behavior. This mirrors the architecture and is useful when drawing component boundaries.

Main entry points: [`arduino-ide-extension/src/common/protocol`](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/common/protocol) (Protocol), [`arduino-ide-extension/src/node`](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node) (Backend services), [`arduino-ide-extension/src/common`](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/common) (Common code), [`arduino-ide-extension/src/browser/theia`](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/theia) (Theia UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime_electron["Electron"]
  node_electron_main["Main app<br/>electron-main"]
  node_electron_browser["Browser bridge<br/>electron-browser"]
  node_electron_app["App shell<br/>packaging"]
end

subgraph group_runtime_browser["Renderer/UI"]
  node_browser_contrib["IDE actions<br/>browser-contrib"]
  node_browser_theia["Theia UI<br/>theia-ui"]
  node_browser_boards["Boards UI"]
  node_browser_sketchbook["Sketchbooks<br/>project-browser"]
  node_browser_serial["Serial tools<br/>serial-ui"]
  node_browser_dialogs["Dialogs"]
  node_browser_auth["Account flows<br/>auth-ui"]
end

subgraph group_runtime_node["Node backend"]
  node_node_services["Backend services<br/>node-services"]
  node_node_cli["CLI daemon<br/>arduino-cli bridge"]
  node_node_theia["Theia backend<br/>theia-backend"]
  node_node_auth["Auth server<br/>host-auth"]
  node_node_monitor["Monitor host<br/>device-monitor<br/>[monitor-manager.ts]"]
  node_node_update["Update host<br/>update-service"]
end

subgraph group_shared["Shared contract"]
  node_protocol["Protocol<br/>shared-api"]
  node_common["Common code<br/>shared-utils"]
end

node_electron_main -->|"creates renderer"| node_electron_browser
node_electron_main -->|"starts backend"| node_node_theia
node_electron_browser -->|"bridges UI"| node_browser_theia
node_electron_app -->|"packages"| node_electron_main
node_browser_contrib -->|"calls services"| node_protocol
node_browser_theia -->|"uses APIs"| node_protocol
node_browser_boards -->|"board actions"| node_protocol
node_browser_sketchbook -->|"project actions"| node_protocol
node_browser_serial -->|"device I/O"| node_protocol
node_browser_dialogs -->|"dialog ops"| node_protocol
node_browser_auth -->|"auth calls"| node_protocol
node_protocol -->|"implemented by"| node_node_services
node_node_services -->|"delegates build/upload"| node_node_cli
node_node_services -->|"manages monitors"| node_node_monitor
node_node_services -->|"auth backend"| node_node_auth
node_node_services -->|"update services"| node_node_update
node_node_theia -->|"uses shared code"| node_common
node_browser_theia -->|"uses shared code"| node_common
node_protocol -->|"defines contracts"| node_common
node_node_cli -->|"generated bindings"| node_common

click node_electron_main "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/electron-main"
click node_electron_browser "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/electron-browser"
click node_electron_app "https://github.com/arduino/arduino-ide/tree/main/electron-app"
click node_browser_contrib "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/contributions"
click node_browser_theia "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/theia"
click node_browser_boards "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/boards"
click node_browser_sketchbook "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/widgets"
click node_browser_serial "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/serial"
click node_browser_dialogs "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/dialogs"
click node_browser_auth "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/auth"
click node_node_services "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node"
click node_node_cli "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node/cli-protocol"
click node_node_theia "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node/theia"
click node_node_auth "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node/auth"
click node_node_monitor "https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/src/node/monitor-manager.ts"
click node_node_update "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node"
click node_protocol "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/common/protocol"
click node_common "https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/common"

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_electron_main,node_electron_browser,node_electron_app toneBlue
class node_browser_contrib,node_browser_theia,node_browser_boards,node_browser_sketchbook,node_browser_serial,node_browser_dialogs,node_browser_auth toneAmber
class node_node_services,node_node_cli,node_node_theia,node_node_auth,node_node_monitor,node_node_update toneMint
class node_protocol,node_common toneRose
```

## Components

### Electron

Native app lifecycle, windowing, and packaging boundary.

- [Main app](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/electron-main): electron-main · Native app lifecycle, packaging hooks, and platform integration. · `arduino-ide-extension/src/electron-main`
- [Browser bridge](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/electron-browser): electron-browser · Renderer-side Electron integration, menus, dialogs, and preload-facing glue. · `arduino-ide-extension/src/electron-browser`
- [App shell](https://github.com/arduino/arduino-ide/tree/main/electron-app): packaging · Packaged desktop app entrypoints and distribution scripts. · `electron-app`

### Renderer/UI

Theia and React-based IDE experience in the browser process.

- [IDE actions](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/contributions): browser-contrib · Commands and contributions that wire IDE actions into the UI. · `arduino-ide-extension/src/browser/contributions`
- [Theia UI](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/theia): theia-ui · Customized Theia shell, editors, navigation, output, terminal, SCM, search, and preferences. · `arduino-ide-extension/src/browser/theia`
- [Boards UI](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/boards): boards · Board selection, configuration, and auto-install flows. · `arduino-ide-extension/src/browser/boards`
- [Sketchbooks](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/widgets): project-browser · Local and cloud sketchbook widgets and project browsing. · `arduino-ide-extension/src/browser/widgets`
- [Serial tools](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/serial): serial-ui · Serial monitor and plotter user interface. · `arduino-ide-extension/src/browser/serial`
- [Dialogs](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/dialogs): ui-dialogs · Firmware upload, certificate upload, settings, update, and account dialogs. · `arduino-ide-extension/src/browser/dialogs`
- [Account flows](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/browser/auth): auth-ui · Authentication and cloud sketch interactions in the renderer. · `arduino-ide-extension/src/browser/auth`

### Node backend

Host services, filesystem, device, and CLI delegation.

- [Backend services](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node): node-services · Authoritative host services for sketches, boards, libraries, config, and devices. · `arduino-ide-extension/src/node`
- [CLI daemon](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node/cli-protocol): arduino-cli bridge · Delegation layer to arduino-cli daemon via generated gRPC/protobuf bindings. · `arduino-ide-extension/src/node/cli-protocol`
- [Theia backend](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node/theia): theia-backend · Backend customization for workspace, filesystem, websocket, and plugin hosting. · `arduino-ide-extension/src/node/theia`
- [Auth server](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node/auth): host-auth · Authentication server, keychain access, and token handling. · `arduino-ide-extension/src/node/auth`
- [Monitor host](https://github.com/arduino/arduino-ide/blob/main/arduino-ide-extension/src/node/monitor-manager.ts): device-monitor · Serial monitor coordination, proxying, and monitor settings. · `arduino-ide-extension/src/node/monitor-manager.ts`
- [Update host](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/node): update-service · Update-related backend services and daemon coordination. · `arduino-ide-extension/src/node`

### Shared contract

Common protocol and cross-boundary types used by frontend and backend.

- [Protocol](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/common/protocol): shared-api · Shared service interfaces between browser and node runtimes. · `arduino-ide-extension/src/common/protocol`
- [Common code](https://github.com/arduino/arduino-ide/tree/main/arduino-ide-extension/src/common): shared-utils · Shared types, decorators, menu helpers, and localization support. · `arduino-ide-extension/src/common`

## Connections

- Main app → Browser bridge: creates renderer · Main process launches and controls the browser-side Electron bridge.
- Main app → Theia backend: starts backend · Native app bootstrap wires the Theia backend and websocket endpoints.
- Browser bridge → Theia UI: bridges UI · Renderer integration feeds Electron behavior into the Theia UI layer.
- App shell → Main app: packages · Distribution scripts bundle the main-process app artifacts.
- IDE actions → Protocol: calls services · Commands and contributions invoke shared frontend service contracts.
- Theia UI → Protocol: uses APIs · Theia customizations talk to backend services through shared protocol interfaces.
- Boards UI → Protocol: board actions · Board selection and configuration depend on shared boards services.
- Sketchbooks → Protocol: project actions · Sketchbook browsing and project management use sketches and filesystem services.
- Serial tools → Protocol: device I/O · Serial monitor and plotter use monitor service contracts.
- Dialogs → Protocol: dialog ops · Dialogs request firmware, certificate, settings, and update operations.
- Account flows → Protocol: auth calls · Cloud/account UI authenticates through shared authentication services.
- Protocol → Backend services: implemented by · Node backend provides the authoritative implementations of shared services.
- Backend services → CLI daemon: delegates build/upload · Core operations are forwarded to the arduino-cli daemon.
- Backend services → Monitor host: manages monitors · Backend coordinates serial monitor lifecycle and settings.
- Backend services → Auth server: auth backend · Backend handles accounts, tokens, and keychain-backed secrets.
- Backend services → Update host: update services · Backend handles IDE and component update-related workflows.
- Theia backend → Common code: uses shared code · Backend customization reuses shared decorators, menus, and utilities.
- Theia UI → Common code: uses shared code · Renderer customization reuses shared menus, localization, and utilities.
- Protocol → Common code: defines contracts · Shared protocol types sit on top of common cross-cutting code.
- CLI daemon → Common code: generated bindings · CLI protocol bindings are consumed alongside shared types and helpers.
