Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Split a single Next.js application by path into multiple applications for faster build times and independent development with Vercel Microfrontends.
Vercel Microfrontends - Next.js Multi-Zones is a reference implementation from the Vercel examples repository that demonstrates how to split a single domain into two independently deployable Next.js applications using the Vercel Microfrontends routing package. This starter uses the Next.js App Router and runs on Vercel's platform, with a live demo available at https://vercel-microfrontends-multi-zones.vercel.app/.
Next.js Multi-Zones Starter is a monorepo containing two separate microfrontends: a marketing application (serving homepage, pricing, and marketing content) and a documentation application (handling all /docs routes). It takes a microfrontends.json routing configuration and the two app codebases as input, and produces a single cohesive website where requests to /docs are dynamically proxied to a separate deployment. The project is authored by Vercel and is part of the public vercel/examples repository, which has over 5,000 stars on GitHub.
apps/marketing/microfrontends.json file maps the docs zone to paths like /docs and /docs/:path*, with local ports for development.PrefetchCrossZoneLinksProvider and a special Link component from @vercel/microfrontends/next/client prefetch and prerender links to other zones.pnpm dev launches the marketing app on port 3000 and the docs app on port 3001, then proxies the docs app through the marketing app on port 3024.turbo.json orchestrates build, lint, typecheck, and checks across all workspace packages.packages/ includes eslint-config-custom and ts-config to keep code style and TypeScript settings consistent between apps.app/ directory structure with Tailwind CSS for styling, and each has its own next.config.ts enhanced by withMicrofrontends() and withVercelToolbar().apps/, update microfrontends.json, add it to the workspace, and configure deployment.cd apps/marketing && pnpm dev to work on just one app during development, or run both together with the transparent proxy.The marketing app acts as the shell and reads microfrontends.json to learn which routes belong to which zone. When a visitor navigates to /docs, Vercel Microfrontends recognizes the route, proxies the request to the documentation app's deployment (or local dev server), and returns the response to the browser. The custom Link component prefetches the target zone to make the transition feel immediate.
Node.js 20.x or later, pnpm 9.4.0 (the recommended package manager), and Git are required. The setup commands are git clone, pnpm install, and pnpm dev.
Yes. The example provides two separate Deploy buttons, and the whole point of the multi-zone architecture is that each microfrontend is deployed independently to Vercel while sharing the same domain through routing.
Routing lives in apps/marketing/microfrontends.json. It declares the applications, their local development ports, fallback URLs, and which path groups (like docs) map to which microfrontend.
Yes. The repository explains a four-step addition workflow: create the new application under apps/, add routing rules to microfrontends.json, include it in the pnpm workspace, and set up its Vercel deployment.
