Files
radio-explorer/README.md
Marco Mooren f6cdfd975c 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.
2026-05-11 18:55:02 +02:00

58 lines
1.6 KiB
Markdown

# Online Radio Explorer
Touchscreen kiosk + admin for exploring and playing internet radio in the office.
## Quick start
```powershell
cp .env.example .env
npm install
npm run dev
```
- Kiosk: http://localhost:5173/
- Admin: http://localhost:5173/admin/
- API: http://localhost:4173/api
First boot creates the SQLite DB at `DB_PATH`, runs the seed, and provisions the
bootstrap admin from `ADMIN_BOOTSTRAP_USER` / `ADMIN_BOOTSTRAP_PASSWORD`.
## Production
```powershell
npm run build
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.
- `web/` — Vanilla JS kiosk (`web/`) and admin (`web/admin/`) bundled by Vite.
- `data/seed/stations.json` — curated starter pack.
- `deploy/` — systemd unit + Pi setup notes.