initial commit

This commit is contained in:
Simeon Radivoev 2026-01-23 04:56:39 +02:00
commit 3e90445fab
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
20 changed files with 961 additions and 0 deletions

38
src/bun/index.ts Normal file
View file

@ -0,0 +1,38 @@
import { BrowserWindow, Updater } from "electrobun/bun";
const DEV_SERVER_PORT = 5173;
const DEV_SERVER_URL = `http://localhost:${DEV_SERVER_PORT}/Dashboard`;
// Check if Vite dev server is running for HMR
async function getMainViewUrl(): Promise<string> {
const channel = await Updater.localInfo.channel();
if (channel === "dev") {
try {
await fetch(DEV_SERVER_URL, { method: "HEAD" });
console.log(`HMR enabled: Using Vite dev server at ${DEV_SERVER_URL}`);
return DEV_SERVER_URL;
} catch {
console.log("Vite dev server not running. Run 'bun run dev:hmr' for HMR support.");
}
}
return "views://mainview/index.html";
}
// Create the main application window
const url = await getMainViewUrl();
const mainWindow = new BrowserWindow({
title: "GameFlow",
url,
styleMask: {
Borderless: true,
},
frame: {
width: 1280,
height: 800,
x: 200,
y: 200,
},
});
console.log("React Tailwind Vite app started!");