Backend Modes

Standalone (Supabase) vs Unified (Soar API): how to choose, how the mode is resolved, and what does not mix.

The template ships with two complete backends behind one set of business contracts. Which one a build is assembled against is a build-level choice made in the environment before packaging — a single install authenticates and stores data against exactly one backend, and there is no user-facing switch.

Standalone ModeUnified Mode
SOAR_BACKEND_MODEsupabase (default)soarApi
AuthSupabase AuthBetter Auth (/api/auth/*, Bearer token, main process only)
DataPostgREST + RLSSoar App API (/api/app/v1/*)
Session storagesafeStorage-encrypted storePrivate safeStorage namespace per API origin and channel
BillingCreem web checkoutHost-managed subscription snapshot, checkout, and portal
OAuth / device tokens / test pushPer Standalone docsNot implemented — absent rather than approximated
Shares users/data with a web appNoYes — same host as a conforming Web template

Standalone Mode is the classic single-template setup: the desktop app talks directly to your Supabase project. If you only bought the Electron template, this is your mode and nothing about it changed.

Unified Mode points the app at a conforming Web host's Soar App API instead. Web and desktop then share one Better Auth user, one todos table, one profile, and one subscription row. All Unified networking lives in the main process: the renderer sees business capabilities and a sanitized session over typed IPC — never the Bearer token, Authorization header, or presigned URLs.

Start here

Pick the mode, then follow exactly one setup guide:

If you are undecided, the platform-level mode guide and Compatibility Matrix compare the two deployments product-by-product.

How the mode is resolved

SOAR_BACKEND_MODE is baked into the build as a compile-time define (__BACKEND_MODE__) shared by main, preload, and renderer, and shared/platform/backend-mode.ts resolves it once:

  • soarApi → Unified Mode.
  • Anything else — including unset — → Standalone Mode (supabase).

app/backends/backend-factory.ts lazily imports exactly one backend graph, so the unselected backend never runs module-level initialization in a packaged build. Renderer code depends on the business contracts and contains no backend type checks.

No silent fallback. If Unified Mode is selected but SOAR_API_BASE_URL is missing or malformed, the Soar API path fails with a diagnosable configuration error — the app never initializes the Supabase backend instead. A misconfigured backend should be impossible to miss.

The two modes do not mix

Each backend is a separate identity source. A Supabase session cannot call the Soar App API, and a Better Auth session cannot read your Supabase tables — by design there is no bridging, no dual-write, and no fallback from one mode to the other:

  • Auth, data, storage, and subscription always come from the same backend preset. You cannot sign in with Supabase and store todos via the Soar API.
  • Users created in one mode do not exist in the other. The same email registered in both places is two unrelated accounts.

Switching a production app between modes is a data migration, not a config flip. Flipping SOAR_BACKEND_MODE on an install base means: migrating user accounts into the new identity source (users must re-authenticate — password hashes don't transfer automatically), moving todos, profiles, and uploaded files, and re-pointing billing identities to the new user IDs. Pick the mode per deployment before launch; treat a later switch as a planned migration project.

On this page