Configs2026年5月24日·1 分钟阅读

Create T3 App — The Best Way to Start a Type-Safe Next.js App

CLI scaffold that generates a full-stack Next.js project pre-wired with tRPC, Prisma, NextAuth.js, and Tailwind CSS. Designed to maximize type safety from database to frontend with zero boilerplate.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 29/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Stage only
信任
信任等级:Established
入口
Create T3 App
安全暂存命令
npx -y tokrepo@latest install 9720bd5b-574b-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

Introduction

Create T3 App is the official CLI for the T3 Stack, a curated set of technologies chosen for end-to-end type safety in modern web applications. It eliminates the tedious setup of wiring Next.js with tRPC, Prisma, NextAuth.js, and Tailwind CSS so developers can ship features from minute one.

What Create T3 App Does

  • Scaffolds a Next.js project with an interactive CLI that lets you pick your stack
  • Pre-configures tRPC for fully type-safe API routes without code generation
  • Sets up Prisma with a starter schema and database connection
  • Integrates NextAuth.js for authentication with provider configuration
  • Includes Tailwind CSS with a sensible default config and prettier plugin

Architecture Overview

The generated project uses the Next.js App Router with tRPC providing a type-safe RPC layer between client and server. Prisma acts as the ORM with its schema serving as the single source of truth for the database. NextAuth.js handles session management via JWT or database sessions. The CLI itself is built with commander and inquirer, and each optional package is a modular installer that injects only the files and dependencies it needs.

Self-Hosting & Configuration

  • Run npx prisma db push to sync the schema to your database
  • Set DATABASE_URL, NEXTAUTH_SECRET, and provider keys in .env
  • Deploy to Vercel with zero config or self-host with npm run build && npm start
  • Customize the tRPC router in src/server/api/routers/
  • Add new auth providers by editing src/server/auth.ts

Key Features

  • End-to-end type safety from database schema through API to React components
  • Modular CLI that only installs what you select
  • First-class TypeScript support with strict mode enabled by default
  • Active community with the T3 Stack documentation and Discord
  • Minimal opinionation beyond the core integrations

Comparison with Similar Tools

  • create-next-app — generates a basic Next.js project; T3 adds tRPC, Prisma, and auth pre-wired
  • Blitz.js — offers a zero-API approach built into the framework; T3 uses tRPC which is framework-agnostic
  • RedwoodJS — full-stack React framework with GraphQL; T3 uses tRPC for simpler type-safe RPCs
  • Wasp — declarative full-stack DSL; T3 stays closer to standard Next.js conventions

FAQ

Q: Can I add packages after scaffolding? A: Yes, the generated project is standard Next.js. Add any npm package as you normally would.

Q: Does it support databases other than PostgreSQL? A: Prisma supports PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, and CockroachDB. Change the provider in schema.prisma.

Q: Is tRPC required or can I use REST APIs? A: tRPC is optional during scaffolding. You can deselect it and add your own API routes.

Q: How do I deploy to a non-Vercel host? A: Run npm run build for a production build and serve with npm start on any Node.js host.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产