initial commit

This commit is contained in:
2025-08-07 22:11:53 -05:00
parent 5a722a4d65
commit 9c5877677f
9 changed files with 6253 additions and 0 deletions

36
iva_electron/src/main.js Normal file
View File

@@ -0,0 +1,36 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
const fs = require('fs');
require('dotenv').config({ debug: true, path: path.resolve(__dirname, '..', '.env') });
function createWindow() {
const width = parseInt(process.env.WIDTH) || 800;
const height = parseInt(process.env.HEIGHT) || 600;
const appTitle = process.env.APP_TITLE || 'Electron App';
const proxyEndpoint = process.env.PROXY_ENDPOINT || 'public/index.html';
const mainWindow = new BrowserWindow({
width,
height,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
},
title: appTitle
});
mainWindow.webContents.loadURL(proxyEndpoint);
}
app.whenReady().then(() => {
createWindow();
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});