Notifio is a desktop app that watches rental search pages and emails you when a new listing appears. It is an Electron app, so the obvious architecture is a main process, a preload script, a contextBridge surface and a pile of ipcMain.handle calls.
It is not built that way. The main process starts an Express server in-process, and the window is a browser pointed at it:
mainWindow . loadURL ( `http://localhost: ${ serverPort } ` );
Enter fullscreen mode
Exit fullscreen mode
The renderer does not know it is in Electron at all. It talks to its own origin:
// The renderer is served by the embedded Express server, so talk to it on the // same origin. This keeps things working if PORT is changed from the default. const BASE = typeof window !== " undefined " ? window . location . origin : " http://localhost:3000 " ;
Enter fullscreen mode
Exit fullscreen mode
ipcMain appears in exactly one file in the repository, and it belongs to the auto-reply recorder window.…