Electron desktop app that runs the Polotno design editor in the renderer. A native File menu opens and saves designs as .json files and exports PNG and PDF through the main process.
- Node.js 20+ and npm
- macOS, Windows or Linux
npm install
npm startnpm run make builds an installer for the current platform with Electron Forge.
Note: Set your Polotno API key before running. Create one at polotno.com/login, then add
VITE_POLOTNO_KEY=your-keyto.env.local. in the dashboard, add these to the key's allowed domains:
localhost–npm startserves the renderer from the Vite dev serverelectron– the packaged app loads the renderer fromfile://, which Polotno reports aselectronWithout them, the editor shows a license warning and the photo and template panels stay empty.
| Path | Role |
|---|---|
src/main.js |
Window, File menu, open/save dialogs, writes files to disk |
src/preload.js |
window.files – the only API the renderer gets, via contextBridge |
src/editor.jsx |
The Polotno store and editor UI |
src/renderer.jsx |
Mounts the editor and runs File menu commands |
- No WebView bridge. Electron's renderer is Chromium, so it imports
polotnolike any React app. - Menu → renderer. Menu items send a
menu-commandIPC message to the window they were clicked in. The renderer runs the command against the store. - Renderer → disk.
store.toJSON(),store.toDataURL()andstore.toPDFDataURL()produce the design and exports. The renderer passes them towindow.files, and the main process shows a save dialog and writes the file. - Isolation stays on.
contextIsolationis on andnodeIntegrationis off (Electron's defaults). The renderer has no Node.js access.