A modern, full-stack React application built with TanStack Start and deployed on Vercel.
# Install dependencies
bun install
# Start development server
bun dev
# Build for production
bun run build
# Preview production build locally
bun run servebun dev- Start development server on port 3000bun run build- Build the application for productionbun run serve- Preview production build locallybun run codegen- Regenerate GraphQL types from Hygraph schema
This project deploys to Vercel. The build command (bun run build) outputs to .vercel/output/ using the Vercel Build Output API format, which Vercel detects automatically.
Set the following in the Vercel dashboard for each environment (Production, Preview, Development):
| Variable | Description |
|---|---|
VITE_CMS_API |
Hygraph GraphQL endpoint |
VITE_TOKEN |
Hygraph authentication token |
VITE_TITLE_PREFIX |
Optional title prefix (e.g. for staging) |
Pre-configured with the @tailwindcss/vite plugin and CSS variables for theming.
Add accessible components using Shadcn/UI:
bunx shadcn@latest add button
bunx shadcn@latest add cardUses TanStack Router with file-based routing. Routes are automatically generated from files in src/routes/.
Add a new file in ./src/routes/ — TanStack will automatically generate the route boilerplate.
import { Link } from "@tanstack/react-router";
<Link to="/about">About</Link>The root layout lives in src/routes/__root.tsx. Add shared UI there and use <Outlet /> where child routes should render.
Define queries with the graphql() tag and fetch with the CMSRequest utility:
import { graphql } from "@/gql/gql";
import { CMSRequest } from "@/utils/cms-request";
const myQuery = graphql(`
query MyQuery {
...
}
`);
const data = await CMSRequest<MyQuery>(myQuery);After modifying queries, regenerate types:
bun run codegenconst { data } = useSuspenseQuery({
queryKey: ["hygraph", "my-key"],
queryFn: () => CMSRequest<MyQuery>(myQueryDocument),
});Uses Vitest with jsdom and @testing-library/react:
bun run test- TanStack Start - Full-stack React framework with SSR
- React 19 - Latest React with concurrent features
- TypeScript - Strict type checking
- TanStack Router - Type-safe, file-based routing
- TanStack Query - Server state management with SSR integration
- Hygraph - Headless CMS (GraphQL)
- Tailwind CSS v4 - Utility-first CSS with CSS variables
- Shadcn/UI - Accessible component library
- DaisyUI - Tailwind component classes
- Lucide React - Icon set
- Bun - Package manager and runtime
- Vite - Build tool and dev server
- Nitro - Server engine (
@tanstack/nitro-v2-vite-plugin) - Vercel - Hosting and preview deployments