What it is
Electron is a framework for building desktop applications with web technology. Each app bundles the Chromium browser engine for its windows and Node.js for access to the operating system, so one JavaScript codebase can produce an app for macOS, Windows and Linux. The result is a native window, menu, dock or taskbar icon and installer, driven by the same HTML, CSS and JavaScript a website uses.
It was created at GitHub and is now an OpenJS Foundation project. Many familiar desktop programs are built on it. Tools such as electron-builder package the app into installers, and electron-updater handles updates from a feed the developer controls. The trade-off is size: each app carries its own copy of the browser engine, so installers are larger than a fully native app.
How I use it
- Rental Pilot's desktop app is built with Electron and electron-builder, with installers for macOS (Intel and Apple Silicon) and Windows.
- Signed with an Apple Developer ID certificate.
- Updates itself through electron-updater from a feed hosted on the API server.
- Loads the live web app, so it stays at feature parity with the web; any web change that touches windows, downloads or shortcuts is checked against the shell in the same task.
- The dock and tray icons take on each tenant's branding at runtime, with an unread badge on the dock.
Electron is the right tool when a team already has a good web app and needs a proper desktop program with a dock icon, notifications and installers, without writing it twice. I reach for it so Rental Pilot's office staff get a desktop app that shows the same features as the web on the same day, not months later.
Questions
Can my web app become a desktop app?
Yes. Rental Pilot's desktop app is an Electron shell around the live web app, with signed macOS and Windows installers and automatic updates. Features land on the desktop as soon as they land on the web.
How do desktop updates reach users?
Rental Pilot uses electron-updater, which checks a feed on the API server and installs new builds. Staff do not have to download anything by hand.