Skip to content

Configuration

Configure the runtime you are using. Compose, a host Rust process, and NestJS do not all read environment values in the same way.

Runtime Configuration entry point
Complete Docker app Compose reads backend/.env and frontend/.env as container environment files
Host Rust API backend/.env, loaded when the API starts from backend/, or exported process variables
Host NestJS frontend/.env when started from frontend/, or its process environment
External MCP client The MCP server entry’s env object or the binary’s process environment

Create local files from the product repository root:

Terminal · preserve existing configuration
test -f frontend/.env || cp frontend/.env.example frontend/.env
test -f backend/.env || touch backend/.env

These are starting files, not production configuration. Keep them and all credentials out of version control.

The app Compose file uses ${VARIABLE} interpolation for the following settings. Supply those through the shell environment or Compose’s project environment configuration.

Setting Development behavior
APP_PORT UI host port, default 8080; not a loopback-only binding
MCP_HTTP_PORT MCP host port, default 8181, bound to 127.0.0.1
MCP_HTTP_ENABLED true starts the HTTP MCP listener; false skips it
POSTGRES_PASSWORD Database administrator password
POSTGRES_PASSWORD_API Rust database role password
POSTGRES_PASSWORD_REST PostgREST database role password
PGRST_JWT_SECRET PostgREST JWT signing secret

To disable HTTP MCP for a local run:

Terminal · app without the HTTP MCP listener
MCP_HTTP_ENABLED=false make docker-run-dev

The app’s in-process/subprocess MCP use is separate from exposing HTTP MCP. Do not assume disabling the HTTP listener disables AI features.

For the supplied hybrid data services, the Rust API needs these values in backend/.env or its environment:

backend/.env · local development only
POSTGRES_HOST=localhost
POSTGRES_PORT=5433
POSTGRES_NAME=open_trading
POSTGRES_USER_API=rust_api
POSTGRES_PASSWORD_API=dev-secret-rust-api
POSTGRES_SSLMODE=disable

That password is the checked-in development default, not a suggested secret. If you changed the SQL service’s password, use the matching value here. POSTGRES_SSLMODE=require requests SSL for a database configured to support it.

Process Setting Local default
Rust API ADDR, PORT localhost, 2000
NestJS RUST_BACKEND_URL http://localhost:2000 outside production
NestJS PGRST_URL http://localhost:2345 outside production
MCP OT_RUST_URL http://localhost:2000
MCP OT_NEST_URL http://localhost:3000
MCP HTTP MCP_ADDR, MCP_PORT localhost, 8181

When services run inside containers, localhost means that container, not the host. The complete app’s entrypoint wires its local services together; do not copy hybrid host ports into that runtime indiscriminately.

  • SESSION_SECRET: replace the development secret before sharing a deployment. Services that validate the same session must agree on the secret.
  • COOKIE_SECURE=true: use for hosted HTTPS. Do not enable secure-only cookies for an ordinary local HTTP workflow.
  • COOKIE_SAME_SITE: review the frontend example before changing it. Electron’s file:// workflow has different requirements from hosted web.
  • OT_NEST_SESSION: optionally shares a Nest session with an MCP client. Treat its cookie or JWT as a credential; see MCP sessions.

AI capabilities also depend on provider configuration and credentials or a reachable local model service. Configure only the provider you intend to use. Never paste a real key into a checked-in client example.

Restart the affected process after changing its environment. Verify the two health endpoints for your runtime, then test the specific feature you changed. A healthy API alone does not validate a provider key or prove that a browser cookie is being sent.

Sources: frontend environment example, backend configuration, Compose.