Configuration
Configure the runtime you are using. Compose, a host Rust process, and NestJS do not all read environment values in the same way.
Environment files
Section titled “Environment files”| 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:
test -f frontend/.env || cp frontend/.env.example frontend/.envtest -f backend/.env || touch backend/.envThese are starting files, not production configuration. Keep them and all credentials out of version control.
Docker ports and secrets
Section titled “Docker ports and secrets”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:
MCP_HTTP_ENABLED=false make docker-run-devThe app’s in-process/subprocess MCP use is separate from exposing HTTP MCP. Do not assume disabling the HTTP listener disables AI features.
Host service addresses
Section titled “Host service addresses”For the supplied hybrid data services, the Rust API needs these values in
backend/.env or its environment:
POSTGRES_HOST=localhostPOSTGRES_PORT=5433POSTGRES_NAME=open_tradingPOSTGRES_USER_API=rust_apiPOSTGRES_PASSWORD_API=dev-secret-rust-apiPOSTGRES_SSLMODE=disableThat 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.
Sessions and provider credentials
Section titled “Sessions and provider credentials”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’sfile://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.
Check your changes
Section titled “Check your changes”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.