快速开始

几分钟内创建您的第一个 Better-T-Stack 项目

设计理念

  • 自选技术栈:只选择您需要的,没有多余内容。
  • 最小化模板:零冗余的骨架脚手架。
  • 最新依赖:默认始终保持最新且稳定。
  • 免费开源:永久免费。

开始使用

先决条件

CLI (交互式提示)

bun create better-t-stack@latest
pnpm create better-t-stack@latest
npx create-better-t-stack@latest

按照交互式提示选择您的前端、后端、数据库、ORM、API 层和附加组件。

跳过提示并使用默认技术栈:

bun create better-t-stack@latest  --yes
pnpm create better-t-stack@latest  --yes
npx create-better-t-stack@latest  --yes

技术栈构建器 (UI界面)

  • 访问 /new 选择您的技术栈并复制生成的命令
  • 或者通过以下方式打开:
bun create better-t-stack@latest builder
pnpm create better-t-stack@latest builder
npx create-better-t-stack@latest builder

常见配置

默认技术栈

bun create better-t-stack@latest my-webapp \
  --frontend tanstack-router \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --auth better-auth \
  --addons turborepo
pnpm create better-t-stack@latest my-webapp \
  --frontend tanstack-router \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --auth better-auth \
  --addons turborepo
npx create-better-t-stack@latest my-webapp \
  --frontend tanstack-router \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --auth better-auth \
  --addons turborepo

Convex + React + Clerk

bun create better-t-stack@latest my-convex-app \
  --frontend tanstack-router \
  --backend convex \
  --auth clerk
pnpm create better-t-stack@latest my-convex-app \
  --frontend tanstack-router \
  --backend convex \
  --auth clerk
npx create-better-t-stack@latest my-convex-app \
  --frontend tanstack-router \
  --backend convex \
  --auth clerk

纯 API

bun create better-t-stack@latest my-api \
  --frontend none \
  --backend fastify \
  --runtime node \
  --database postgres \
  --orm prisma \
  --api trpc
pnpm create better-t-stack@latest my-api \
  --frontend none \
  --backend fastify \
  --runtime node \
  --database postgres \
  --orm prisma \
  --api trpc
npx create-better-t-stack@latest my-api \
  --frontend none \
  --backend fastify \
  --runtime node \
  --database postgres \
  --orm prisma \
  --api trpc

移动应用 (Expo)

bun create better-t-stack@latest my-native \
  --frontend native-nativewind \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --auth better-auth
pnpm create better-t-stack@latest my-native \
  --frontend native-nativewind \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --auth better-auth
npx create-better-t-stack@latest my-native \
  --frontend native-nativewind \
  --backend hono \
  --database sqlite \
  --orm drizzle \
  --auth better-auth

空 Monorepo

bun create better-t-stack@latest my-workspace \
  --frontend none \
  --backend none
pnpm create better-t-stack@latest my-workspace \
  --frontend none \
  --backend none
npx create-better-t-stack@latest my-workspace \
  --frontend none \
  --backend none

标志速查表

完整列表请参阅 CLI 参考。关键标志:

  • --frontend: tanstack-router, react-router, tanstack-start, next, nuxt, svelte, solid, native-nativewind, native-unistyles, none
  • --backend: hono, express, fastify, elysia, next, convex, 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
  • --addons: turborepo, pwa, tauri, biome, husky, starlight, fumadocs, ultracite, oxlint, ruler, none
  • --examples: todo, ai, none

后续步骤