Introduction to TanStack Start
TanStack Start is a modern, type-safe, full-stack React framework built on top of TanStack Router. It provides SSR, streaming, server functions, API routes, bundling, and more—all powered by Vite and ready to deploy to your favorite hosting provider.What is TanStack Start?
TanStack Start combines the best of client-side and server-side rendering, giving you a complete solution for building modern web applications. It’s designed to be:- Type-Safe: Full TypeScript support with end-to-end type safety from server to client
- Client-First: Built with a client-first philosophy while providing powerful server capabilities
- Fast: Powered by Vite for lightning-fast development and optimized production builds
- Flexible: Deploy anywhere—Vercel, Netlify, Cloudflare, or your own Node.js server
Built on TanStack Router
Start is not a separate framework—it’s an extension of TanStack Router that adds server-side capabilities. This means you get all the powerful features of TanStack Router:- File-based routing with automatic route generation
- Type-safe navigation with validated search params and path params
- Built-in data loading with suspense support
- Code splitting and lazy loading out of the box
- Powerful devtools for debugging routes and state
- Server-side rendering (SSR) with streaming support
- Server functions for type-safe client-server communication
- API routes for building REST endpoints
- Middleware support for authentication, logging, and more
- Automatic code splitting between client and server code
Key Features
Server Functions
Write type-safe server-side functions that can be called directly from your client code:API Routes
Create REST API endpoints alongside your pages:Server-Side Rendering
All pages are server-rendered by default, with automatic hydration on the client:Streaming
Stream data to the client as it becomes available:How It Works
TanStack Start uses Vite as its build tool and development server. The@tanstack/react-start/plugin/vite plugin handles:
- Route Generation: Automatically generates route definitions from your file structure
- Code Splitting: Separates client and server code into appropriate bundles
- Server Entry: Creates the server entry point for handling SSR and API requests
- Type Generation: Generates TypeScript types for type-safe routing
When to Use TanStack Start
TanStack Start is ideal for:- Full-stack React applications that need both client and server capabilities
- Projects that require server-side rendering for SEO or performance
- Applications that need type-safe communication between client and server
- Teams that want a modern, flexible framework without framework lock-in