How arduino/arduino-ide works
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: protocol Protocol · node Backend services · common Common code · theia Theia UI
Components 18
Electron
Native app lifecycle, windowing, and packaging boundary.
- Main app · Native app lifecycle, packaging hooks, and platform integration.
arduino-ide-extension/src/electron-main - Browser bridge · Renderer-side Electron integration, menus, dialogs, and preload-facing glue.
arduino-ide-extension/src/electron-browser - App shell · Packaged desktop app entrypoints and distribution scripts.
electron-app
Renderer/UI
Theia and React-based IDE experience in the browser process.
- IDE actions · Commands and contributions that wire IDE actions into the UI.
arduino-ide-extension/src/browser/contributions - Theia UI · Customized Theia shell, editors, navigation, output, terminal, SCM, search, and preferences.
arduino-ide-extension/src/browser/theia - Boards UI · Board selection, configuration, and auto-install flows.
arduino-ide-extension/src/browser/boards - Sketchbooks · Local and cloud sketchbook widgets and project browsing.
arduino-ide-extension/src/browser/widgets - Serial tools · Serial monitor and plotter user interface.
arduino-ide-extension/src/browser/serial - Dialogs · Firmware upload, certificate upload, settings, update, and account dialogs.
arduino-ide-extension/src/browser/dialogs - Account flows · 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 · Authoritative host services for sketches, boards, libraries, config, and devices.
arduino-ide-extension/src/node - CLI daemon · Delegation layer to arduino-cli daemon via generated gRPC/protobuf bindings.
arduino-ide-extension/src/node/cli-protocol - Theia backend · Backend customization for workspace, filesystem, websocket, and plugin hosting.
arduino-ide-extension/src/node/theia - Auth server · Authentication server, keychain access, and token handling.
arduino-ide-extension/src/node/auth - Monitor host · Serial monitor coordination, proxying, and monitor settings.
arduino-ide-extension/src/node/monitor-manager.ts - Update host · 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 · Shared service interfaces between browser and node runtimes.
arduino-ide-extension/src/common/protocol - Common code · Shared types, decorators, menu helpers, and localization support.
arduino-ide-extension/src/common
Connections 20
- 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.