Headless storefront for the CoreShop enterprise demo, built with Next.js (App Router, server actions), Auth.js and Bootstrap. It talks to CoreShop through the GraphQL API of the CoreShop headless bundle. The component library is documented in Storybook.
- Storefront: https://headless.coreshop.dev
- Storybook: https://storybook.coreshop.dev
- Shop backend: https://enterprise.coreshop.dev
| Variable | Used | Description |
|---|---|---|
API_URL |
runtime (server) | GraphQL endpoint including the API key, https://<shop>/pimcore-graphql-webservices/coreshop?apikey=… |
AUTH_SECRET |
runtime | Auth.js secret (openssl rand -base64 32) |
AUTH_TRUST_HOST |
runtime | true behind a reverse proxy |
API_HOSTNAME |
build | shop host, allowed as next/image remote host |
NEXT_PUBLIC_PIMCORE_BASE_URL |
build | public base URL of the shop, prefixed to Pimcore asset paths |
CODEGEN_SCHEMA_URL |
codegen | GraphQL endpoint for npm run codegen, usually the same as API_URL |
The API key never ends up in the image: it is read from API_URL at runtime and the image is
built without it.
cp .env.example .env.local # fill in the values
npm ci
NODE_TLS_REJECT_UNAUTHORIZED=0 npm run dev # self-signed certificate of the local shopOpen http://localhost:3000.
Regenerates lib/graphql/types.generated.ts from the documents in lib/graphql/query against a
running CoreShop installation:
NODE_TLS_REJECT_UNAUTHORIZED=0 npm run codegennpm run storybook # http://localhost:6006
npm run build-storybook # static build in storybook-static/docker build -t demo-enterprise-nextjs/app .
docker build -t demo-enterprise-nextjs/storybook -f Dockerfile-storybook .
docker run --rm -p 3000:3000 -e API_URL=… -e AUTH_SECRET=… -e AUTH_TRUST_HOST=true demo-enterprise-nextjs/appAPI_HOSTNAME and NEXT_PUBLIC_PIMCORE_BASE_URL are build arguments and default to the public
enterprise demo.
build.yml: builds both images on every push and PR; onmainpushes them toghcr.io/coreshop/demo-enterprise-nextjs/appand…/storybook(tagmain-<sha>) and bumpsheadless_nextjs.image.tag/storybook.image.tagin the enterprise demo manifest via the coreshop GitHub App. The shop host comes from the repository variableSHOP_HOST(defaultenterprise.coreshop.dev).static.yml: lint, build, typecheck and Storybook build on PRs.npm-update.yml: weeklynpm updateas a pull request.