Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Next.js Multi-Tenant Example

A production-ready example of a multi-tenant application built with Next.js 15, featuring custom subdomains for each tenant.
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 middleware
- ✅ Custom subdomain routing with Next.js proxy
- ✅ Tenant-specific content and pages
- ✅ Shared components and layouts across tenants
- ✅ Redis for tenant data storage
Expand All @@ -15,7 +15,7 @@ A production-ready example of a multi-tenant application built with Next.js 15,

## Tech Stack

- [Next.js 15](https://nextjs.org/) with App Router
- [Next.js 16](https://nextjs.org/) with App Router
- [React 19](https://react.dev/)
- [Upstash Redis](https://upstash.com/) for data storage
- [Tailwind 4](https://tailwindcss.com/) for styling
Expand All @@ -25,7 +25,7 @@ A production-ready example of a multi-tenant application built with Next.js 15,

### Prerequisites

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

Expand Down Expand Up @@ -68,12 +68,12 @@ A production-ready example of a multi-tenant application built with Next.js 15,
This application demonstrates a subdomain-based multi-tenant architecture where:

- Each tenant gets their own subdomain (`tenant.yourdomain.com`)
- The middleware handles routing requests to the correct tenant
- 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 middleware (`middleware.ts`) intelligently detects subdomains across various environments (local development, production, and Vercel preview deployments).
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

Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/dev/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"dev": "next dev",
"build": "next build",
"start": "next start"
},
Expand All @@ -17,16 +17,16 @@
"clsx": "^2.1.1",
"frimousse": "^0.2.0",
"lucide-react": "^0.510.0",
"next": "^15.3.6",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"next": "^16.2.10",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"tailwind-merge": "^3.3.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.6",
"@types/node": "^22.15.17",
"@types/react": "^19.1.4",
"@types/react-dom": "^19.1.5",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"tailwindcss": "^4.1.6",
"tw-animate-css": "^1.2.9",
"typescript": "^5.8.3"
Expand Down
Loading