Skip to main content

Configuration

Genie is configured through environment variables at build or start time, and the web frontend can also be configured at load time through a runtime config script. This page lists every setting by component.

How the frontend reads its configuration​

The frontend (apps/standalone) resolves each setting in this order:

  1. Runtime config. index.html loads /genie-runtime-config.js before the app. That script sets window.__GENIE_RUNTIME_CONFIG__. A non-empty value there wins.
  2. Build-time variable. Vite reads .env files in apps/standalone and the process environment. Each setting can be given with either the VITE_ or the NEXT_PUBLIC_ prefix; if both are set, VITE_ wins. The values are baked into the bundle at build time (or when the dev server starts).
  3. Code default.

The NEXT_PUBLIC_ prefix is a leftover from an earlier Next.js setup; the app is built with Vite.

The shipped public/genie-runtime-config.js only creates an empty object:

window.__GENIE_RUNTIME_CONFIG__ = window.__GENIE_RUNTIME_CONFIG__ || {};

A deployment can replace that file to change configuration without rebuilding. The AWS CDK stack writes its own version (see Cloud deployment values).

Frontend settings​

SettingBuild variable (after the VITE_ or NEXT_PUBLIC_ prefix)Runtime keyDefault
Backend WebSocket URLGENIE_BACKEND_URLbackendUrlEmpty. The app then uses same-origin /ws when the backend mode is same-origin or when it runs inside Electron, and ws://localhost:8787/ws otherwise.
Backend modeGENIE_BACKEND_MODEbackendModecloud when Vite runs in web mode; otherwise empty
Project API URLGENIE_CLOUD_API_URLcloudApiUrlIn web mode: /api/cloud on the dev server, http://localhost:8790 in a build. Otherwise empty, which means "use the backend's HTTP URL".
Assistant enabledGENIE_ASSISTANT_ENABLEDassistantEnabledtrue for the desktop renderer build; false for every other build
Sign-in requiredGENIE_AUTH_REQUIREDauthRequiredfalse
AWS regionGENIE_AWS_REGIONawsRegionEmpty
Cognito user pool idGENIE_USER_POOL_IDuserPoolIdEmpty
Cognito app client idGENIE_USER_POOL_CLIENT_IDuserPoolClientIdEmpty
App targetDerived, see belowappTargetlocal

Boolean settings accept the strings true and false (the runtime config also accepts JSON booleans).

The backend HTTP base URL is derived from the WebSocket URL: ws: becomes http:, wss: becomes https:, and a trailing /ws is removed.

Example: run the local web app with the assistant on and a backend on another port.

VITE_GENIE_ASSISTANT_ENABLED=true \
VITE_GENIE_BACKEND_URL=ws://localhost:9787/ws \
pnpm --filter standalone dev

App targets​

The app target is set by the build, not by a variable of its own:

App targetHow it is selectedEffect
desktopGENIE_STANDALONE_TARGET=desktop vite build --mode desktop (the build:desktop-renderer script)Assistant on by default; output goes to apps/standalone/.next-desktop, which the Electron app serves
webVite --mode web (pnpm dev:web, pnpm build, pnpm build:web)Backend mode defaults to cloud; project API defaults to the cloud project API; assistant off by default
localAny other mode (pnpm dev, pnpm --filter standalone dev)Backend at ws://localhost:8787/ws serves both chat and project data; assistant off unless enabled

Vite builds always set a target. Only when no valid target is configured does the code fall back to treating a page running inside Electron (where the preload script exposes window.genieDesktop.target === "electron") as desktop.

The project API URL is resolved separately from the backend URL: a configured cloudApiUrl wins; with the web target and nothing configured it falls back to http://127.0.0.1:8790; otherwise project data goes to the backend's HTTP URL.

Backend modes​

Backend modeEffect
UnsetChat connects to ws://localhost:8787/ws (or the configured URL). Project data goes to the same backend unless a project API URL is set.
same-originChat connects to /ws on the page's own origin (wss: on HTTPS pages). Use this when the backend serves the built frontend through GENIE_STATIC_ROOT.
staticRead at build time only. The build contains only the public browser (/ and /browser/:genomeId, rendered by the native browser packages for hg38 and hg19), read-only shared projects (/shared/:shareId) and developer pages. There are no project or assistant routes.
cloudDefault for web builds. Cloud behaviour comes from the web app target and the project API URL.

What each configuration enables​

ConfigurationProject dataAssistantSign-inShare links
Desktop appEmbedded local backendOn when the Codex CLI is foundNoneNo: the dialog shows "Sharing settings could not be loaded."
Local web (pnpm dev)Local backend on :8787Only with VITE_GENIE_ASSISTANT_ENABLED=trueNoneNo: the local backend has no sharing routes
Web, cloud mode (pnpm dev:web)Cloud project API (genie-local-cloud in development)OffOnly when authRequired is trueYes
Hosted cloud build (CDK)Lambda project API, DynamoDB, S3OffRequired (Cognito)Yes
Static buildNone (public browser only)OffNoneOpens /shared/:shareId links

The cloud project API does not serve models or chat: its /models route answers 404 with "Assistant models are not available from the cloud project API." Assistant sessions need the local backend and the Codex CLI.

Backend​

The backend (apps/backend, built on packages/backend-core) reads these variables when it starts.

VariableDefaultPurpose
PORT8787HTTP and WebSocket port
HOST127.0.0.1Bind address
GENIE_SESSION_DATA_ROOTgenie/session-dataFolder for projects, sessions, assets, results and logs
GENIE_RESOURCE_ROOTThe genie/ repository rootRoot for bundled resources the backend reads
GENIE_STATIC_ROOTUnsetIf set, the backend serves this folder (a built frontend) and answers HTML requests for app routes with the frontend's index.html
GENIE_CODEX_COMMANDcodexCommand used to start <command> app-server
GENIE_CLOUD_API_URLUnsetIf set, the backend mirrors project browser state to a cloud project API and reads it back before genome tools run

The backend sends Access-Control-Allow-Origin: * and has no authentication. Keep it bound to 127.0.0.1.

Desktop app​

VariableDefaultPurpose
GENIE_CODEX_COMMANDDiscoveredPath or command name of the Codex CLI. Without it the app checks /opt/homebrew/bin/codex, /usr/local/bin/codex, then a login shell.
GENIE_CLOUD_API_URLUnsetPassed to the embedded backend
GENIE_DESKTOP_LOG_PATH/tmp/genie-desktop-runtime.logStartup log file

The embedded backend always binds 127.0.0.1 on a random free port and stores data in session-data/ under Electron's user-data folder.

Local cloud simulator​

genie-local-cloud is a separate checkout next to genie/.

VariableDefaultPurpose
PORT or GENIE_LOCAL_CLOUD_PORT8790Listen port
HOST or GENIE_LOCAL_CLOUD_HOSTlocalhostBind address
GENIE_LOCAL_CLOUD_DATA_ROOTgenie-local-cloud/.local-cloudStorage folder (dynamodb/single-table.json, s3/objects/)
GENIE_LOCAL_CLOUD_LATENCY_MS0Fixed delay added to every non-preflight request
GENIE_LOCAL_CLOUD_LATENCY_JITTER_MS0Extra random delay of 0 to N ms

pnpm dev:local-cloud:latency and pnpm dev:web-cloud set the latency to 800 ms with 400 ms of jitter.

Cloud deployment values​

The CDK app in infra/aws-cdk takes these inputs:

InputKindDefault
appNameCDK contextgenie-dev (prefix for resource names)
stackNameCDK contextGenieDevCloudStack
removalPolicyCDK contextretain (destroy deletes data with the stack)
webDistPathCDK contextapps/standalone/dist
CDK_DEFAULT_ACCOUNT, CDK_DEFAULT_REGIONEnvironmentRegion us-east-1 if unset

At deploy time the stack writes this runtime config to the web bucket as genie-runtime-config.js:

window.__GENIE_RUNTIME_CONFIG__ = {
"appTarget": "web",
"backendMode": "cloud",
"assistantEnabled": "false",
"authRequired": "true",
"awsRegion": "<stack region>",
"cloudApiUrl": "<HTTP API URL>",
"userPoolId": "<Cognito user pool id>",
"userPoolClientId": "<Cognito app client id>"
};

Other variables​

VariableUsed byPurpose
TEST_PORTapps/backend/integration-server.jsPort for the backend smoke test (default 8790, the same as the local cloud simulator; set another port if the simulator is running)
GENIE_AC_NETWORKpackages/backend-core testsSet to 1 to run the acceptance tests that fetch live public files
EG_REACT_FRONTEND_ROOT@genie/genome-catalog generatorPath to the eg-react frontend folder used to regenerate the genome catalog
DOCS_SITE_URL, DOCS_BASE_URLapps/docs buildSite URL and base path of this documentation site
DOCS_TEST_PORTapps/docs Playwright suitePort for the served docs build (default 3101)

Ports​

PortServiceNotes
8787Genie backend (HTTP and WebSocket /ws)PORT
3000Vite dev server for apps/standaloneMoves to the next free port if taken
8790genie-local-cloud project APIAlso the default TEST_PORT for the backend smoke test
RandomDesktop app's embedded backendBound to 127.0.0.1
3100Docs dev serverpnpm --filter genie-docs dev
3101Docs static server and Playwright testspnpm --filter genie-docs serve