Summary: The 7Mind marketing website (www.7mind.de and the other country domains): a Next.js 16 static export on Cloudflare Pages, content from Storyblok. It replaced the Nuxt site nuxt-website in summer 2026; login and checkout now hand off to frontend-public-pages on app.7mind.de. Sources: direct code inspection (README.md, DEPLOY.md, MIGRATION.md, functions/_middleware.ts, lib/api/, lib/auth/tokens.ts, .github/workflows/ci.yml), git log; Slack 7m_product-team-public. 2026-11-09: re-checked against origin/main (b54ed4c): functions/_middleware.ts, lib/checkout/redirect.ts, lib/i18n/locales.ts, lib/env/host.ts, .env.example, docs/moved-to-public-pages.md, package.json; live curl of www.7mind.app, www.6mind.de, next.6mind.de Last updated: 2026-11-09


Purpose

All public, SEO-relevant 7Mind web pages: landing pages, B2B and campaign pages, legal pages, magazin, podcast, wissen, and the /krankenkasse/<course>/<insurance> prevention pages. It also hosts the account page, insurance and partner activation pages, and Mondia redeem pages. 7Sleep was dropped in the port.

GitHub: sevenmind/website-next-js. Note: a local folder named website-next-js without git metadata may exist next to the real checkout; it is a stale copy, use the git repo.

Stack

  • Next.js 16 (Pages Router) with output: 'export', React 19, TypeScript, Node 22, Yarn 1 (pinned via packageManager)
  • Storyblok as CMS (see storyblok-cms); Zustand stores; design tokens built from tokens/7mind/*.json
  • Vitest and ESLint in CI, Playwright e2e locally

Key Files / Entry Points

  • MIGRATION.md — Nuxt to Next.js decisions and milestone log (the M15 status is stale; all domains are live)
  • DEPLOY.md — Cloudflare Pages config and build output (some details are stale, for example it names the catch-all [[...slug]].tsx and says trailingSlash: true; next.config.ts has trailingSlash: false)
  • functions/_middleware.ts — Cloudflare Pages Function: host to locale folder routing, robots.txt per host, the /en to 7mind.app 301s, and the MOVED_TO_APP 302s that send the 6 login slugs and the 6 password-reset slugs to app.<domain>
  • pages/[locale]/[...slug].tsx and pages/[locale]/index.tsx — Storyblok catch-all and home page
  • lib/checkout/redirect.ts — builds the checkout hand-off to app.<domain>/signup (see Integration Points)
  • components/checkout/CheckoutOverlay.tsx — turns an inbound ?buy= link into the same hand-off
  • lib/api/routes.ts, lib/api/client.ts — calls to magic.7mind.* (the legacy gateway)
  • lib/api/gateway.ts — calls to the Gymondo APIs on app.7mind.* (subscription cancel and reactivate, voucher validation)
  • lib/auth/tokens.ts, lib/auth/cookieDomain.ts — shares the OAuth tokens issued by public-pages via parent-domain cookies
  • lib/appDomain.ts — derives the app.<domain> origin per host and builds the login and reset-password URLs
  • lib/env/host.ts — decides production vs staging from the live hostname
  • docs/moved-to-public-pages.md — which components became unreachable when login and checkout moved

Deployment

  • Cloudflare Pages, production branch main, build yarn build, output out/ (several thousand HTML files). PR previews come from Cloudflare Pages.
  • One build serves staging and production. Anything that must differ (Chargebee site and SKU mapping, Sentry environment) is resolved at runtime from the hostname in lib/env/host.ts.
  • Production hosts, one locale each: www.7mind.de (de), www.7mind.app (us), www.7mind.fr, www.7mind.it, www.7mind.es, www.7mind.ca, www.7mind.co.uk (uk). All were on Pages by 2026-08-18.
  • The en locale is not built. /en and /en/* on any host 301 to www.7mind.app (the US content, locale us). nl has no domain; Dutch locale-prefixed paths 301 to the 7mind.app home.
  • Staging hosts: www.6mind.de (paired with app.6mind.de), next.6mind.* and next.7mind.*. They sit behind Cloudflare Access, so a browser needs a Cloudflare Access login.
  • A separate Pages project from the same repo serves Storyblok preview (yarn build:preview, PREVIEW_SPA=1). See storyblok-cms.
  • Required build env: NEXT_PUBLIC_STORYBLOK_TOKEN, NEXT_PUBLIC_BACKEND_URL, VOUCHER_SEED_ORIGIN, NPM_TOKEN (empty string). Analytics need NEXT_PUBLIC_SENTRY_DSN, NEXT_PUBLIC_GTM_ID and NEXT_PUBLIC_VWO_ACCOUNT_ID; without them that tool is simply off for the build. The full list is in .env.example.
  • .github/workflows/ci.yml runs only Vitest and ESLint; the build itself is validated by the Pages preview.

Dependencies

External services: Storyblok, Cloudflare Pages (static hosting plus Pages Functions), CookieFirst (consent), Sentry (@sentry/react), Google Tag Manager (loaded from data.7mind.de after consent), VWO (A/B testing, since 2026-10-15), ConfigCat (feature flags), Amplitude, reCAPTCHA, Braze and Mailchimp (newsletter and B2B forms, called from functions/newsletter_signup.ts and functions/mailchimp.ts), Zendesk. Internal: function-sevenmind-legacy-gateway on magic.7mind.* for identity, subscription status, insurance activations and Mondia; Gymondo APIs on app.7mind.* (see gymondo-platform); frontend-public-pages for login, signup, password reset and checkout.

Integration Points

  • Login: the login slugs 302 at the edge to app.<domain>/login. A legacy ?redirect= becomes ?fw=<absolute url>, the return parameter public-pages reads. In-app login prompts use goToLogin() in lib/appDomain.ts. Users come back with shared token cookies. See gymondo-sso-auth.
  • Checkout: there is no checkout page here. A product CTA click goes to app.<domain>/signup?article_number=<id>, plus voucher=<code> and channel_id=<id> when present (lib/checkout/redirect.ts). article_number is the Chargebee item-price id, mapped from the old Fastspring-style SKU in lib/checkout/constants.ts. Inbound ?buy=<sku>&code=<code> links (marketing e-mails, print) still work through CheckoutOverlay.
  • /me/reset-password stays on this site because reset e-mails already in inboxes link to it.
  • www.7mind.de/web-app is where the retired web player (sunset 2026-07-31) redirects
  • Some routes in lib/api/routes.ts are no longer served by the gateway: /prevention/certificates, /monetization/chargebee/self_serve_portal/session, /monetization/gift/claim. Gift purchase pages were retired on 2026-09-24

Conventions

  • See locale-aware-slugs-static-export and static-export-i18n-catalogue for the two non-obvious patterns of the static export.
  • Every page lives under pages/[locale]/; the middleware hides the locale prefix from the URL bar.
  • New hosts must be added in several places that cannot import each other: HOST_TO_LOCALE and PRODUCTION_HOSTS in functions/_middleware.ts, HOST_TO_BACKEND in lib/api/client.ts, and lib/auth/cookieDomain.ts.
  • A staging host whose derived app.<domain> would point at production must set APP_ORIGIN / NEXT_PUBLIC_APP_ORIGIN, otherwise links mix staging and production.
  • Token cookie names and encoding must match frontend-core exactly; a mismatch silently splits the session.
  • Login, signup and checkout components (CheckoutAuth, LoginForm, SignupForm and others) are still in the repo but unreachable. Do not fix bugs there; the flows live in frontend-public-pages.

Agent Change Log

2026-10-06 — note created during the wiki update for the Gymondo backend migration 2026-11-09 — audit fixes: checkout hand-off is a CTA redirect, not a middleware 302; catch-all filename; 7mind.app host, en sunset and staging hosts; missing external services