Architecture

Modular is three processes on your machine: the desktop app (Electron), a local server it starts, and the web UI shown in the app's window. The web UI can also run in a browser against a server you start yourself.

terminal
Electron main (apps/desktop) ──starts──▶ server (apps/server) ◀──HTTP / WebSocket── web UI (apps/web)
        │                                    │
        └── window, tray, updates,           ├── SQLite database (packages/db, Drizzle)
            CLI install, native helpers      ├── terminals (node-pty), agent CLIs
                                             └── plugins (server side)

In the desktop app the web UI reaches the server through Electron main (an IPC fetch broker), not through the browser's network stack; in a browser it uses HTTP directly. Terminals stream over WebSockets; live updates (Spaces, attention, downloads, plugins) come over one server-sent event stream per window (GET /events).

Repository#

PathWhat it is
apps/desktopElectron main and preload: window, tray, updates (Sparkle on macOS), CLI install, data folder, backups
apps/serverThe local server (Elysia, TypeScript): one folder per module in src/modules/
apps/webThe React UI: the canvas, studios, overlays, settings (src/features/)
apps/relaydA Go relay that connects Modular servers which cannot reach each other directly
apps/landingThe website and blog
apps/playgroundA sandbox for UI experiments
apps/zhi-slack-bridgeAn MCP bridge that routes an agent's questions to Slack threads
packages/cliThe modular command, mostly generated from the server's OpenAPI
packages/dbThe Drizzle schema and migrations
packages/plugin-sdkThe plugin SDK and its developer guide
packages/design-systemDesign tokens and rules for the UI
packages/ipcTyped IPC between Electron main and the renderer
packages/streamdownThe markdown renderer
packages/download-centerThe shared downloader
packages/fabric-protocolThe protocol between connected Modular servers
packages/model-api-simulatorA local stand-in for model APIs, used by tests
plugins/*The built-in plugins
chronicleA Rust daemon for local activity capture
e2eEnd-to-end scenarios (Cucumber + Playwright)
resourcesApp icons, the brand, and skills shipped with the app

Each module folder has a README.md that says what it owns and how it connects. Start with apps/server, apps/web/src/features and apps/web/src/features/canvas.

Principles#

The full rules are in AGENTS.md; the decisions behind the current design are in plans/.