### Install Update: JavaScript Source: https://context7.com/hoiber/elliechat-ui/llms.txt Installs a downloaded update by quitting the application and initiating the update process. This involves handling confirmation from the user in the renderer process and executing the quit and install command in the main process. ```javascript // In renderer process // Typically called after update is fully downloaded window.ellieAPI.onUpdateDownloaded((event, info) => { console.log('Update downloaded:', info.version); // Prompt user to install const userConfirmed = confirm('Update ready. Restart to install?'); if (userConfirmed) { window.ellieAPI.installUpdate(); } }); // Main process handler (src/main.js:286-288) iacMain.handle('install-update', () => { autoUpdater.quitAndInstall(); }); ``` -------------------------------- ### Install and Run Elliechat-UI Development Dependencies Source: https://github.com/hoiber/elliechat-ui/blob/main/CLAUDE.md Commands to install project dependencies and run the application in development mode. This includes setting up the environment for local development and debugging. ```bash npm install npm run dev ``` -------------------------------- ### Electron Builder Configuration (JSON) Source: https://context7.com/hoiber/elliechat-ui/llms.txt Configuration for Electron Builder in `package.json` to build installers for multiple platforms (Windows, macOS, Linux). It specifies application details, output directories, file inclusions, compression settings, and platform-specific targets and icons. ```json // In package.json (lines 39-138) { "build": { "appId": "com.elliechat.app", "productName": "EllieChat", "directories": { "output": "dist" }, "files": [ "src/**/*", "assets/**/*", "package.json" ], "compression": "maximum", "removePackageScripts": true, "asar": true, "publish": [ { "provider": "github", "owner": "hoiber", "repo": "elliechat-ui" } ], "win": { "target": [ { "target": "nsis", "arch": ["x64", "arm64"] } ], "icon": "assets/icon.ico", "publisherName": "EllieChat" }, "mac": { "target": [ { "target": "dmg", "arch": ["x64", "arm64"] }, { "target": "zip", "arch": ["x64", "arm64"] } ], "icon": "assets/icon.icns", "category": "public.app-category.productivity", "hardenedRuntime": true, "gatekeeperAssess": false }, "linux": { "target": [ { "target": "AppImage", "arch": ["x64", "arm64"] }, { "target": "deb", "arch": ["x64", "arm64"] } ], "icon": "assets/icon.png", "category": "Utility" } } } ``` -------------------------------- ### Development and Production Commands (Bash) Source: https://context7.com/hoiber/elliechat-ui/llms.txt Provides essential npm commands for managing the EllieChat UI project. Includes commands for installing dependencies, running the application in development mode with DevTools enabled, and running in production mode. It also references a flag used to open DevTools. ```bash # Install dependencies npm install # Run in development mode with DevTools npm run dev # Run in production mode (no DevTools) npm start # The --dev flag is checked in main.js (line 77-79) # if (process.argv.includes('--dev')) { # mainWindow.webContents.openDevTools(); # } ``` -------------------------------- ### Regenerate Platform-Specific Icons with npm Source: https://github.com/hoiber/elliechat-ui/blob/main/assets/README.md This command regenerates platform-specific icons such as .ico for Windows and .icns for macOS. It is typically run after updating the base icon.png. The process requires Node.js and npm to be installed. ```bash npm run generate-icons ``` -------------------------------- ### Get LibreChat URL - JavaScript Source: https://context7.com/hoiber/elliechat-ui/llms.txt Retrieves the currently configured LibreChat URL from persistent storage. It defaults to a predefined URL if no custom URL has been set. This API is called from the renderer process and handled in the main process. ```javascript // In renderer process (after preload.js loads) const currentUrl = await window.ellieAPI.getLibreChatUrl(); console.log('Current LibreChat URL:', currentUrl); // Output: "https://elliechat.elab.network" (or custom URL if configured) // Main process handler (src/main.js:215-217)ipcMain.handle('get-librechat-url', () => { return store.get('librechatUrl', DEFAULT_LIBRECHAT_URL); }); ``` -------------------------------- ### Release Versioning and Pushing (Bash) Source: https://context7.com/hoiber/elliechat-ui/llms.txt Commands for updating the project's version number using npm and creating git tags, which typically trigger a CI/CD pipeline for automated releases. It demonstrates how to increment the patch, minor, or major version and push the changes along with tags to the repository. ```bash # Update version number and create git tag npm version patch # 1.0.0 -> 1.0.1 npm version minor # 1.0.0 -> 1.1.0 npm version major # 1.0.0 -> 2.0.0 # Push changes and tags to trigger CI/CD git push && git push --tags # GitHub Actions will automatically: ``` -------------------------------- ### Build and Package Elliechat-UI for Production Source: https://github.com/hoiber/elliechat-ui/blob/main/CLAUDE.md Commands for building the Elliechat-UI application for production and for specific platforms. These commands are used to create distributable application packages. ```bash npm start npm run build npm run build:win npm run build:mac npm run build:linux npm run pack ``` -------------------------------- ### Manual Build Commands for EllieChat UI Source: https://github.com/hoiber/elliechat-ui/blob/main/RELEASE.md Commands to manually build the EllieChat UI project for the current platform or specific target platforms. These are used when the automated release process is not desired or needs to be bypassed. ```bash # Build for your current platform npm run build # Or build for specific platforms npm run build:win npm run build:mac npm run build:linux ``` -------------------------------- ### Push Git Tag for Release Source: https://github.com/hoiber/elliechat-ui/blob/main/RELEASE.md Commands to push the current branch and all tags to the remote repository. This action typically triggers automated build and release pipelines on platforms like GitHub. ```bash git push && git push --tags ``` -------------------------------- ### Release New Version of Elliechat-UI Source: https://github.com/hoiber/elliechat-ui/blob/main/CLAUDE.md Steps to create a new release for the Elliechat-UI application. This involves updating the version number, creating a Git tag, and pushing to GitHub to trigger automated builds and releases. ```bash # Update version and create tag npm version patch # or minor/major # Push to GitHub (triggers CI build) git push && git push --tags ``` -------------------------------- ### Electron Window Bounds Persistence (JavaScript) Source: https://context7.com/hoiber/elliechat-ui/llms.txt Saves and restores window position and size using electron-store with debouncing. It retrieves saved bounds on creation, and saves them on resize/move events or before the application quits. The debouncing helps optimize performance by limiting save operations. ```javascript // Window creation with saved bounds (src/main.js:24-50) function createWindow() { // Retrieve saved window bounds or use defaults const windowBounds = store.get('windowBounds', { width: 1200, height: 800 }); mainWindow = new BrowserWindow({ width: windowBounds.width, height: windowBounds.height, x: windowBounds.x, y: windowBounds.y, webPreferences: { preload: path.join(__dirname, 'preload.js'), contextIsolation: true, nodeIntegration: false, webSecurity: true, sandbox: true, backgroundThrottling: false, spellcheck: false }, icon: path.join(__dirname, '../assets/icon.png'), show: false, backgroundColor: '#ffffff' }); // Save window bounds on resize/move with debouncing mainWindow.on('resize', saveWindowBounds); mainWindow.on('move', saveWindowBounds); } // Debounced save function (src/main.js:82-91) function saveWindowBounds() { if (boundsTimeout) clearTimeout(boundsTimeout); boundsTimeout = setTimeout(() => { if (mainWindow && !mainWindow.isMaximized() && !mainWindow.isMinimized()) { store.set('windowBounds', mainWindow.getBounds()); } }, 500); // Wait 500ms after last resize/move } // Save on quit (src/main.js:321-329) app.on('before-quit', () => { if (boundsTimeout) clearTimeout(boundsTimeout); if (mainWindow && !mainWindow.isMaximized() && !mainWindow.isMinimized()) { store.set('windowBounds', mainWindow.getBounds()); } }); ``` -------------------------------- ### Download Update - JavaScript Source: https://context7.com/hoiber/elliechat-ui/llms.txt Initiates the background download of an available application update. It also provides a mechanism to listen for download progress updates, reporting percentage, speed, and transferred/total data. ```javascript // In renderer process const downloadResult = await window.ellieAPI.downloadUpdate(); console.log('Download started:', downloadResult.success); // Listen for download progress window.ellieAPI.onDownloadProgress((event, progressObj) => { console.log(`Progress: ${progressObj.percent}%`); console.log(`Speed: ${(progressObj.bytesPerSecond / 1024 / 1024).toFixed(2)} MB/s`); console.log(`Downloaded: ${(progressObj.transferred / 1024 / 1024).toFixed(2)} MB`); console.log(`Total: ${(progressObj.total / 1024 / 1024).toFixed(2)} MB`); }); // Main process handler (src/main.js:280-283)ipcMain.handle('download-update', () => { autoUpdater.downloadUpdate(); return { success: true }; }); ``` -------------------------------- ### Auto-Update API Source: https://context7.com/hoiber/elliechat-ui/llms.txt APIs for checking and downloading application updates. ```APIDOC ## GET /api/elliechat/updates/check ### Description Manually triggers an update check and returns information about available updates. ### Method GET ### Endpoint /api/elliechat/updates/check ### Parameters None ### Request Example ```javascript // In renderer process const updateResult = await window.ellieAPI.checkForUpdates(); if (updateResult.success) { console.log('Available update:', updateResult.updateInfo.version); console.log('Release date:', updateResult.updateInfo.releaseDate); console.log('Release notes:', updateResult.updateInfo.releaseNotes); } else { console.error('Update check failed:', updateResult.error); } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the update check was successful. - **updateInfo** (object) - Information about the available update. - **version** (string) - The version number of the available update. - **releaseDate** (string) - The release date of the update. - **releaseNotes** (string) - The release notes for the update. #### Response Example ```json { "success": true, "updateInfo": { "version": "1.2.0", "releaseDate": "2023-10-27", "releaseNotes": "Fixed bugs and improved performance." } } ``` #### Error Response (500) - **success** (boolean) - Always false in case of an error. - **error** (string) - A message describing the error. #### Error Response Example ```json { "success": false, "error": "Network error while checking for updates." } ``` ``` ```APIDOC ## POST /api/elliechat/updates/download ### Description Initiates the download of an available update in the background. You can listen for download progress events. ### Method POST ### Endpoint /api/elliechat/updates/download ### Parameters None ### Request Example ```javascript // In renderer process const downloadResult = await window.ellieAPI.downloadUpdate(); console.log('Download started:', downloadResult.success); // Listen for download progress window.ellieAPI.onDownloadProgress((event, progressObj) => { console.log(`Progress: ${progressObj.percent}%`); console.log(`Speed: ${(progressObj.bytesPerSecond / 1024 / 1024).toFixed(2)} MB/s`); }); ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the download initiation was successful. #### Response Example ```json { "success": true } ``` **Note:** This endpoint only initiates the download. Progress and completion events are handled via separate listeners (`window.ellieAPI.onDownloadProgress`). ``` -------------------------------- ### URL Dialog Event: JavaScript Source: https://context7.com/hoiber/elliechat-ui/llms.txt Handles the event to display a URL configuration dialog from the application menu. In the renderer process, it creates and appends a dialog to the DOM. The main process listens for the 'show-url-dialog' event to trigger this display. ```javascript // In renderer process window.ellieAPI.onShowUrlDialog(() => { // Display custom URL input dialog const dialog = document.createElement('div'); dialog.innerHTML = `