Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/amanvarshney01/create-better-t-stack/llms.txt

Use this file to discover all available pages before exploring further.

Create your first project

Get started with Better-T-Stack in three simple steps:
1

Run the CLI

Open your terminal and run:
npx create-better-t-stack@latest my-app
2

Answer the prompts

The CLI will guide you through selecting your stack:
  • Project name: my-app (or your choice)
  • Frontend: Choose your frontend framework (or none for backend-only)
  • Backend: Choose your backend framework (or none for frontend-only)
  • Runtime: Bun, Node.js, or Cloudflare Workers
  • Database: SQLite, PostgreSQL, MySQL, MongoDB, or none
  • ORM: Drizzle, Prisma, Mongoose, or none
  • API: tRPC, oRPC, or none
  • Auth: Better-Auth, Clerk, or none
  • Addons: Turborepo, PWA, Tauri, etc.
  • Examples: Todo app, AI chat, or none
Press Space to select, Enter to confirm, and Ctrl+C to cancel.
3

Start developing

cd my-app
bun run dev  # or npm run dev
Your project is now running!
  • Web app: http://localhost:3000
  • Server API: http://localhost:3000 (if separate backend)

Quick examples

Skip prompts with default stack

Use the --yes flag to skip prompts and use sensible defaults:
npx create-better-t-stack@latest my-app --yes
Default stack:
  • Frontend: TanStack Router
  • Backend: Hono
  • Runtime: Bun
  • Database: SQLite
  • ORM: Drizzle
  • API: tRPC
  • No auth, no examples

Full-stack web app with authentication

npx create-better-t-stack@latest my-webapp \
  --frontend tanstack-router \
  --backend hono \
  --runtime bun \
  --database postgres \
  --orm drizzle \
  --api trpc \
  --auth better-auth \
  --addons turborepo
What you get:
  • Type-safe React frontend with TanStack Router
  • Hono backend API running on Bun
  • PostgreSQL database with Drizzle ORM
  • tRPC for end-to-end type safety
  • Better-Auth for authentication
  • Turborepo monorepo setup

Next.js app with Prisma

npx create-better-t-stack@latest my-nextapp \
  --frontend next \
  --backend self \
  --database postgres \
  --orm prisma \
  --auth better-auth
What you get:
  • Next.js App Router frontend
  • API routes in Next.js (no separate backend)
  • PostgreSQL with Prisma ORM
  • Better-Auth authentication

Cloudflare Workers API

npx create-better-t-stack@latest my-api \
  --frontend none \
  --backend hono \
  --runtime workers \
  --database sqlite \
  --orm drizzle \
  --db-setup d1 \
  --server-deploy cloudflare
What you get:
  • Hono API on Cloudflare Workers
  • D1 (SQLite) database
  • Alchemy deployment configuration
  • Ready to deploy with bun run deploy

Convex backend with Clerk auth

npx create-better-t-stack@latest my-convex \
  --frontend tanstack-router \
  --backend convex \
  --auth clerk
What you get:
  • React frontend with TanStack Router
  • Convex real-time backend
  • Clerk authentication
  • No database setup needed (Convex handles it)

Mobile app (React Native)

npx create-better-t-stack@latest my-mobile \
  --frontend native-uniwind \
  --backend hono \
  --runtime bun \
  --database sqlite \
  --orm drizzle \
  --api trpc \
  --auth better-auth
What you get:
  • Expo React Native app with NativeWind (Tailwind CSS)
  • Shared Hono backend
  • Type-safe API with tRPC
  • Better-Auth authentication

Backend-only API

npx create-better-t-stack@latest my-backend \
  --frontend none \
  --backend express \
  --runtime node \
  --database mysql \
  --orm drizzle
What you get:
  • Express backend on Node.js
  • MySQL database with Drizzle ORM
  • RESTful API structure

Frontend-only app

npx create-better-t-stack@latest my-frontend \
  --frontend next \
  --backend none
What you get:
  • Next.js frontend only
  • No backend or database
  • Perfect for connecting to existing APIs

Monorepo with web + mobile

npx create-better-t-stack@latest my-monorepo \
  --frontend tanstack-router native-uniwind \
  --backend hono \
  --runtime bun \
  --database postgres \
  --orm drizzle \
  --api trpc \
  --addons turborepo
What you get:
  • Web app (TanStack Router)
  • Mobile app (React Native)
  • Shared backend (Hono)
  • Shared database and API
  • Turborepo for monorepo management

With examples included

npx create-better-t-stack@latest my-app \
  --frontend tanstack-router \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --examples todo ai
What you get:
  • Full-stack setup
  • Todo CRUD example
  • AI chat example
  • Learn from working code

Use the visual Stack Builder

Not sure which options to choose? Use the interactive Stack Builder:
npx create-better-t-stack@latest builder
Or visit better-t-stack.dev/new directly. The Stack Builder:
  • Shows all available options
  • Validates compatibility in real-time
  • Generates the exact CLI command
  • Can be bookmarked for reuse

After project creation

Once your project is created, here’s what to do next:
1

Install dependencies

If you skipped auto-install:
cd my-app
bun install  # or npm install, pnpm install
2

Set up your database

If you chose a database:For cloud providers:
  1. Sign up for your provider (Turso, Neon, Supabase, etc.)
  2. Create a database
  3. Add connection string to .env:
    # apps/server/.env
    DATABASE_URL=your-connection-string
    
  4. Apply schema:
    bun run db:push
    
For Docker:
docker compose up -d
bun run db:push
See the Database setup guide for detailed instructions.
3

Configure environment variables

Update .env files as needed:
# apps/web/.env
VITE_SERVER_URL=http://localhost:3000

# apps/server/.env
DATABASE_URL=your-connection-string
CORS_ORIGIN=http://localhost:3000
4

Start development

bun run dev
This starts:
  • Web app (if you chose a frontend)
  • Server API (if you chose a backend)
  • Type checking and hot reload

Understanding the project structure

Your generated project follows a clean monorepo layout:
my-app/
├── apps/
│   ├── web/          # Frontend (if selected)
│   ├── server/       # Backend API (if selected)
│   └── native/       # Mobile app (if selected)
├── packages/
│   ├── api/          # Shared API types (tRPC/oRPC)
│   ├── db/           # Database schema and client
│   ├── auth/         # Auth configuration
│   ├── env/          # Environment variables
│   └── config/       # Shared configs
└── package.json      # Root package.json
See Project structure for details on each directory.

Common next steps

CLI commands

Learn all CLI commands and options

Project structure

Understand the generated project layout

Database setup

Configure your database provider

Examples

Learn from Todo and AI examples

Add command

Add more features after creation

Deployment

Deploy your project to production

Flags cheat sheet

Quick reference for common CLI flags:
  • --frontend: tanstack-router, react-router, tanstack-start, next, nuxt, svelte, solid, native-bare, native-uniwind, native-unistyles, none
  • --backend: hono, express, fastify, elysia, convex, self, none
  • --runtime: bun, node, workers, none
  • --database: sqlite, postgres, mysql, mongodb, none
  • --orm: drizzle, prisma, mongoose, none
  • --api: trpc, orpc, none
  • --auth: better-auth, clerk, none
  • --payments: polar, none
  • --addons: turborepo, pwa, tauri, biome, lefthook, husky, starlight, fumadocs, oxlint, ruler, mcp, opentui, wxt, skills
  • --examples: todo, ai, none
  • --db-setup: turso, neon, supabase, prisma-postgres, planetscale, mongodb-atlas, d1, docker, none
  • --web-deploy: cloudflare, none
  • --server-deploy: cloudflare, none
See the full CLI options reference for all available flags and their descriptions.

Tips

Don’t try to add everything at once. Start with core features, then use the add command to add more addons:
cd my-app
npx create-better-t-stack@latest add --addons pwa tauri
Even if you prefer the CLI, use the Stack Builder to discover which combinations work together and explore available options.
Not all options work together. Check the compatibility guide before creating your project, or use the Stack Builder which enforces compatibility automatically.
Add --examples todo ai to your first project to see working patterns for common use cases. You can always delete them later.
Once you find a stack you like, save the command or bookmark the Stack Builder URL for future projects.

Need help?

Troubleshooting

Common issues and solutions

FAQ

Frequently asked questions

GitHub Discussions

Ask the community

Compatibility

Check valid stack combinations

Build docs developers (and LLMs) love