Edge Deployer is an Electron 36 desktop application. It combines a Monaco-based code editor, a multi-cloud deployment engine, and a local edge-runtime simulator into a single native app.
┌─────────────────────────────────────────────────┐
│ Electron Main Process │
│ ┌──────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ Deploy │ │ Secrets │ │ Workspace │ │
│ │ Engine │ │ Vault │ │ Persistence │ │
│ └────┬─────┘ └────┬─────┘ └───────┬───────┘ │
│ │ │ │ │
│ ┌────▼──────────────▼────────────────▼───────┐ │
│ │ IPC Bridge (ipcMain) │ │
│ └────────────────────┬────────────────────────┘ │
└───────────────────────│──────────────────────────┘
│ contextBridge (preload.ts)
┌───────────────────────▼──────────────────────────┐
│ Renderer Process (React) │
│ ┌──────────┐ ┌──────────┐ ┌───────────────┐ │
│ │ Monaco │ │ Panels │ │ WorkspaceBar │ │
│ │ Editor │ │ (tabs) │ │ + ImportPanel│ │
│ └──────────┘ └──────────┘ └───────────────┘ │
│ ┌──────────────────────────────────────────────┐ │
│ │ Preview iframe (preview.html) │ │
│ │ Edge runtime simulation (fetch events, KV) │ │
│ └──────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────┘
| Concern | Process | Rationale |
|---|---|---|
| File I/O, secrets encryption | Main | Node.js APIs not available in renderer |
| Cloud API calls | Main | CORS restrictions; token isolation |
| Plugin sandbox (vm module) | Main | Full Node.js vm isolation |
| UI, editor state | Renderer | React + Monaco |
| Edge runtime preview | iframe | Origin isolation; simulated fetch API |
Rule: the renderer never holds plaintext credentials. All tokens flow through the encrypted vault in the main process and are redacted from IPC responses.
Every renderer → main call goes through contextBridge.exposeInMainWorld('electronAPI', {...}). The full surface is typed in src/types.ts as ElectronAPI. No nodeIntegration, no remote module.
Key channel groups:
deploy-to-cloud,rollback-with-healthcheck— deployment enginesave-workspace,open-workspace,auto-save-workspace— project persistenceimport-from-cloud,detect-drift— cloud importsave-secret,load-secrets,delete-secret— secrets vaultai-assist,ai-generate— AI assistant (Claude API)load-plugins— plugin discoverydownload-{pulumi,terraform,wrangler,dockerfile}— IaC export
validate(config)
→ build(code, config) // produce BuildArtifact
→ deploy(artifact, config) // returns DeployResult { url, deploymentId, latencyMs }
The IDeployer interface (src/cloudDeployers/IDeployer.ts) is the only contract each provider must implement. Adding a new provider means creating one file that satisfies those 7 methods.
A workspace is a JSON file written by electron/workspace.ts. Credentials are never written (enforced by the WorkspaceData type's Omit<EnvConfig, ...> config field). The file tracks:
- Tabs (code + language + dirty flag)
- Active tab ID
- Deploy history (last 10 records)
- Panel layout state
- Provider (but not token)
Auto-save fires 30 seconds after the last edit when a workspace file is open.
Plugins run inside a vm.Context constructed by electron/pluginSandbox.ts. The sandbox:
- Has no
require, nofs, nonetby default - Exposes
fetchonly if the manifest declaresnetwork:fetchpermission - Has a 5-second execution timeout
- Exposes a
__pluginLogaccumulator (no direct console access)
Plugin manifests are validated against a schema before loading. Invalid or version-incompatible manifests are rejected with a typed error.
See security.md for the full threat model.