Skip to content

harshG775/tanstack-start-multi-tenant-example

Repository files navigation

TanStack Start Multi-Tenant Example

A production-ready, hostname-based multi-tenant application built with TanStack Start and React. Demonstrates full-stack architecture for SaaS platforms serving multiple tenants from a single codebase.

Key Features

  • Hostname-based Tenant Resolution – Automatically identify tenants from request hostname
  • Server-Side Rendering (SSR) – Tenant configuration loaded during request lifecycle
  • Type-Safe – Full TypeScript support with router context typing
  • Scalable Architecture – Tenant data injected into router context before hydration

Demo

Tenant One
Tenant 1

Tenant Two
Tenant 2

Tech Stack

  • TanStack Start – Full-stack framework with server functions
  • TanStack Router – Type-safe routing with context
  • React – UI component framework
  • TypeScript – Type safety & developer experience
  • Vite – Lightning-fast build tool

Architecture

Request → Hostname Resolution → Tenant Lookup → Router Context → SSR → Hydrated App

Each tenant receives isolated:

  • Branding & metadata
  • Logo & favicon
  • Configuration

Quick Start

pnpm install
pnpm dev

Visit tenant-1.com.localhost:3000 and tenant-2.com.localhost:3000 to see different tenant branding.

Learn More

See TUTORIAL.md for complete implementation guide.

Skills Demonstrated

✓ Full-Stack Development (Server + Client)
✓ Multi-Tenant Architecture
✓ Server Functions & SSR
✓ Type-Safe Router Context
✓ Express-like Request Handling

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors