A minimal starter template for 🏝️ TanStack Start.
- TanStack Start + Router + Query
- Tailwind CSS + shadcn/ui
- Drizzle ORM + PostgreSQL
- Better Auth with OAuth2 for GitHub, Google, and Discord.
If you're looking for an implementation based on the Lucia Auth guide, check out the
lucia-authbranch.
-
Use this template or clone this repository.
-
Install dependencies:
pnpm install # npm install -
Create a
.envfile based on.env.example. -
In your OAuth2 apps, set the callback/redirect URIs to
http://localhost:3000/api/auth/callback/<provider>(e.g. http://localhost:3000/api/auth/callback/github). -
Push the schema to your database with drizzle-kit:
pnpm db push # npm run db pushhttps://orm.drizzle.team/docs/migrations
-
Run the development server:
pnpm dev # npm run devThe development server should be now running at http://localhost:3000.
-
Configure
app.config.tsfor your preferred deployment target. Read the hosting docs for more information. -
Build the application:
pnpm build # npm run build -
If building for Node, you start the application via:
pnpm start # npm start
- 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.