Desktop Application

Hollama can be run as a native desktop application for macOS, Windows, and Linux, providing a more integrated experience.

Using the Pre-built Application

The easiest way to use the desktop version is to download a pre-built binary.

  1. Go to the GitHub Releases page.
  2. Find the latest release and download the appropriate installer for your operating system:
    • macOS: .dmg file
    • Windows: .exe installer
    • Linux: .tar.gz archive
  3. Install and run the application.

Building from Source

If you are a developer and wish to build the desktop application from the source code, you can do so using the provided scripts.

Prerequisites

  • Node.js (version specified in .nvmrc)
  • npm

Build Steps

  1. Clone the repository:

    git clone https://github.com/fmaclen/hollama.git
    cd hollama
  2. Install dependencies:

    npm install
  3. Run the build command:

    npm run electron:build

This script performs two main actions:

  1. vite build: It builds the SvelteKit web application with the PUBLIC_ADAPTER environment variable set to electron-node.
  2. electron-builder: It then takes the web app build and packages it into a native desktop application using the configuration in electron-builder.yml.

The final application packages will be created in the dist/ directory.

How It Works

The desktop application is powered by Electron. The main process is defined in electron/main.js. Its primary responsibilities are:

  • Creating a BrowserWindow to render the user interface.
  • In a packaged app, it forks a child process to run the built-in Node.js server that serves the SvelteKit application.
  • In development, it loads the URL from the Vite development server.
  • It handles window lifecycle events, like closing the app or activating it on macOS.