Next.js vs TanStack Start for Admin Dashboards: Same App, Built Twice (2026)
I built the same shadcn/ui admin dashboard in Next.js 16 and TanStack Start. Here's how routing, data fetching, server code, auth and deployment compare, with real code from both.
Short answer: Pick Next.js for an admin dashboard if you want the biggest ecosystem, React Server Components and a hosted auth provider that drops right in. Pick TanStack Start if you want fully type-safe routes and search params, explicit server functions, a Vite build and the freedom to deploy anywhere. For a dashboard, the honest surprise is how little changes: about everything below the routing layer stays the same.
I can say that with some confidence because I maintain both versions of the same app. Shadcn Dashboard by Kiranism (7.3k stars) is the Next.js 16 edition, and its TanStack Start edition is the same dashboard rebuilt the TanStack way. Every code sample in this post comes from those two repos.
- Next.js demo: shadcn-dashboard.kiranism.dev
- TanStack Start demo: tanstack-start-dashboard.kiranism.dev
At a glance
| Next.js 16 edition | TanStack Start edition | |
|---|---|---|
| Routing | App Router (app/), folder-based | File-based (routes/), type-safe params and search |
| Data loading | Server Component prefetch + HydrationBoundary | Route loader + loaderDeps |
| Client data | useSuspenseQuery (TanStack Query) | useSuspenseQuery (TanStack Query) |
| Server code | Async functions + route handlers | createServerFn() with Zod validator and middleware |
| Auth | Clerk (hosted, orgs, RBAC, billing) | Encrypted cookie session (iron-session) |
| Route guard | auth.protect() in each page | beforeLoad on the /dashboard layout route |
| URL state | nuqs | nuqs (TanStack Router adapter) |
| Build | Turbopack | Vite 8 |
| Deploy | Vercel, next start, standalone Docker build | Nitro: Vercel, Railway, Render, Node.js; Cloudflare and Netlify via Vite plugins |
| UI, tables, forms | shadcn/ui on Base UI, TanStack Table v9, TanStack Form, Zod 4 | Same |
1. Routing: folders vs typed routes
In Next.js, a dashboard page is a folder with a page.tsx. The products page checks auth, parses the URL with nuqs and renders the listing:
// app/dashboard/product/page.tsx (Next.js)
export default async function Page(props: { searchParams: Promise<SearchParams> }) {
await auth.protect();
const searchParams = await props.searchParams;
searchParamsCache.parse(searchParams);
return (
<PageContainer pageTitle='Products'>
<ProductListingPage />
</PageContainer>
);
}In TanStack Start, the same page is a route object. Its loader, title and component live together, and the route path is checked by the compiler:
// routes/dashboard/product/index.tsx (TanStack Start)
export const Route = createFileRoute('/dashboard/product/')({
head: () => ({ meta: [{ title: 'Dashboard: Products' }] }),
loaderDeps: ({ search }) => search,
loader: ({ context: { queryClient }, deps }) => {
void queryClient.query(productsQueryOptions(getProductFiltersFromSearch(deps))).catch(noop);
},
component: ProductPage
});The difference shows up the day you rename something. Link to /dashboard/product/$productId without a productId in TanStack Router and you get a type error, not a 404 in production. In a dashboard with dozens of pages and deep links from tables, that safety adds up.
Winner for dashboards: TanStack Start, on type safety. Next.js is simpler to read if your team already knows it.
2. Data fetching: two doors into the same cache
This is where the two editions look most different at the top and most alike underneath.
Next.js prefetches on the server inside a Server Component, then hands the cache to the client with HydrationBoundary:
// features/products/components/product-listing.tsx (Next.js)
const queryClient = getQueryClient();
void queryClient.query(productQueries.list(filters)).catch(noop);
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<ProductTable />
</HydrationBoundary>
);TanStack Start does the same job in the route loader you saw above, and @tanstack/react-router-ssr-query handles the hydration for you.
In both editions, the table component is nearly identical. It calls useSuspenseQuery with the same query options the prefetch used, so the server and the client share one cache entry. Search, filters, sorting and pagination live in the URL through nuqs in both.
Winner: a tie. Next.js has an extra wrapper; TanStack Start has an extra config key. The code you write every day is the same.
3. Server code: functions you trust vs functions the framework guards
Both editions have one service.ts per feature, and it's the only file you change to connect a real backend. What's inside is the biggest architectural difference.
In Next.js, the service is plain async functions, and the matching route handlers check auth themselves:
// app/api/products/route.ts (Next.js)
export async function GET(request: NextRequest) {
const { userId } = await auth();
if (!userId) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
// ...read filters from searchParams, query data, return JSON
}In TanStack Start, every service export is a server function. The input is validated with Zod on the server, and auth middleware runs before the handler:
// features/products/api/service.ts (TanStack Start)
export const getProducts = createServerFn({ method: 'GET' })
.middleware([authMiddleware])
.validator(productFiltersSchema)
.handler(({ data }) => fakeProducts.getProducts(data));The handler only runs on the server; the browser gets an RPC stub. Validation, auth and the data call are declared in one chain, so it's hard to forget one. In Next.js you can get the same guarantees, but you write them yourself in every route handler or server action.
Winner for dashboards: TanStack Start. Explicit server functions are easier to audit, and easier for AI coding agents to follow.
4. Auth: hosted provider vs your own session
The Next.js edition uses Clerk, and that buys a lot: sign-in UI, organizations, roles, permission-based navigation and Clerk Billing with a pricing table, all working end to end. The page guard is one line, await auth.protect(), and the proxy only attaches auth context to each request.
The TanStack Start edition uses an encrypted, httpOnly cookie session with iron-session, the same approach as TanStack's own start-basic-auth example. The guard sits once on the layout route:
// routes/dashboard.tsx (TanStack Start)
export const Route = createFileRoute('/dashboard')({
beforeLoad: ({ context, location }) => {
if (!context.user) {
throw redirect({ to: '/auth/sign-in', search: { redirect: location.href } });
}
return { user: context.user };
}
});One important detail: route guards only control navigation. That's why every server function that reads private data also runs authMiddleware. The same rule applies in Next.js, which is why each route handler calls auth() again.
Winner: depends on what you're building. For a B2B SaaS with teams and billing, the Next.js edition gets you there faster. For an internal tool where you own the user table, the TanStack Start edition has no vendor and no extra cost.
5. Build and deployment
Next.js 16 builds with Turbopack. On Vercel it's zero config, and for Docker or a VPS the starter switches to standalone output when you set BUILD_STANDALONE=true.
TanStack Start builds with Vite 8 and deploys through Nitro, the default host in TanStack's own templates. The same build runs on Vercel, Railway, Render or plain Node.js (node .output/server/index.mjs), and Nitro detects the target in each host's CI. For Cloudflare Workers or Netlify, you swap nitro() for their Vite plugin.
Winner: Next.js if you're on Vercel. TanStack Start if you want to keep your hosting options open.
6. What didn't change at all
This is the part most comparisons skip. Moving the dashboard across frameworks, these stayed the same:
- shadcn/ui on Base UI, Tailwind CSS v4 and the theme system
- TanStack Table v9 data tables with URL-synced search, filters, sorting and pagination
- TanStack Form + Zod 4 forms, including multi-step, sheet and dialog patterns
- TanStack Query options per feature (
queries.ts), so cache keys work the same way - Zustand for client state, and the feature-folder structure (
features/products,features/users, and so on)
In practice, the framework touches routing, data loading, server functions and auth. Everything a user actually sees and clicks is portable. That's a good argument for building on standard libraries instead of framework-specific ones.
Which one should you choose?
- Building a B2B SaaS that needs teams, roles and billing soon: the Next.js edition
- Want type-safe routes and search params across a large dashboard: the TanStack Start edition
- Deploying to Vercel and want the most tutorials, libraries and hires: Next.js
- Deploying to Cloudflare, Railway or your own Node server: TanStack Start
- Not sure yet: clone both. They share most of their code, so the cost of switching later is lower than you'd think.
FAQ
Is TanStack Start better than Next.js for admin dashboards?
Not across the board. TanStack Start is better at type-safe routing, explicit server functions and deploying anywhere. Next.js is better at ecosystem size, React Server Components and hosted integrations like Clerk. For most dashboards, the UI, tables and forms are identical in both.
Is TanStack Start production ready in 2026?
Yes, it's used in production, and the TanStack Start edition of Shadcn Dashboard runs on it with React 19, Vite 8 and Nitro. Its ecosystem is smaller than Next.js, so expect fewer ready-made integrations and examples.
Can I use shadcn/ui with TanStack Start?
Yes. shadcn/ui doesn't depend on Next.js. The TanStack Start edition uses the same shadcn/ui components, on Base UI, as the Next.js edition, with Tailwind CSS v4 through the Vite plugin.
Does TanStack Start support server-side rendering?
Yes. TanStack Start renders on the server by default. Route loaders prefetch data on the server, and @tanstack/react-router-ssr-query hydrates the TanStack Query cache on the client.
How do server functions in TanStack Start compare to Next.js server actions?
Both run code on the server and are called like normal functions from the client. TanStack Start's createServerFn() adds a built-in validator and middleware chain, and supports GET as well as POST. With Next.js server actions you add validation and auth checks yourself inside each action.
Can I migrate an admin dashboard from Next.js to TanStack Start?
Yes. Most of the work is in routing, data loaders, server code and auth. Components built on shadcn/ui, TanStack Table, TanStack Form and TanStack Query move over almost unchanged. Comparing the two editions of Shadcn Dashboard side by side is a practical migration reference.
Wrapping up
The framework decision matters less than it used to. What matters more is building the dashboard on standard libraries, so the next decision is cheap too. Both editions are free and MIT licensed, and a GitHub star helps more people find them.
Related reads: Best Free Shadcn Admin Dashboard Templates for Next.js and Best React Admin Frameworks in 2026.