Overview
Load data in route loaders and server functions, keep interactivity in client components, and ship the minimum client JavaScript.
Structure
src
src/routes/
__root.tsx
index.tsx
dashboard.tsx
src/server/session.ts
components/ui/
lib/{db,auth}.tsData fetching
routes/dashboard.tsx
export const Route = createFileRoute("/dashboard")({
loader: () => db.session.findMany({ take: 20 }),
component: () => <Table data={Route.useLoaderData()} />,
});Deploy
Deploy to a platform with regional functions; keep marketing routes static and dynamic routes isolated.