A minimal starter template for 🏝️ TanStack Start.
- React 19 + React Compiler
- TanStack Start + Router + Query
- Tailwind CSS v4 + shadcn/ui
- Drizzle ORM + PostgreSQL
- Better Auth
-
Use this template or clone this repository.
-
Install dependencies:
pnpm install # npm install
-
Create a
.env
file based on.env.example
. -
Push the schema to your database with drizzle-kit:
pnpm db push # npm run db push
-
Run the development server:
pnpm dev # npm run dev
The development server should be now running at http://localhost:3000.
- React Compiler docs, Working Group - React Compiler is still in beta. You can disable it in app.config.ts if you prefer.
- TanStack/router#2863 - TanStack Start is currently in beta and may still undergo major changes.
- shadcn-ui/ui#6714 - We're using the
canary
version of shadcn/ui for Tailwind v4 support.
Better Auth is currently configured for OAuth with GitHub, Google, and Discord, but can be easily modified to use other providers.
If you want to use email/password authentication or change providers, update the auth config and signin page with your own UI. You can use shadcn/ui login blocks or @daveyplate/better-auth-ui as a starting point.
These scripts in package.json use pnpm by default, but you can modify them to use your preferred package manager.
auth:generate
- Regenerate the auth db schema if you've made changes to your Better Auth config.db
- Run drizzle-kit commands. (e.g.pnpm db generate
to generate a migration)ui
- The shadcn/ui CLI. (e.g.pnpm ui add button
to add the button component)format
andlint
- Run Prettier and ESLint.
auth-guard.ts
- Sample middleware for forcing authentication on server functions. (see #5)ThemeToggle.tsx
- A simple component to toggle between light and dark mode. (#7)
Read the hosting docs for information on how to deploy your TanStack Start app.
- nekochan0122/tanstack-boilerplate - A batteries-included TanStack Start boilerplate that inspired some patterns in this template. If you're looking for a more feature-rich starter, check it out!
- AlexGaudon/tanstarter-better-auth for his own better-auth implementation.