Skip to content

Desktop development ​

Prepare an accessible HoHu backend and a valid account. The desktop repository requires Node.js >= 20.19 and pnpm >= 10.5. You can align with Web development on Node.js 22.12 or a newer compatible version; check current dependency engines.

1. Get the source ​

bash
git clone https://github.com/aihohu/hohu-admin-desktop.git
cd hohu-admin-desktop
pnpm install

Run subsequent commands in this directory. See environment setup for the backend.

2. Select the backend ​

Configure the main-process origin in the desktop project's .env.development:

dotenv
MAIN_VITE_BACKEND_ORIGIN=http://127.0.0.1:8000

This is an origin: scheme, host, and optional port only, without an /api path, query, or credentials. Development allows HTTP on localhost / 127.0.0.1. Production requires HTTPS.

Restart after changes. Main-process code now owns authentication and requests; legacy RENDERER_VITE_SERVICE_BASE_URL does not select the authentication backend. Set your HTTPS origin in .env.production for releases instead of relying on the framework default.

3. Run and check ​

bash
pnpm dev

Sign in with an existing backend account and check user information, menus, and sign-out. The desktop app does not initialize the backend administrator password.

CommandPurpose
pnpm devStart electron-vite development mode
pnpm typecheckCheck main-process and Vue types
pnpm testRun main-process service tests
pnpm lintESLint checks
pnpm fmtCheck formatting
pnpm buildCheck types and build into out
pnpm startPreview the built application; run build first
pnpm build:unpackProduce an unpacked application for local verification

4. Prepare installers ​

PlatformCommand
Windowspnpm build:win
macOSpnpm build:mac
Linuxpnpm build:linux; currently configured for AppImage and deb

Platform scripts run gen-publish before packaging with generated build/electron-builder.yml. Update-source settings come from the project-root .env or process environment:

DistributionSettings
GitHubUPDATER_PROVIDER=github, GH_OWNER, GH_REPO
Hosted filesUPDATER_PROVIDER=generic, UPDATER_URL

Point these settings to a distribution source you maintain. Check build output for artifact locations. Use build:unpack for local verification, then configure application identity, icons, signing, and updates for releases. The current macOS configuration disables notarization; a development package is not a notarized release.

Publish installers, update metadata, and update-source files together. Verify installation, sign-in, sign-out, and upgrades on target operating systems. See desktop features for integration.

Troubleshooting ​

SymptomCheck
Backend origin rejectedMAIN_VITE_BACKEND_ORIGIN, absence of paths, and HTTPS in production
Absolute request URL failsUse backend paths such as /business/...; see architecture
Session does not persistMain-process logs, safeStorage availability, and userData write access
Platform build reports missing publish settingsConfigure an update source, or use build:unpack for local verification
No update check in developmentDevelopment update configuration may be a placeholder; test a real source with a packaged app