feat: integrate Electron for desktop application support

- Added Electron entry point in `electron/main.js` to run the Express server in-process and open the main application window.
- Updated `package.json` to include Electron dependencies and scripts for building and running the application.
- Refactored server startup logic into `server/start.js` for better modularity and to support both CLI and Electron usage.
- Implemented environment variable handling for database and image paths to accommodate Electron's packaging.
- Created a script `server/scripts/promote-morphix.js` to merge admin and morphix accounts into a single user.
- Adjusted image root path resolution in `server/media/images.js` to allow for environment variable overrides.
- Cleaned up `server/index.js` to delegate server initialization to the new `startServer` function.
This commit is contained in:
Marco Mooren
2026-05-11 18:55:02 +02:00
parent b86dcfbb8d
commit f6cdfd975c
9 changed files with 7887 additions and 2726 deletions

View File

@@ -26,6 +26,29 @@ npm start
The built kiosk is served from `/`, admin from `/admin/`, API from `/api`.
## Electron (desktop / Pi)
The Master view also runs as a standalone Electron app. The Express + WebSocket
server boots inside the Electron main process; controllers/panels on other
devices on the LAN connect to it normally.
```powershell
npm install # postinstall rebuilds better-sqlite3 for Electron's ABI
npm run electron # builds web assets and launches Electron
```
Packaging (Windows installer + Linux AppImage for Pi targets):
```powershell
npm run dist:win # NSIS installer
npm run dist:linux # AppImage for x64 / arm64 / armv7l
```
In packaged builds, the DB and image cache live under `app.getPath('userData')`
(`%APPDATA%/Online Radio Explorer` on Windows, `~/.config/Online Radio Explorer`
on Linux). In `npm run electron` dev mode the existing repo `data/` directory
is reused.
## Layout
- `server/` — Express, SQLite, WebSocket hub, source adapters, stream resolver.