From 816c883f300e617bfe073a0e0ebbbce17d7dc26c Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:00:04 +0800 Subject: [PATCH 1/4] docs(desktop): improve .env.example with accurate configuration guide - Clarify that local dev needs no .env (GATEWAY_URL set in package.json) - Document GATEWAY_URL override for local gateway testing - Add detailed explanation of both URLs (Gateway vs API Server) - List dev/prod values for each environment variable Co-Authored-By: Claude Opus 4.5 --- apps/desktop/.env.example | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/apps/desktop/.env.example b/apps/desktop/.env.example index 25b5317f..ee9e562e 100644 --- a/apps/desktop/.env.example +++ b/apps/desktop/.env.example @@ -2,22 +2,34 @@ # Multica Desktop Environment Configuration # ============================================================================= # -# Copy this file to create environment-specific configs: -# .env.development - Local development (npm run dev) -# .env.staging - Test environment (npm run build --mode staging) -# .env.production - Production release (npm run build) +# Local Development: +# `pnpm dev` connects to dev gateway by default (GATEWAY_URL set in root package.json) +# No .env file needed for local development. +# To override: GATEWAY_URL=http://localhost:3000 pnpm dev +# +# Production Build: +# `pnpm build` uses .env.production automatically # # Variable naming convention: -# MAIN_VITE_* - Available in main process only -# RENDERER_VITE_* - Available in renderer process only -# VITE_* - Available in all processes +# MAIN_VITE_* - Main process only (Node.js, full system access) +# RENDERER_VITE_* - Renderer process only (browser context) +# VITE_* - All processes +# +# ============================================================================= +# URL Configuration +# ============================================================================= +# +# MAIN_VITE_GATEWAY_URL - WebSocket Gateway +# Hub connects to Gateway for remote device access (QR code pairing) +# Dev: https://multica-dev.copilothub.ai (default via package.json) +# Prod: https://gateway.multica.ai +# +# MAIN_VITE_MULTICA_URL - REST API Server +# HTTP requests for authentication, auto-updates, user data sync +# Dev: https://multica-dev.copilothub.ai +# Prod: https://api.multica.ai # # ============================================================================= -# Gateway WebSocket server URL -# Used for Hub <-> Gateway communication MAIN_VITE_GATEWAY_URL=http://localhost:3000 - -# Multica API server URL -# Used for HTTP API requests (auth, updates, etc.) MAIN_VITE_MULTICA_URL=http://localhost:3001 From c0b248e8f9667057a1c3d7e4dee168397503a023 Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:02:13 +0800 Subject: [PATCH 2/4] fix: remove hardcoded URLs, reference config files instead URLs may change - point to package.json and .env.production as sources of truth. Co-Authored-By: Claude Opus 4.5 --- apps/desktop/.env.example | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/.env.example b/apps/desktop/.env.example index ee9e562e..2dadba50 100644 --- a/apps/desktop/.env.example +++ b/apps/desktop/.env.example @@ -21,13 +21,13 @@ # # MAIN_VITE_GATEWAY_URL - WebSocket Gateway # Hub connects to Gateway for remote device access (QR code pairing) -# Dev: https://multica-dev.copilothub.ai (default via package.json) -# Prod: https://gateway.multica.ai +# Dev: see GATEWAY_URL in root package.json +# Prod: see .env.production # # MAIN_VITE_MULTICA_URL - REST API Server # HTTP requests for authentication, auto-updates, user data sync -# Dev: https://multica-dev.copilothub.ai -# Prod: https://api.multica.ai +# Dev: (not yet configured) +# Prod: see .env.production # # ============================================================================= From 8704e37faaa00e63adb4c507d13a3e87dfe6820a Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:03:26 +0800 Subject: [PATCH 3/4] fix: clarify dev gateway is hardcoded in root package.json Co-Authored-By: Claude Opus 4.5 --- apps/desktop/.env.example | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/.env.example b/apps/desktop/.env.example index 2dadba50..c3483547 100644 --- a/apps/desktop/.env.example +++ b/apps/desktop/.env.example @@ -3,9 +3,9 @@ # ============================================================================= # # Local Development: -# `pnpm dev` connects to dev gateway by default (GATEWAY_URL set in root package.json) +# `pnpm dev` connects to dev gateway by default (GATEWAY_URL hardcoded in root package.json) # No .env file needed for local development. -# To override: GATEWAY_URL=http://localhost:3000 pnpm dev +# To use local gateway instead: GATEWAY_URL=http://localhost:3000 pnpm dev # # Production Build: # `pnpm build` uses .env.production automatically @@ -21,12 +21,12 @@ # # MAIN_VITE_GATEWAY_URL - WebSocket Gateway # Hub connects to Gateway for remote device access (QR code pairing) -# Dev: see GATEWAY_URL in root package.json +# Dev: hardcoded in root package.json (GATEWAY_URL env var in `dev` script) # Prod: see .env.production # # MAIN_VITE_MULTICA_URL - REST API Server # HTTP requests for authentication, auto-updates, user data sync -# Dev: (not yet configured) +# Dev: not yet used # Prod: see .env.production # # ============================================================================= From ad06679e6938de9bab8e2b07848c55a8507b8b6c Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:04:44 +0800 Subject: [PATCH 4/4] fix: simplify - just say pnpm dev works directly Co-Authored-By: Claude Opus 4.5 --- apps/desktop/.env.example | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/desktop/.env.example b/apps/desktop/.env.example index c3483547..dd98975b 100644 --- a/apps/desktop/.env.example +++ b/apps/desktop/.env.example @@ -3,9 +3,8 @@ # ============================================================================= # # Local Development: -# `pnpm dev` connects to dev gateway by default (GATEWAY_URL hardcoded in root package.json) -# No .env file needed for local development. -# To use local gateway instead: GATEWAY_URL=http://localhost:3000 pnpm dev +# Just run `pnpm dev` - connects to dev gateway (multica-dev.copilothub.ai) +# GATEWAY_URL is hardcoded in root package.json, no .env file needed. # # Production Build: # `pnpm build` uses .env.production automatically @@ -21,7 +20,7 @@ # # MAIN_VITE_GATEWAY_URL - WebSocket Gateway # Hub connects to Gateway for remote device access (QR code pairing) -# Dev: hardcoded in root package.json (GATEWAY_URL env var in `dev` script) +# Dev: multica-dev.copilothub.ai (hardcoded in root package.json) # Prod: see .env.production # # MAIN_VITE_MULTICA_URL - REST API Server