Skip to main content

Tenants, Platforms & Environments

Three independent axes decide what an Archibald build produces and how it behaves. They are easy to conflate, so here is each one's single job.

Platform — what kind of application

A platform is one application built from the codebase — e.g. shop (the SSR web storefront), app (the React Native app), portal (a back-office web app). Platforms are declared in project.platforms in archibald.json; each has its own source tree under src/<platform>/ with client and server halves. The first entry is the default platform — its files are the base every other platform falls back to through file shadowing.

Tenant — which brand or shop variant

A tenant is a variant of the same application — a brand, a B2B vs. B2C shop, a country-specific storefront. Tenants are declared in project.tenants and drive the tenant levels of the shadowing chain: a tenant overrides individual files under …/tenant/{tenant}/ paths and can carry its own configuration block. Since 9.1, both platforms and tenants entries may declare extends for cascading inheritance.

Environment — where it runs

An environment is a deployment stage — typically local, stage, prod. Each environment is a configuration file in the project's environment/ folder, layered on top of common.ts:

/environment
├── common.ts # applies everywhere
├── local.ts
├── stage.ts
└── prod.ts

Environments never change which files are built — they change configuration values (API hosts, credentials, log levels). See Project configuration.

Where they are set

create @archibald prompts for all three when bootstrapping a project ("What are the environments / tenants / platforms for this project?") and writes them into archibald.json and the environment/ folder.

At development time, archibald serve selects one value per axis:

archibald serve -p shop -t netconomy-b2c -e local
FlagSelectsDeclared in
-p, --platformthe platform to buildproject.platforms
-t, --tenantthe tenant whose overrides and config applyproject.tenants
-e, --environmentthe environment config to loadproject.environments / environment/ folder

A build is always the product of all three: platform picks the source tree, tenant picks the overrides within it, environment picks the runtime configuration.