Pandora Architecture Team

Pandora SPARK 2.0

The micro-frontend platform powering all Pandora web apps

Scaffold a new app in seconds  ·  npx @pandora/create-pandora-react-app@latest

What is SPARK 2.0?

SPARK 2.0 is Pandora's internal platform for building and deploying web applications as independently deployable micro-frontends. It provides a battle-tested boilerplate, a scaffolding CLI, and a shared component ecosystem — so every team starts with the same quality bar, zero boilerplate setup, and full production readiness from day one.

🏗️

Boilerplate

The Architecture Team maintains a single source-of-truth Next.js 16 boilerplate with the full stack pre-configured. Teams never clone it directly.

Scaffolding CLI

create-pandora-app prompts for app type, name, and port — then generates a fully configured project in seconds, published via Azure Artifacts.

🧩

Micro-Frontend Runtime

Module Federation powers CSR-based remote loading between verticals. Each app is independently deployable — no coupled releases.

📦

Shared Packages

Shared components, store context, and utilities live in the @pandora/* scope on Azure Artifacts, consumed by every app.

Four app types

Every SPARK app is one of four types. The CLI scaffolds the right wiring automatically.

🏗️
Host + Remote

Vertical MFE

Owns a set of URL paths (e.g. /collections/*). Acts as both host and remote — loads peer apps at runtime via createInstance() + loadRemote().

🧩
Remote only

Horizontal MFE

Pure remote fragment — no owned URLs. Embedded by verticals at CSR. Never loads other remotes.

📱
Self-contained

Standalone App

Full Next.js app with no Module Federation wiring. Gets the full SPARK tooling stack without MFE complexity.

📦
Library

Shared Package

Reusable TypeScript package published to the @pandora/* scope on Azure Artifacts. Consumed across all app types.

How micro-frontends work

Vertical MFE (Host)

Runs next dev --webpack on its own port. Loads peer remotes at CSR using createInstance() + loadRemote() with ssr: false.

MF Webpack Script

Runs alongside Next.js via concurrently. Builds remote output to public/_next_mf/ — served statically by Next.js from disk.

Remote Manifest

Each remote is reachable at /_next_mf/static/chunks/mf-manifest.json. No separate server needed.

Shared Singletons

react, react-dom, @pandora-ecom/store-context, @pandora-ecom/shared-components — all eager: true.

  • All remote loading is CSR only — no SSR remote hydration
  • Each app has its own AppRouterContext — use NavigationLink for cross-app navigation
  • --webpack flag is required — Turbopack does not support Module Federation
  • Both processes start automatically with pnpm dev — nothing extra to configure

What's included

Next.js 16 + React 19
TypeScript 5.9 (strict)
Tailwind CSS v4
Module Federation
LaunchDarkly
Zod v4 + React Hook Form
T3 Env (build-time validation)
next-intl (EN / FR)
Vitest 4 (unit + browser)
Playwright + Chromatic
ESLint (Antfu + A11y)
Lefthook pre-commit hooks
Commitlint (Conventional)
Knip (unused deps/exports)
Azure DevOps CI/CD
React Compiler (prod)

Common UI packages

Two shared packages live in the @pandora-ecom/* scope on Azure Artifacts. Every SPARK app declares them as peer dependencies — they are also listed as Module Federation shared singletons, so only one instance loads across all remotes at runtime.

@pandora-ecom/shared-components
v1.0.4  ·  Azure Artifacts

The Pandora UI design system — layout shells, navigation primitives, error/loading states, and Module Federation utilities consumed by every app.

Layout
AppHeader Header Footer NavigationSetup
UI Primitives
ErrorBoundary LoadingSkeleton
Module Federation
RemoteLoader
Navigation (sub-path export)
NavigationLink NavigationProvider NavigationContext
Import navigation utilities from @pandora-ecom/shared-components/navigation — each vertical MFE has its own AppRouterContext, so cross-app links must go through NavigationLink.
@pandora-ecom/store-context
v1.0.3  ·  Azure Artifacts

Shared React context for cross-app state — cart, providers, and any global store that must be the same instance across all micro-frontends at runtime.

Providers
CartProvider Providers
Hooks
useCart
Types
CartItem
Must be a MF singleton (eager: true) — all remotes share the same cart state instance. Never bundle separate copies.

Key features

🏴‍☠️
LaunchDarkly — zero round-trips Flags evaluated server-side and bootstrapped into the client. No extra network requests on page load.
🌐
Built-in i18n (EN / FR) next-intl with localePrefix: always. Missing key checks run in CI via i18n-check.
♻️
Validated environment variables All env vars validated at build time in Env.ts. Never read process.env directly.
🛡️
Pre-commit quality gate Lefthook runs lint → typecheck → Knip before every commit. Nothing broken ships.
🚀
React Compiler in production Automatic memoization — no manual useMemo or useCallback needed in app code.
🗺️
Auto-generated sitemap Sitemap with locale alternates generated automatically on every build.
💡
Absolute imports All imports via @/ prefix. No ../../.. paths anywhere in app code.
🔍
Dead-code detection Knip catches unused exports, files, and dependencies on every commit and in CI.

How your team uses SPARK 2.0

Teams never clone this repo. They scaffold a new app from it in four steps.

1

Authenticate with Azure Artifacts

Add the Pandora npm feed to ~/.npmrc and log in with an Azure DevOps PAT (scope: Packaging → Read). One-time setup per machine.

2

Run the CLI

Answer three prompts — app type, name, and port. The CLI generates a fully configured project with the right template overlay applied.

npx @pandora/create-pandora-react-app@latest
3

Install and run

Install dependencies and start the dev server. For MFE app types, both Next.js and the MF webpack script start automatically.

cd <app-name> && pnpm install && pnpm dev
4

Build your features

Everything is pre-wired — i18n, feature flags, env validation, testing, CI pipeline. Just start building.