diff --git a/backend/app/main.py b/backend/app/main.py index 0c6c781..3e5c302 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -11,10 +11,23 @@ from .routers import auth, meetings, ai, export, sidecar from .sidecar_manager import get_sidecar_manager # Determine client directory path +# In development: backend/../client/src +# In packaged mode: backend/backend/_internal/../../client (relative to backend executable) BACKEND_DIR = Path(__file__).parent.parent PROJECT_DIR = BACKEND_DIR.parent CLIENT_DIR = PROJECT_DIR / "client" / "src" +# Check for packaged mode (PyInstaller sets _MEIPASS) +import sys +if getattr(sys, 'frozen', False): + # Packaged mode: look for client folder relative to executable + # Backend runs from resources/backend/, client files at resources/backend/client/ + EXEC_DIR = Path(sys.executable).parent.parent # up from backend/backend.exe + CLIENT_DIR = EXEC_DIR / "client" + print(f"[Backend] Packaged mode: CLIENT_DIR={CLIENT_DIR}") +else: + print(f"[Backend] Development mode: CLIENT_DIR={CLIENT_DIR}") + @asynccontextmanager async def lifespan(app: FastAPI): @@ -77,6 +90,7 @@ async def health_check(): # ======================================== # Check if client directory exists for browser mode +print(f"[Backend] CLIENT_DIR exists: {CLIENT_DIR.exists()}") if CLIENT_DIR.exists(): # Serve static assets (CSS, JS, etc.) app.mount("/styles", StaticFiles(directory=CLIENT_DIR / "styles"), name="styles") diff --git a/client/package.json b/client/package.json index 561a049..4464cf9 100644 --- a/client/package.json +++ b/client/package.json @@ -41,6 +41,26 @@ { "from": "config.json", "to": "config.json" + }, + { + "from": "src/pages", + "to": "backend/client/pages", + "filter": ["**/*"] + }, + { + "from": "src/styles", + "to": "backend/client/styles", + "filter": ["**/*"] + }, + { + "from": "src/services", + "to": "backend/client/services", + "filter": ["**/*"] + }, + { + "from": "src/config", + "to": "backend/client/config", + "filter": ["**/*"] } ], "win": { diff --git a/client/src/main.js b/client/src/main.js index fcacbba..4d685b1 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -734,10 +734,19 @@ ipcMain.handle("open-in-browser", async () => { const host = backendConfig.host || "127.0.0.1"; const port = backendConfig.port || 8000; - // Determine the current page URL + // Determine the current page URL and preserve query parameters let currentPage = "login"; + let queryString = ""; + if (mainWindow) { const currentUrl = mainWindow.webContents.getURL(); + + // Parse query string from current URL (e.g., ?id=123) + const urlMatch = currentUrl.match(/\?(.+)$/); + if (urlMatch) { + queryString = "?" + urlMatch[1]; + } + if (currentUrl.includes("meetings.html")) { currentPage = "meetings"; } else if (currentUrl.includes("meeting-detail.html")) { @@ -745,7 +754,7 @@ ipcMain.handle("open-in-browser", async () => { } } - const browserUrl = `http://${host}:${port}/${currentPage}`; + const browserUrl = `http://${host}:${port}/${currentPage}${queryString}`; try { await shell.openExternal(browserUrl);