Member-only story

Electron — Architecture and Notifications

John Au-Yeung
3 min readOct 9, 2020

--

Photo by Jamie Street on Unsplash

Electron is a framework that lets us create cross-platform desktop apps.

The apps are created by creating web apps that are wrapped with a wrapper.

In this article, we’ll look at the architecture and notifications of an Electron app.

Main and Renderer Processes

An electron app runs on a main and rendered process.

The main process creates the GUI.

The rendered process is the process that Chromium runs on to render the content.

Electron has the power to use Node APIs to allow lower-level operating system operations.

The main process creates a web page with a BrowserWindow instance.

The BrowserWindow instance runs on its own rendered process.

When the BrowserWindow instance is destroyed, the rendered process is also terminated.

Using Electron APIs

We can use Electron’s APIs to do some operations.

For instance, we would use the BrowserWindow API to create the window.

Our Electron project has a main.js file to draw the window:

const { app, BrowserWindow } = require('electron')

--

--

No responses yet