SHOPin Logo
Skip to main documentation content

Deploy project apps

What this page is for: When you deploy, you need the folder for each app, the command that builds it, and the command that starts it. The tables below are that cheat sheet. It is not a step-by-step hosting tutorial, and security and compliance stay on your side.

The accelerator lives in one Git repo with several apps under apps/. There are no sample Dockerfiles in the repo—you choose your own images and orchestration. Use a Node version that matches engines in the root package.json.

To build everything locally from a fresh clone: npm ci, then npm run build from the repo root (details in the README.md).

Docker and image size: If your build context is the whole repository, a normal npm ci installs packages for every workspace app (presentation, BFF, Storybook, Typedoc, shared packages, …). That is fine on a developer machine, but a production image that only runs the BFF or the storefront does not need the rest. turbo prune copies out a subset of the repo: one app (by package name) plus the workspace packages it actually depends on, so npm ci inside the image stays smaller. Each app table below includes the npx turbo prune … --docker line that matches that app; Turborepo’s Docker guide shows how to plug prune into a typical multi-stage Dockerfile (it is the upstream recipe, not something defined in this site repo).

Environment variables at deploy time

Environment variables · .env.example

VariableBuild (Next)Run (Next)Run (BFF)Secret
NEXT_PUBLIC_BFF_EXTERNAL_URLYesYesNoNo
NEXT_BFF_INTERNAL_URLNoYesNoYes
FRONTEND_URLNoNoYesNo
COMMERCETOOLS_CLIENT_IDNoNoYesYes
COMMERCETOOLS_CLIENT_SECRETNoNoYesYes
COMMERCETOOLS_PROJECT_KEYNoNoYesNo
COMMERCETOOLS_API_URLNoNoYesNo
COMMERCETOOLS_AUTH_URLNoNoYesNo
CONTENTFUL_ACCESS_TOKENNoNoYesYes
CONTENTFUL_PREVIEW_ACCESS_TOKENNoNoYesYes
CONTENTFUL_SPACENoNoYesNo
CONTENTFUL_ENVIRONMENTNoNoYesNo
NEXT_DRAFT_MODE_SECRETNoYesYesYes
CONTENTFUL_MANAGEMENT_ACCESS_TOKENNoNoNoYes
JWT_ENCRYPTION_KEYNoNoYesYes
JWT_SIGNING_KEYNoNoYesYes
CSRF_TOKEN_ENCRYPTION_KEYNoNoYesYes
CSRF_TOKEN_SIGNING_KEYNoNoYesYes
LOG_LEVEL, LOG_PRETTY_PRINTNoYesYesNo
BFF_RATE_LIMIT_ENABLED, BFF_RATE_LIMIT_TTL, BFF_RATE_LIMIT_LIMIT, BFF_RATE_LIMIT_SECURE_TTL, BFF_RATE_LIMIT_SECURE_LIMITNoNoYesNo

Presentation app

ItemValue
App pathapps/presentation/
Package name@apps/presentation
Turborepo commandnpx turbo prune @apps/presentation --docker
Build commandnpx turbo run build --filter=@apps/presentation
Run commandnode apps/presentation/server.js

Next.js uses output: 'standalone'. Copy standalone and static output per Next.js standalone output. Deploy-time URLs: apps/presentation/README.md.

Presentation — Build: files to copy

From paths are relative to the monorepo root in the image (the tree that still has apps/ and package.json after prune/build). To paths are relative to the runtime WORKDIR where node apps/presentation/server.js runs (often the standalone output root).

FromTo
apps/presentation/public/./apps/presentation/public/
apps/presentation/.next/standalone/./
apps/presentation/.next/static/./apps/presentation/.next/static/

Backend for Frontend (BFF)

ItemValue
App pathapps/bff/
Package name@apps/bff
Turborepo commandnpx turbo prune @apps/bff --docker
Build commandnpx turbo run build --filter=@apps/bff
Run commandnode apps/bff/dist/main.js

Routing and data sources: apps/bff/README.md. Integrations overview: integrations/README.md.

BFF — Build: files to copy

From / To relative to monorepo root; WORKDIR = that root for node apps/bff/dist/main.js. Ship the full pruned tree after install + build (not only apps/bff/dist/).

FromTo
Pruned monorepo after npm ci and build./

Storybook

ItemValue
App pathapps/storybook/
Package name@apps/storybook
Turborepo commandnpx turbo prune @apps/storybook @apps/presentation --docker
Build commandnpx turbo run build --filter=@apps/storybook
ServeStatic site from apps/storybook/storybook-static/ (use your own static host or reverse proxy)

Stories depend on @apps/presentation, so the prune command includes both packages.

Storybook — Build: files to copy

If you need both site root and a /storybook/ base path, mirror the static output twice (same From relative to monorepo root):

FromTo
apps/storybook/storybook-static/./
apps/storybook/storybook-static/./storybook/

Typedoc

ItemValue
App pathapps/typedoc/
Package name@apps/typedoc
Turborepo commandnpx turbo prune @apps/typedoc --docker
Build commandnpx turbo run build --filter=@apps/typedoc
ServeStatic site from apps/typedoc/docs/ (use your own static host or reverse proxy)

Typedoc — Build: files to copy

When serving under /typedoc/ as well as root (paths From relative to monorepo root):

FromTo
apps/typedoc/docs/./
apps/typedoc/docs/./typedoc/

Related

Back to How to setup SHOPin