
A production-ready example of a multi-tenant application built with Next.js 15, featuring custom subdomains for each tenant.
Clone the repository:
Install dependencies:
Set up environment variables:
Create a .env.local file in the root directory with:
Start the development server:
Access the application:
This application demonstrates a subdomain-based multi-tenant architecture where:
tenant.yourdomain.com)subdomain:{name} key patternThe middleware (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

