Multi-Tenant & Localization Example

This example demonstrates how to use multi-tenancy combined with localization in a single Next.js app powered by Payload CMS.

Testing the App

The app is setup to support different custom domains. Each domain will be parsed to identify the correct tenant and load the relevant localized content.

How It Works

Next.js Rewrites

Next.js rewrites allows the tenant from the request's host header to be extracted and transformed internally.

App Directory Structure

The app directory matches this structure with nested folders:/app/[tenant]/[locale]/[...slug]

Localized Content

The tenant and locale params are used in the page component to fetch and render the correct localized tenant content.

Features

  • Multi-tenant architecture with domain-based routing
  • Full localization support (EN, FR, PT, ES)
  • Type-safe content management with Payload CMS
  • Modern Next.js 15 with App Router

For a detailed breakdown of the code and setup, checkout the full README in the example root folder.