Skip to content

The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.

4.7 KB
Raw Blame

Linedesk app for macOS and Windows

How the web, mobile and desktop apps fit together: docs/apps.md.

A native shell around the web app (Electron), like the mobile app (apps/mobile). The window opens the server's own pages (Linedesk Cloud by default), so the session, sync and every update of the web app come from the server as on the web. The web app finds the shell by window.linedeskDesktop (src/preload.ts, only on the server's own pages) and uses it for what a browser tab cannot do (apps/web/src/native/desktop/bridge.ts):

  • Sign-in with a provider (Google, Apple, Microsoft, GitHub, single sign-on) runs in the system's browser. The session comes back with the same one-use code and PKCE as in the mobile app (apps/api/src/app-sign-in.ts), but on a loopback address only this app listens on: http://127.0.0.1:<port>/app-sign-in/back?code=… (RFC 8252, 7.3; src/signIn.ts). The browser then shows "Go back to the Linedesk app". Email codes and passwords work in the window.
  • Notifications: while the app runs (also with its window closed: Dock on macOS, tray on Windows) it notifies about calls from its own sync, as a browser tab does: an urgent call as soon as the assistant flags it (it stays on screen on Windows, the Dock icon bounces on macOS), every call when it ends. Electron has no push service, so nothing comes while the app is not running.
  • Links: the app opens linedesk://open/#call/… (the start page with its page, like links in emails). A browser on a Mac or a PC hands links from emails to the app when "Open links in the desktop app" is on in that browser (User settings › Profile; apps/web/src/native/desktop/openInDesktop.ts).
  • Menus: the macOS menu bar (Settings ⌘,, Back ⌘[, Forward ⌘], Reload ⌘R, Edit, Window), the Windows tray. Their words come from the web app in the person's language. No menu key takes one the web app uses.
  • Window: only the server's pages and a fixed list of sites the web app sends it to and that lead back (Stripe Checkout, the calendars' and integrations' consent pages: IN_WINDOW_SITES in src/links.ts) open in it; other links open in the browser. Context isolation, sandbox, no Node in pages, permissions only for the server (notifications, microphone for test calls), Electron's fuses set for a shipped app. A shipped app refuses a debugging port and ignores LINEDESK_DESKTOP_SERVER; both work only in development and in CI's test build (LINEDESK_DESKTOP_E2E=1 at build time, never shipped).
  • Install: macOS: drag the app from the .dmg to Applications; started from anywhere else it offers once to move itself there. Windows: one click, no admin rights; the installer adds Start menu and desktop shortcuts and opens the app. From its first start the app opens at login, in the background, so calls keep notifying ("Open at login" in User settings › Profile turns it off; src/install.ts).
  • Updates: built in (electron-updater, src/updates.ts) and off until Linedesk publishes desktop releases.

Buying works in the desktop app as on the web (it is no store app).

Build

pnpm install
cd apps/desktop
pnpm electron:install                    # Electron's binary, once (pnpm does not run its install script)
pnpm start                               # opens Linedesk Cloud; LINEDESK_DESKTOP_SERVER=https://your.server for another
LINEDESK_APP_URL=https://your.server pnpm dist:mac   # .dmg in release/ (on a Mac)
LINEDESK_APP_URL=https://your.server pnpm dist:win   # installer in release/ (on Windows)

Signing: macOS with a Developer ID Application certificate (CSC_LINK, CSC_KEY_PASSWORD) and notarization with an App Store Connect API key (APPLE_API_KEY, APPLE_API_KEY_ID, APPLE_API_ISSUER); without them the build is unsigned. Windows with WIN_CSC_LINK and WIN_CSC_KEY_PASSWORD. Icons come from brand/ (pnpm icons).

CI (.github/workflows/desktop.yml) builds both on a pull request that changes the app, installs each on its runner and tests it with screenshots; the installers are kept as artifacts. Nothing is published.

Tests

  • pnpm test: the link and sign-in rules (src/*.test.ts).
  • e2e/ui.spec.ts, against a local dev stack with the demo data and a GitHub app set (GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, any values: GitHub itself is never reached): the whole provider sign-in through the browser and the loopback port, the inbox, and an urgent call's notification with the window closed. E2E_SERVER=<web origin> pnpm e2e e2e/ui.spec.ts (Linux without a screen: xvfb-run -a, ELECTRON_DISABLE_SANDBOX=1).
  • e2e/smoke.spec.ts: an installed test build (LINEDESK_DESKTOP_E2E=1; E2E_APP=<its executable>), as CI runs it.