mirror of
https://github.com/PR0M3TH3AN/VoxVera.git
synced 2025-09-08 23:18:42 +00:00
Add Electron GUI and packaging scripts
This commit is contained in:
16
gui/README.md
Normal file
16
gui/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# VoxVera GUI
|
||||
|
||||
This directory contains a minimal Electron wrapper around the `voxvera` CLI.
|
||||
It exposes a simple "Quickstart" button so non-technical users can generate
|
||||
flyers without touching the command line.
|
||||
|
||||
## Development
|
||||
|
||||
```
|
||||
cd gui/electron
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
The Electron app invokes the `voxvera` binary from your `PATH`.
|
||||
Make sure it is installed before launching the GUI.
|
16
gui/electron/index.html
Normal file
16
gui/electron/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>VoxVera GUI</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>VoxVera</h1>
|
||||
<button id="quickstart">Quickstart</button>
|
||||
<script>
|
||||
document.getElementById('quickstart').addEventListener('click', () => {
|
||||
window.voxvera.quickstart();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
28
gui/electron/main.js
Normal file
28
gui/electron/main.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||
const { spawn } = require('child_process');
|
||||
const path = require('path');
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
});
|
||||
win.loadFile('index.html');
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow);
|
||||
|
||||
ipcMain.handle('run-quickstart', async () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const proc = spawn('voxvera', ['quickstart'], { stdio: 'inherit' });
|
||||
proc.on('close', code => resolve(code));
|
||||
proc.on('error', err => reject(err));
|
||||
});
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit();
|
||||
});
|
11
gui/electron/package.json
Normal file
11
gui/electron/package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "voxvera-gui",
|
||||
"version": "0.1.0",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^29.0.0"
|
||||
}
|
||||
}
|
5
gui/electron/preload.js
Normal file
5
gui/electron/preload.js
Normal file
@@ -0,0 +1,5 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
contextBridge.exposeInMainWorld('voxvera', {
|
||||
quickstart: () => ipcRenderer.invoke('run-quickstart')
|
||||
});
|
Reference in New Issue
Block a user