Skip to main content
Source Code: src/gaia/electron/
Component: Electron Desktop App Framework Module: src/gaia/electron/

Platform: Cross-platform (Windows, Linux) Version: Electron 31.0.0+

Overview

The Electron Integration system provides a reusable framework for packaging GAIA web UI applications as standalone desktop apps. It abstracts Electron configuration, window management, and backend communication into a shared library that any GAIA app can use. Key Features:
  • Shared Electron framework (@amd-gaia/electron)
  • Multi-app support (Jira, Chat, Docker)
  • Dynamic app loading via app.config.json
  • Express backend integration
  • MCP client communication
  • Production/development modes

Requirements

Functional Requirements

  1. App Configuration System
    • Load app metadata from app.config.json
    • Validate required fields (name, displayName, port)
    • Support custom window configurations
    • Environment-based configuration
  2. Window Management
    • Create BrowserWindow with app-specific settings
    • Handle window lifecycle (ready, close, activate)
    • Support custom dimensions and behavior
    • Dev tools in development mode
  3. Backend Service
    • Start Express server for static files
    • Proxy API requests to Python backend
    • CORS configuration
    • Health check endpoints
  4. IPC Communication
    • Base IPC handlers (window control, navigation)
    • MCP client integration
    • Tool invocation from renderer
    • Result streaming

Non-Functional Requirements

  1. Modularity
    • Shared framework as npm package
    • App-specific customization
    • Clean separation of concerns
  2. Developer Experience
    • Hot reload in dev mode
    • Clear error messages
    • Easy app creation workflow
  3. Production Readiness
    • Optimized builds
    • Error handling
    • Logging and diagnostics

System Architecture

Component Diagram

Directory Structure


API Specification

app.config.json Schema

Location: src/gaia/apps/{app_name}/webui/app.config.json
Example: src/gaia/apps/jira/webui/app.config.json

AppController API

Class: AppController

WindowManager API

Class: WindowManager

IPC API (Renderer ↔ Main)

Exposed to renderer via preload:

Environment Variables


Implementation Details

App Loading Flow

Express Server Setup

Window Creation

MCP Integration


Testing Requirements

Unit Tests

File: tests/electron/test_app_config.js

Integration Tests

File: tests/electron/test_app_launch.js

Dependencies


Usage Examples

Example 1: Create New Electron App

Example 2: Development Mode

Example 3: Production Build



Electron Integration Technical Specification