Skip to content

Local Development Setup โ€‹

Architectural Foundation: Node.js ยท pnpm ยท Turborepo

Description: Local development setup guide covering prerequisites (Node.js v20+, pnpm v8), workspace installation, and Turborepo-orchestrated development and build scripts.

๐Ÿš€ Getting Started โ€‹

Prerequisites โ€‹

Ensure your local environment matches the following versions to avoid compatibility issues:

  • Node.js: v20+ (tested with v24.11.1) โ€” required for the --import tsx flag used by the desktop prebuild script
  • pnpm: v8.15.6 (Enforced via the packageManager field in package.json)

Installation โ€‹

Install all dependencies from the root directory:

bash
pnpm install

๐Ÿ›  Usage & Scripts โ€‹

This repository uses Turborepo to orchestrate tasks efficiently. All commands are executed from the root.

Development โ€‹

CommandDescription
pnpm devStart all applications (web and docs-dev) in parallel
pnpm dev:webStart only the Main Web App (strictly at http://localhost:5173)
pnpm dev:landingStart the Public Landing App (strictly at http://localhost:3000)
pnpm dev:docs-devStart VitePress for documentation development (strictly at http://localhost:6060)
pnpm dev:desktopStart the Web App + Electron in parallel for desktop development

> **Port Topology**: `electron-vite` dynamically allocates a background port (usually `5174`) for its internal renderer shell during `pnpm dev:desktop`. We strictly isolate `web` (`5173`) and `landing` (`3000`) onto separate port ranges to prevent race conditions during parallel execution.

Building & Quality โ€‹

CommandDescription
pnpm buildBuild all apps and packages using Turbo cache
pnpm build:webBuild only the web application
pnpm build:landingBuild only the landing page
pnpm build:docs-devBuild only the docs-dev application
pnpm build:desktopBuild the web app, then compile the Electron app
pnpm testRun unit tests (Vitest) across all packages
pnpm test:e2e:webRun Playwright E2E for apps/web (starts Vite on port 4173)
pnpm lintRun ESLint across the workspace
pnpm formatFormat code using Prettier

๐Ÿš€ Desktop Packaging & Distribution โ€‹

To package the application into a production-ready installer, use the following commands from the root directory:

CommandPlatformOutput Artifact
pnpm package:desktopCurrent OSDetects host OS and builds accordingly
pnpm package:macmacOS.dmg and .zip (supports x64 & arm64)
pnpm package:winWindows.exe (NSIS Installer)
pnpm package:linuxLinux.AppImage

> **Build Sequence**: All `package:*` commands execute the following pipeline automatically:

  1. turbo run build --filter=web โ€” Compiles the React SPA into apps/web/dist/.
  2. prebuild hook โ€” Runs node --import tsx scripts/copy-web-dist.ts, which copies apps/web/dist/ โ†’ apps/desktop/web-dist/.
  3. electron-builder โ€” Bundles web-dist/ into the packaged app via the files and extraResources blocks in electron-builder.yml.

You do not need to run these steps manually โ€” they are chained via npm scripts.

> **macOS Code Signing**: To build a distributable macOS app with Auto-Update support, you **must** have an Apple Developer Certificate and provide `CSC_LINK` and `CSC_KEY_PASSWORD` in your environment. Without code signing, macOS Gatekeeper will block the app and auto-updates will fail. See the Desktop documentation for details.

> **Cross-Compilation**: It is highly recommended to build for Windows on a Windows machine and for macOS on a Mac. Cross-compilation (e.g., building `.dmg` on Linux) may fail due to platform-specific toolchain dependencies. Use a CI matrix strategy (e.g., GitHub Actions with `runs-on: [macos-latest, windows-latest, ubuntu-latest]`) for multi-platform releases.