Add Migrations
Some checks failed
Deploy Backend to Docker / deploy (push) Failing after 3m2s
Deploy Backend to Docker / deploy-portainer (push) Has been skipped

This commit is contained in:
2025-12-03 21:44:52 -05:00
parent 3f835bfcea
commit 1579f369c2
4 changed files with 28 additions and 2 deletions

View File

@@ -1,8 +1,21 @@
import { app, BrowserWindow, Tray, Menu, nativeImage } from 'electron';
import * as path from 'path';
import * as dotenv from 'dotenv';
import { setupIpcHandlers, cleanupIpcHandlers } from './ipc-handlers';
import { initDatabase, closeDatabase } from './database';
// Load environment variables from .env file
// In dev: __dirname = dist/main, so go up to electron-app root
// In prod: __dirname = resources/app.asar/dist/main, .env should be in resources
const envPath = process.env.NODE_ENV === 'development'
? path.join(__dirname, '../../.env')
: path.join(process.resourcesPath, '.env');
dotenv.config({ path: envPath });
console.log('Loading .env from:', envPath);
console.log('WS_URL:', process.env.WS_URL);
console.log('API_URL:', process.env.API_URL);
let mainWindow: BrowserWindow | null = null;
let tray: Tray | null = null;