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.

1.9 KB
Raw Blame

Native shells: the web app's side

Linedesk has three ways to run the same web app: in a browser, in the mobile app (apps/mobile, Capacitor, iOS and Android) and in the desktop app (apps/desktop, Electron, macOS and Windows). Both apps load the server's own pages; there is no second client. This folder is everything the web app does differently inside them. Overview of all three: docs/apps.md.

Folder Runs in What
mobile/ the mobile app platform.ts: isNativeApp(), nativePlatform() (Capacitor). plugins.ts: the native plugins' interfaces (the plugins live in apps/mobile). init.ts: status bar, Android back button, links from emails, splash. push.ts: APNs/FCM device tokens.
desktop/ the desktop app, and browsers on a Mac or PC bridge.ts: desktopApp(), isDesktopApp(), the menus' words, a clicked notification (the shell's preload gives window.linedeskDesktop). openInDesktop.ts and OpenedInDesktopPage.tsx: in a browser, hand links from emails to the desktop app when the person turned that on.
sign-in/ both apps, and the system browser they open appSignIn.ts: a provider sign-in for an app: a one-use code with PKCE, back to the phone app on its verified https address or to the desktop app on a loopback port. AppSignInPage.tsx: the page in the system browser. The server side: apps/api/src/app-sign-in.ts.

Rules:

  • Which shell am I in? isNativeApp() is only the mobile app (store rules: no buying inside it). isDesktopApp() is only the desktop app (buying works there as on the web). In a browser both are false.
  • Call native code only through these files; the rest of the web app imports from here and never from Capacitor or Electron directly.
  • Text the user sees comes from i18n keys like everywhere else; the shells carry none of their own (the desktop menus get their words from desktop/bridge.ts).