Understand the Multi-Tenant Architecture
mainThis project implements a subdomain-based multi-tenant architecture with the following characteristics:
- Routing: A proxy (
proxy.ts, which replacesmiddleware.tsin Next.js 16) detects subdomains and routes requests to the correct tenant. - Tenant Identification: Each tenant is identified by its subdomain (e.g.,
tenant.yourdomain.com). - Data Storage: Tenant data is stored in Redis using the
subdomain:{name}key pattern. - Domain Structure: The main domain hosts the landing page and admin interface, while subdomains are dynamically mapped to tenant-specific content.
- Environment Support: The proxy is designed to work across local development, production, and Vercel preview deployments.