Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ usable as the lower-level agent package.

## Requirements

- Python 3.11 or newer
- Python 3.11.x
- Node.js `^20.19.0` or `>=22.12.0`
- npm

Python 3.11.x is the currently validated version for both backend development
and Desktop packaging. Using the same minor version keeps the local runtime and
the PyInstaller build environment consistent.

PostgreSQL, MySQL, Ollama, and local GGUF models are optional. They are needed
only when you choose those connection or model types.

Expand All @@ -71,7 +75,7 @@ only when you choose those connection or model types.
### 1. Install the backend

From the repository root, create the runtime environment expected by the start
script:
script. Confirm that `python3.11 --version` reports Python 3.11.x first:

```bash
python3.11 -m venv backend/.venv-runtime
Expand Down Expand Up @@ -167,12 +171,17 @@ cd frontend
npm run dev:desktop
```

The development shell uses the AurigaSQL product name and icon. It still runs
from Electron's development executable; distributable application metadata is
applied by the packaging commands below.

Set `VITE_BFF_BASE_URL` in `frontend/.env.local` only when the BFF is not running
at `http://127.0.0.1:6003`.

## Desktop Packaging

Install the packaging dependencies first:
Desktop packaging uses the same Python 3.11.x virtual environment created in
Quick Start. Activate it and install the packaging dependencies first:

```bash
source backend/.venv-runtime/bin/activate
Expand Down
5 changes: 4 additions & 1 deletion backend/packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ platform-specific `llama.cpp` runtime files.

## Build the bundled backend and app

Use Python 3.11 for PyInstaller builds.
Use Python 3.11.x for PyInstaller builds. This is the currently validated
packaging version and should match the environment at `backend/.venv-runtime`.

```bash
python3.11 -m venv backend/.venv-runtime
source backend/.venv-runtime/bin/activate
python -m pip install -e .
python -m pip install -r backend/requirements.txt
python -m pip install -r backend/requirements-build.txt
Expand Down
2 changes: 1 addition & 1 deletion backend/packaging/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DIST_DIR="${AURIGASQL_BACKEND_DIST_DIR:-$REPO_ROOT/frontend/electron-backend}"

PYTHON_VERSION="$("$PYTHON_BIN" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
if [[ "$PYTHON_VERSION" != 3.11* ]]; then
echo "AurigaSQL desktop backend builds require Python 3.11; got $PYTHON_VERSION from $PYTHON_BIN" >&2
echo "AurigaSQL desktop backend builds require Python 3.11.x; got $PYTHON_VERSION from $PYTHON_BIN" >&2
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion backend/packaging/build-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $env:PYINSTALLER_CONFIG_DIR = Join-Path $RepoRoot "build/pyinstaller-cache"

$PythonVersion = & $PythonBin -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
if (-not $PythonVersion.StartsWith("3.11")) {
throw "AurigaSQL desktop backend builds require Python 3.11; got $PythonVersion from $PythonBin"
throw "AurigaSQL desktop backend builds require Python 3.11.x; got $PythonVersion from $PythonBin"
}

New-Item -ItemType Directory -Force -Path $DistDir | Out-Null
Expand Down
13 changes: 12 additions & 1 deletion frontend/electron/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const http = require("node:http");
const path = require("node:path");
const { spawn } = require("node:child_process");

const APP_NAME = "AurigaSQL";
const APP_ICON = path.join(__dirname, "assets", "icon.png");
const DEV_SERVER_URL = process.env.ELECTRON_RENDERER_URL || "http://127.0.0.1:5173";
const BACKEND_PORT = Number(process.env.AURIGASQL_BFF_PORT || "6013");
const BACKEND_BASE_URL = `http://127.0.0.1:${BACKEND_PORT}`;
Expand All @@ -12,6 +14,10 @@ let backendRestartCount = 0;
let backendStopRequested = false;
let quitting = false;

// `electron .` runs through Electron's generic development executable. Set the
// product identity explicitly so the development shell matches packaged builds.
app.setName(APP_NAME);

ipcMain.handle("app:restart-backend", async () => {
if (!app.isPackaged) return { ok: false, message: "Backend restart is only managed in packaged app mode." };
await stopBackend();
Expand Down Expand Up @@ -55,7 +61,8 @@ function createWindow() {
height: 960,
minWidth: 1100,
minHeight: 720,
title: "AurigaSQL",
title: APP_NAME,
icon: APP_ICON,
backgroundColor: "#f7f4ee",
webPreferences: {
preload: path.join(__dirname, "preload.cjs"),
Expand Down Expand Up @@ -345,6 +352,10 @@ app.on("before-quit", () => {
});

app.whenReady().then(() => {
if (!app.isPackaged && process.platform === "darwin") {
app.dock.setIcon(APP_ICON);
}

createWindow();

app.on("activate", () => {
Expand Down