Skip to main content

Configuration

The console is a static bundle, so "configuration" lives in four places, each read at a different time:

WhereRead whenControls
/config.json (src/runtime-config.ts)in the browser, before the app mountsapiOrigin: where every API call goes
vite.config.tsat vite build / vite dev startwhere each Module Federation remote is loaded from, shared singletons, dev port
nginx.confby the container's nginxlisten port, /healthz, cache headers, SPA fallback
charts/warehouse-console/values.yamlat helm install/upgraderuntimeConfig.apiOrigin, Service port, probes, replicas, security context

Build-time environment variables​

There are none. The code reads no VITE_* key and no custom import.meta.env value; endpoints are deliberately not baked into the image. The only import.meta.env reads are Vite built-ins:

KeyRead inEffect
import.meta.env.PRODsrc/config.ts (lines 219, 227, 234)true in a vite build bundle: a missing apiOrigin throws window.__WAREHOUSE_CONFIG__.apiOrigin is required in production instead of falling back to developer ports
import.meta.env.DEVsrc/shell/RemoteBoundary.tsx (line 69)true under npm run dev: a remote's error card appends the error message (This module is unavailable right now: <message>); production shows only This module is unavailable right now.

The one process.env read in the repo is a test script knob, not app configuration: scripts/verify-dashboards.cjs writes its screenshots to SHOT_DIR (default /tmp/warehouse-console-dashboards).

Runtime configuration: /config.json​

src/main.tsx calls loadRuntimeConfig() (src/runtime-config.ts) before it dynamically imports ./App, so the config exists before any module that reads it is evaluated. The loader fetches /config.json with cache: "no-store", validates it and publishes the result on window.__WAREHOUSE_CONFIG__, which every federated remote also reads.

{ "apiOrigin": "http://localhost:8000" }
FieldTypeRequiredMeaning
apiOriginstringyesKong's origin (scheme + host + port only). Every context API is then addressed as <apiOrigin>/api/<context>. A trailing slash is normalised away (new URL(...).origin).

Validation is fail-fast; on any failure the shell renders the plain text warehouse-console failed to start: <message> in #root and logs warehouse-console failed to start to the console. The messages, in the order they are checked:

ConditionMessage
HTTP status not 2xxUnable to load runtime configuration (HTTP <status>)
Content-Type does not contain jsonRuntime configuration must be JSON, received "<content-type>" — /config.json is probably missing and nginx served the SPA fallback
body is not an objectRuntime configuration must be an object
apiOrigin missing, not a string, or blankRuntime configuration apiOrigin must be a non-empty string
not parseable by new URL()Runtime configuration apiOrigin must be an absolute URL
scheme other than http:/https:Runtime configuration apiOrigin must use HTTP or HTTPS
carries a username, password, path other than /, query or fragmentRuntime configuration apiOrigin must contain only an origin

The repo does not commit a config.json; .gitignore lists public/config.json, so create it locally (see Getting started) without risk of staging it.

URLs derived from apiOrigin​

src/config.ts resolves these once, at module load:

ConstantProduction valueUsed by
SERVICE_BASE_URL.<context><apiOrigin>/api/<context> for order-management, inventory-storage, wes-work-planning, fulfillment-execution, workforce-management, facility-layoutthe Contexts launchpad badges
REPORTS_BASE_URL.<context><apiOrigin>/api/<context> for the six above plus labor-performance, process-path-management, network-fulfillmentthe /reports/:context Bounded Context Report screens (the screen appends /reports/...)
BFF_BASE_URL<apiOrigin>/api/warehouse-ops-agentFloor (/daily-brief), Order Lifecycle, WMS/WES dashboards
CONSOLE_REPORTS_URL.wms / .wes<BFF_BASE_URL>/console/reports/wms / /wesWMS and WES dashboards

When window.__WAREHOUSE_CONFIG__ has no apiOrigin and the bundle is not a production build, config.ts falls back to fixed developer ports. In the running app this branch is not reached, because main.tsx refuses to mount without a valid config.json; it is what unit tests (which import config.ts without the bootstrap) resolve against.

FallbackURL
order-management / inventory-storage / wes-work-planning / fulfillment-execution / workforce-management / facility-layout APIhttp://localhost:8086 / 8082 / 8083 / 8084 / 8085 / 8081
reports readers: facility-layout, inventory-storage, wes-work-planning, fulfillment-execution, workforce-management, order-management, labor-performance, process-path-management, network-fulfillmenthttp://localhost:8101 … 8109, in that order
BFF (warehouse-ops-agent)http://localhost:8096

Module Federation remotes (vite.config.ts)​

remoteEntry(context, devPort) picks each remote's entry from the command line: when process.argv contains build it is /mfes/<context>/remoteEntry.js (same origin as the shell, served by the Nginx web gateway); otherwise it is http://localhost:<devPort>/remoteEntry.js. Remote discovery is therefore static: the list is compiled into the shell, and adding a remote means a new entry here plus a route in src/App.tsx.

Remote keyContainer nameGateway pathDev portShell route
order_mgmt_mfeorder_mgmt_mfe/mfes/order-management/5181/order-management/*
inventory_mfeinventory_mfe/mfes/inventory-storage/5182/inventory/*
planning_mfeplanning_mfe/mfes/wes-work-planning/5183/planning/*
fulfillment_mfefulfillment_mfe/mfes/fulfillment-execution/5184/fulfillment/*
workforce_mfeworkforce_mfe/mfes/workforce-management/5185/workforce/*
facility_mfefacility_mfe/mfes/facility-layout/5186/facility/*
labor_mfelabor_mfe/mfes/labor-performance/5187/labor/*
network_fulfillment_mfenetfulfil_mfe/mfes/network-fulfillment/5188/network-fulfillment/*
process_path_mfeprocess_path_mfe/mfes/process-path-management/5189/process-path/*
capacity_mfecapacity_mfe/mfes/warehouse-planning/5190/capacity/*
productmaster_mfeproductmaster_mfe/mfes/product-master/5191/product-master/*
nip_mfenip_mfe/mfes/network-inventory-planning/5192/network-inventory/*
inbound_mfeinbound_mfe/mfes/inbound-receiving/5193/inbound-receiving/*
slotting_mfeslotting_mfe/mfes/slotting-optimization/5194/slotting/*
replenishment_mfereplenishment_mfe/mfes/pick-face-replenishment/5196/pick-face-replenishment/*
task_interleaving_mfetask_interleaving_mfe/mfes/task-interleaving/5197/task-interleaving/*
returns_mfereturns_mfe/mfes/returns-processing/4010/returns-processing/*
exceptions_mfeexceptions_mfe/mfes/exception-management/4011/exception-management/*

Note network_fulfillment_mfe: the shell imports it under that key, but the remote's federation container is named netfulfil_mfe. The last two ports sit off the 51xx ladder on purpose: every 5181..5197 slot was taken when those remotes landed, so their repos pinned 4010/4011 as free.

Other federation settings:

SettingValueWhy
namewarehouse_consolehost container name
shareStrategyloaded-firstkeeps the shell's already-loaded React for every singleton; version-first let a remote with a newer React win and produced Cannot read properties of null (reading 'useRef') and a blank console
sharedreact ^19.2.8, react-dom ^19.2.8, react-router-dom ^7.18.3, @warehouse/ui-kit — all singleton: trueone instance across shell and remotes
base/the shell is served at the gateway root
server.port / preview.port5173, strictPort: true, cors: truedev and preview port
build.target / build.modulePreloadesnext / false

Nginx (nginx.conf)​

The image's nginx (nginxinc/nginx-unprivileged) listens on 8080; it serves only the shell and never proxies to a remote or an API.

LocationBehaviourCache-Control
= /healthzreturns 200 ok (text/plain), access log off—
= /config.jsonserves the mounted file; 404 if absent (never the SPA fallback)no-store
= /index.htmlentry documentno-cache
/assets/hashed bundle assets; 404 if absentpublic, max-age=31536000, immutable
/try_files $uri $uri/ /index.html — unknown paths render the app's own Page-not-found screen—

Helm chart values (charts/warehouse-console/values.yaml)​

KeyDefaultMeaning
runtimeConfig.enabledtruerender the <fullname>-runtime-config ConfigMap and mount it at /usr/share/nginx/html/config.json (subPath)
runtimeConfig.apiOriginhttp://localhost:8000written into config.json; the template fails (required) when empty and enabled is true
replicaCount1ignored when autoscaling.enabled
image.repository / image.tag / image.pullPolicyghcr.io/iqvo/warehouse-console / "" (falls back to Chart.appVersion, 0.1.0) / IfNotPresentcontainer image
service.type / service.port / service.targetPortClusterIP / 80 / 8080the Service listens on 80 and targets the container's http port 8080
ingress.enabledfalseoptional Ingress (warehouse-console.local, path /)
autoscaling.enabled / minReplicas / maxReplicas / targetCPUUtilizationPercentagefalse / 1 / 5 / 80HPA
livenessProbeGET /healthz on http, delay 5 s, period 10 s
readinessProbeGET /healthz on http, delay 3 s, period 5 s
resourcesrequests 100m / 128Mi, limits 500m / 256Mi
podSecurityContextrunAsNonRoot: true, runAsUser: 101, fsGroup: 101nginx-unprivileged's uid
securityContextreadOnlyRootFilesystem: true, allowPrivilegeEscalation: false, drop ALLnginx writes only to the emptyDir volumes at /var/cache/nginx, /var/run, /tmp
serviceAccount.createtrue
podAnnotations, podLabels, nodeSelector, tolerations, affinity, imagePullSecrets, nameOverride, fullnameOverrideemptystandard

The Deployment carries a checksum/runtime-config annotation computed from the ConfigMap template, so changing apiOrigin rolls the pods (kubelet does not live-update a subPath mount).

The chart defaults image.repository to ghcr.io/iqvo/warehouse-console, the name CI publishes (src/packaging.test.ts fails if the two diverge). image.tag still defaults to Chart.appVersion; set it to a published tag (latest, <short-sha> or vX.Y.Z). See the Runbook.