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

A production-ready example of a multi-tenant application built with Next.js 16, featuring custom subdomains for each tenant.
Clone the repository:
git clone https://github.com/vercel/platforms.gitcd platforms
Install dependencies:
pnpm install
Set up environment variables:
Create a .env.local file in the root directory with:
KV_REST_API_URL=your_redis_urlKV_REST_API_TOKEN=your_redis_token
Start the development server:
pnpm dev
Access the application:
This application demonstrates a subdomain-based multi-tenant architecture where:
tenant.yourdomain.com)subdomain:{name} key patternThe proxy (proxy.ts, the Next.js 16 replacement for middleware.ts) intelligently detects subdomains across various environments (local development, production, and Vercel preview deployments).
This application is designed to be deployed on Vercel. To deploy:
For custom domains, make sure to:
*.yourdomain.com) on Vercel