Skip to content
VercelLogotypeVercelLogotype
LoginSign Up

Platforms Starter Kit

Next.js template for building multi-tenant applications with the App Router and Redis.

DeployView Demo

Next.js Multi-Tenant Example

A production-ready example of a multi-tenant application built with Next.js 16, featuring custom subdomains for each tenant.

Features

  • ✅ Custom subdomain routing with Next.js proxy
  • ✅ Tenant-specific content and pages
  • ✅ Shared components and layouts across tenants
  • ✅ Redis for tenant data storage
  • ✅ Admin interface for managing tenants
  • ✅ Emoji support for tenant branding
  • ✅ Support for local development with subdomains
  • ✅ Compatible with Vercel preview deployments

Tech Stack

  • Next.js 16 with App Router
  • React 19
  • Upstash Redis for data storage
  • Tailwind 4 for styling
  • shadcn/ui for the design system

Getting Started

Prerequisites

  • Node.js 20.9.0 or later
  • pnpm (recommended) or npm/yarn
  • Upstash Redis account (for production)

Installation

  1. Clone the repository:

    git clone https://github.com/vercel/platforms.git
    cd platforms
  2. Install dependencies:

    pnpm install
  3. Set up environment variables: Create a .env.local file in the root directory with:

    KV_REST_API_URL=your_redis_url
    KV_REST_API_TOKEN=your_redis_token
  4. Start the development server:

    pnpm dev
  5. Access the application:

    • Main site: http://localhost:3000
    • Admin panel: http://localhost:3000/admin
    • Tenants: http://[tenant-name].localhost:3000

Multi-Tenant Architecture

This application demonstrates a subdomain-based multi-tenant architecture where:

  • Each tenant gets their own subdomain (tenant.yourdomain.com)
  • The proxy handles routing requests to the correct tenant
  • Tenant data is stored in Redis using a subdomain:{name} key pattern
  • The main domain hosts the landing page and admin interface
  • Subdomains are dynamically mapped to tenant-specific content

The proxy (proxy.ts, the Next.js 16 replacement for middleware.ts) intelligently detects subdomains across various environments (local development, production, and Vercel preview deployments).

Deployment

This application is designed to be deployed on Vercel. To deploy:

  1. Push your repository to GitHub
  2. Connect your repository to Vercel
  3. Configure environment variables
  4. Deploy

For custom domains, make sure to:

  1. Add your root domain to Vercel
  2. Set up a wildcard DNS record (*.yourdomain.com) on Vercel
GitHub
Ownervercel
Repositoryplatforms
Use Cases
SaaS
Multi-Tenant Apps
Stack
Next.js
Tailwind
Database
Redis

Related Templates

Nextra: Docs Starter Kit

Simple, powerful and flexible markdown-powered docs site. Built with Next.js.
Nextra: Docs Starter Kit thumbnail

Next.js Enterprise Boilerplate

Enterprise-grade Next.js boilerplate built with Tailwind CSS, Radix UI, TypeScript, ESLint, Prettier, Jest, Playwright, Storybook, etc.
Next.js Enterprise Boilerplate thumbnail

B2B Multi-Tenant Starter Kit

A minimalistic B2B Next.js starter template that includes a landing page, a dashboard, authentication, multi-tenancy, and account settings.
B2B Multi-Tenant Starter Kit thumbnail

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • ConnectNew
  • PassportNew
  • eveNew

Core Platform

  • CI/CD
  • Content Delivery
  • Fluid Compute
  • Observability

Security

  • Platform Security
  • WAF
  • Bot Management
  • Bot ID

Tools

  • Vercel DropNew
  • Vercel Agent
  • Vercel PluginNew
  • Agent Skills
  • Next.js
  • Domains
  • v0

Frameworks

  • eveNew
  • Nuxt
  • SvelteKit
  • Nitro
  • Turborepo
  • Tanstack Start
  • FastAPI
  • xmcp
  • All frameworks

SDKs

  • Vercel SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDKNew
  • Queues SDKNew
  • Streamdown

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
  • Platform Engineers
  • Design Engineers

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Articles
  • Community

Explore

  • Customers
  • Marketplace
  • Templates
  • Partner Finder
  • Vercel + AWS

Company

  • About
  • Careers
  • Press
  • Events
  • Startups
  • Shipped on Vercel
  • Open Source Program
  • Enterprise
  • Pricing
  • Help

Legal & Trust

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA
  • Acceptable Use Policy
  • Legal (all documents)
  • Trust Center
  • Status

Social

  • GitHub
  • X
  • LinkedIn
  • YouTube
  • Instagram
  • VercelVercel
Agent Stack
  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • Passport
  • eve
Core Platform
  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD
Tools
  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains↗
  • v0↗
Learn
  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base
Build
  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
Explore
  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community↗
EnterprisePricing
Contact
Log InSign Up
Dashboard

Products

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • Passport
  • eve

Core Platform

  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD

Tools

  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains↗
  • v0↗
Resources

Learn

  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce

Explore

  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community↗
Enterprise
Pricing
Sign UpLog In
Contact
DeployView Demo

Loading status…

Select a display theme: