Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

create-t3-app

t3-oss11.9kMIT7.39.3TypeScript support: included

Create web application with the t3 stack

create-t3-app, init.tips, next.js, t3-stack, tailwind, tRPC, typescript

readme

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/t3-oss/create-t3-app/99286f37324330ecdf75132fae1f246440a88035/www/public/images/t3-light.svg"> Logo for T3 </picture>

create-t3-app

Interactive CLI to start a full-stack, typesafe Next.js app.

Get started with the T3 Stack by running npm create t3-app@latest

PRs-Welcome Discord NPM version Downloads

Video thumbnail of Theo with an indecipherable expression on his face

Watch Theo's overview on Youtube here

Table of contents

The T3 Stack

The "T3 Stack" is a web development stack made by Theo focused on simplicity, modularity, and full-stack typesafety. It consists of:

So... what is create-t3-app? A template?

Kind of? create-t3-app is a CLI built by seasoned T3 Stack devs to streamline the setup of a modular T3 Stack app. This means each piece is optional, and the "template" is generated based on your specific needs.

After countless projects and many years on this tech, we have lots of opinions and insights. We’ve done our best to encode them into this CLI.

This is NOT an all-inclusive template. We expect you to bring your own libraries that solve the needs of YOUR application. While we don’t want to prescribe solutions to more specific problems like state management and deployment, we do have some recommendations listed here.

T3 Axioms

We'll be frank - this is an opinionated project. We share a handful of core beliefs around building and we treat them as the basis for our decisions.

1. Solve Problems

It's easy to fall into the trap of "adding everything" - we explicitly don't want to do that. Everything added to create-t3-app should solve a specific problem that exists within the core technologies included. This means we won't add things like state libraries (zustand, redux) but we will add things like NextAuth.js and integrate Prisma and tRPC for you.

2. Bleed Responsibly

We love our bleeding edge tech. The amount of speed and, honestly, fun that comes out of new shit is really cool. We think it's important to bleed responsibly, using riskier tech in the less risky parts. This means we wouldn't ⛔️ bet on risky new database tech (SQL is great!). But we happily ✅ bet on tRPC since it's just functions that are trivial to move off.

3. Typesafety Isn't Optional

The stated goal of create-t3-app is to provide the quickest way to start a new full-stack, typesafe web application. We take typesafety seriously in these parts as it improves our productivity and helps us ship fewer bugs. Any decision that compromises the typesafe nature of create-t3-app is a decision that should be made in a different project.

Getting Started

To scaffold an app using create-t3-app, run any of the following four commands and answer the command prompt questions:

npm

npm create t3-app@latest

yarn

yarn create t3-app

pnpm

pnpm create t3-app@latest

bun

bun create t3-app@latest

For more advanced usage, check out the CLI docs.

Community

For help, discussion about best practices, or any other conversation that would benefit create-t3-app:

Join the T3 Discord Server

Contributors

We 💖 contributors! Feel free to contribute to this project but please read the Contributing Guidelines before opening an issue or PR so you understand the branching strategy and local development environment. We also welcome you to join our Discord community for either support or contributing guidance.

A table of avatars from the project's contributors

Made with contrib.rocks

Powered by vercel

changelog

Changelog

7.38.1

Patch Changes

7.38.0

Minor Changes

Patch Changes

7.37.0

Minor Changes

Patch Changes

7.36.2

Patch Changes

7.36.1

Patch Changes

7.36.0

Minor Changes

Patch Changes

7.35.0

Minor Changes

Patch Changes

7.34.0

Minor Changes

Patch Changes

7.33.1

Patch Changes

  • #1884 f148deb Thanks @Irere123! - fix: remove deprecated push command in drizzle package.json scripts (… )

7.33.0

Minor Changes

Patch Changes

7.32.1

Patch Changes

7.32.0

Minor Changes

Patch Changes

7.31.0

Minor Changes

Patch Changes

7.30.2

Patch Changes

7.30.1

Patch Changes

7.30.0

Minor Changes

7.29.0

Minor Changes

7.28.0

Minor Changes

Patch Changes

7.27.0

Minor Changes

Patch Changes

7.26.0

Minor Changes

7.25.2

Patch Changes

7.25.1

Patch Changes

7.25.0

Minor Changes

Patch Changes

7.24.2

Patch Changes

7.24.1

Patch Changes

7.24.0

Minor Changes

Patch Changes

7.23.2

Patch Changes

7.23.1

Patch Changes

7.23.0

Minor Changes

7.22.0

Minor Changes

7.21.0

Minor Changes

7.20.2

Patch Changes

7.20.1

Patch Changes

7.20.0

Minor Changes

  • #1461 8034db0 Thanks @juliusmarminge! - feat: add drizzle

    This release adds a new option to use drizzle-orm as an alternative to Prisma.

    To make the different ORM options as similar as possible, some minor changes has also been made to the Prisma installer:

    • a new script db:push has been added and is included in both ORM options.
    • the prisma client has been renamed to db in the trpc context - you now access your database client like
      examples: publicProcedure.query((opts) => {
         // prisma
         opts.ctx.db.example.findMany()
         // drizzle
         opts.ctx.db.query.example.findMany()
      }),

    You cannot choose the two options in the same app.

Patch Changes

7.19.0

Minor Changes

7.18.0

Minor Changes

  • #1532 941a0fc Thanks @spicybackend! - chore(deps): upgrade Prisma to v5.1.1, bump patch versions of other dependencies

  • #1507 fe5755c Thanks @LevinUncu! - If the project is not in a Git repo, the next steps will show git init instead of git commit -m "initial commit".

7.17.0

Minor Changes

7.16.0

Minor Changes

7.15.0

Minor Changes

Patch Changes

  • #1493 a230d9f Thanks @dcottr! - Remove trailing newlines in generated app that aren't allowed by the generated prettier config

7.14.1

Patch Changes

7.14.0

Minor Changes

7.13.2

Patch Changes

7.13.1

Patch Changes

  • #1436 b0facee Thanks @harrismcc! - When using NextAuth but not Prisma, the session user's id is now set to token.sub instead of user.id because user is undefined when not using database sessions.

  • #1433 7fbe991 Thanks @FinnDore! - fix: SKIP_ENV_VALIDATION not skipping env validation

7.13.0

Minor Changes

  • #1397 be9a834 Thanks @brieyla1! - feat: Added JsonProtocol as the Default Prisma Engine for Serverless speedups

    modified:

    - cli/template/extras/prisma/schema/base.prisma
    
    - cli/template/extras/prisma/schema/with-auth.prisma

    Description: This pull request proposes the enabling of the JsonProtocol by default. The rationale for this change is based on the performance improvements provided by the JsonProtocol without compromising stability, even though it is still a preview feature. Empirical evidence gathered from large-scale projects, with 100+ Prisma calls, demonstrates the significant time reductions enabled by this optimization, particularly in serverless environments such as Vercel. Another point worth adding is that most projects using nextJS create-t3-app will be deployed on serverless platforms such as vercel, where the real impact is.

7.12.3

Patch Changes

7.12.2

Patch Changes

7.12.1

Patch Changes

  • #1377 00018ff Thanks @juliusmarminge! - move env validation logic out to a separate package

  • #1385 ac12abb Thanks @iAverages! - Fixed issue with creating git repository with git versions below 2.28 Fixed bug with check to use --inital-branch set in git v2.28

7.12.0

Minor Changes

7.11.0

Minor Changes

  • #1358 1a8a97e Thanks @juliusmarminge! - improve boolean coercion of SKIP_ENV_VALIDATION environment variable

    If defined, "0" and "false" are now considered falsey values, all other values are considered truthy.

Patch Changes

7.10.3

Patch Changes

7.10.2

Patch Changes

7.10.1

Patch Changes

7.10.0

Minor Changes

Patch Changes

7.9.0

Minor Changes

7.8.0

Minor Changes

Patch Changes

7.7.0

Minor Changes

7.6.0

Minor Changes

7.5.9

Patch Changes

  • #1252 d8be181 Thanks @ggrochow! - Rename _eslint.cjs before intializing git repo to ensure .eslint.cjs is added by default

7.5.8

Patch Changes

7.5.7

Patch Changes

7.5.6

Patch Changes

7.5.5

Patch Changes

7.5.4

Patch Changes

7.5.3

Patch Changes

7.5.2

Patch Changes

7.5.1

Patch Changes

7.5.0

Minor Changes

Patch Changes

  • #1171 efe8b7f Thanks @esotuvaka! - fix: swap @ts-check comments to checkJs: true in scaffolded app's tsconfig

7.4.1

Patch Changes

  • #1155 90955a5 Thanks @christopher-kapic! - Change unstable_getServerSession to match the updated getServerSession from next-auth (introduced in next-auth 4.19.0)

7.4.0

Minor Changes

Patch Changes

7.3.2

Patch Changes

7.3.1

Patch Changes

7.3.0

Minor Changes

7.2.0

Minor Changes

Patch Changes

7.1.0

Minor Changes

7.0.2

Patch Changes

7.0.1

Patch Changes

  • #1043 6fe7e1e Thanks @juliusmarminge! - fix(cli): exit with error code when aborting installation fix(cli): don't log when scaffolding in current directory and it's empty

7.0.0

Major Changes

  • #934 c20ec70 Thanks @juliusmarminge! - feat!: implement new folder structure

    create-t3-app has decided to switch out the folder structure of the generated t3-app to, what is to us, a more minimal, logical and easier to understand structure.

6.12.0

Minor Changes

6.11.6

Patch Changes

6.11.5

Patch Changes

  • #1010 9eddbab Thanks @maxmellen! - chore(create-t3-app): add @types/prettier package to tailwind installer and bump prettier versions

6.11.4

Patch Changes

6.11.3

Patch Changes

6.11.2

Patch Changes

6.11.1

Patch Changes

6.11.0

Minor Changes

Patch Changes

  • #895 91362db Thanks @Mvmo! - When initializing a new git repo the git config value 'init.defaultBranch' will be used as the branch name

  • #897 272b954 Thanks @AyanavaKarmakar! - fix(cli): fix wrong prompt when setting up project name

6.10.3

Patch Changes

6.10.2

Patch Changes

6.10.1

Patch Changes

6.10.0

Minor Changes

Patch Changes

6.9.0

Minor Changes

6.8.1

Patch Changes

6.8.0

Minor Changes

Patch Changes

6.7.0

Minor Changes

Patch Changes

6.6.0

Minor Changes

6.5.2

Patch Changes

6.5.1

Patch Changes

6.5.0

Minor Changes

Patch Changes

6.4.0

Minor Changes

Patch Changes

  • #611 78a0da3 Thanks @nexxeln! - fix(cli): make installDependencies step async to make loader spin

6.3.0

Minor Changes

6.2.1

Patch Changes

  • #602 9f86e39 Thanks @nexxeln! - feat(template): add prettier.Config type to prettier config and resolve prettier-plugin-tailwindcss import

6.2.0

Minor Changes

6.1.2

Patch Changes

  • #593 c8e2753 Thanks @nexxeln! - chore(template): remove the mention of @next in template readme

6.1.1

Patch Changes

6.1.0

Minor Changes

6.0.1

Patch Changes

6.0.0

Major Changes

Minor Changes

5.15.0

Minor Changes

5.14.1

Patch Changes

  • #510 39d766d Thanks @EkkoKo! - fix: resolve target area of Documentation links in TechnologyCard

5.14.0

Minor Changes

5.13.1

Patch Changes

5.13.0

Minor Changes

5.12.0

Minor Changes

5.11.0

Minor Changes

  • #430 306777a Thanks @benmarg! - feat: direct developer to add schema from .env to schema.mjs for zod validation

Patch Changes

5.10.3

Patch Changes

5.10.2

Patch Changes

5.10.1

Patch Changes

5.10.0

Minor Changes

Patch Changes

  • #394 52e9db7 Thanks @nadilas! - Extending the warning message for invalid client environment variables by including the reason

5.9.0

Minor Changes

5.8.5

Patch Changes

5.8.4

Patch Changes

5.8.3

Patch Changes

5.8.2

Patch Changes

5.8.1

Patch Changes

5.8.0

Minor Changes

5.7.0

Minor Changes

  • 7a76c95: feat(app): add lint config for typescript

5.6.0 (2022-08-11)

Features

  • Include ct3a version as metadata in generated app (#305) (0be4a97)

Bug Fixes

  • change ! reversion to equality in env validation (#293) (7822c43)
  • parse path returned from process.cwd() before using it (#303) (b55f196)

5.5.0 (2022-08-07)

Features

5.4.0 (2022-08-02)

Features

  • add deployment strategy to generated README (#258) (c7d4dce)
  • set appName to directory on 'npx create-t3-app .' (#273) (2179f2d)

Bug Fixes

5.3.0 (2022-07-25)

Features

  • add typesafe client side env variables (#209) (d4cf879)
  • improved logo typography (#238) (48c6720)
  • updating tailwind and postcss config's to use .cjs (#242) (5b97367)

Bug Fixes

  • added JSDoc type to clientEnv in all env-schema (#240) (9cb5ebb)
  • clarify some comments and rename some files in env (#245) (2048783)
  • remove semicolon in _app.tsx with next-auth to avoid early return (1be7713)
  • title being offset when using yarn/pnpm (c881f00)

5.2.1 (2022-07-19)

Bug Fixes

  • update url in auth prisma schema (97c9e27)

5.2.0 (2022-07-19)

Features

Bug Fixes

5.1.1 (2022-07-18)

Bug Fixes

  • add missing trpc import (37b6283)

5.1.0 (2022-07-18)

Features

Bug Fixes

5.0.0 (2022-07-16)

Features

Bug Fixes

  • add newline at the end of the file (64eee1c)
  • add scripts for CI (539f3fd)
  • add semantic elements and update tw classes on tw pages (#151) (61d6819)
  • bumped package.json for beta-release (3fe35f1)
  • change comment in .env to discord (d992713)
  • cli: use correct spelling, fix short choices (7776aa9)
  • conditionally run envVars installer (#196) (f5f4f62)
  • docs wrong format (3d2dbb0)
  • dont prompt for typesafe env-vars (2faee56)
  • eslint warning (import/no-anonymous-default-export) (a1cce55)
  • fixed some typos (#131) (a86466e)
  • format contributing.md (4111476)
  • handle git projects correctly (3ed897f)
  • incompatible git version (#127) (34f44f8)
  • invalid pnpm action version (2a1f6e3)
  • language prompt short answer should both be ts (#142) (5e4f80d)
  • markup: multiple h1 replaced to h2 (6bf9040)
  • prompts: show correct package manager in prompts (#153) (fe66ae9)
  • properly display the welcome title when installing with Yarn (#160) (a5b9d53)
  • provide cwd inside git init exec call (9679492)
  • reapply style fixes on tw pages (#189) (af1067b), closes #178
  • remove changeset from repo (#134) (d58b380)
  • remove duplicated types (#138) (e4c8e33)
  • remove unncesary import on auth router (abdc61f)
  • run prettier (9961645)
  • standardize log messages (83a13b9)
  • template: converting to use tech props and remove tw from template (#183) (b2d542a)
  • templates: h1 restored (e51e03d)
  • type entrire app and not just the props (908630e)
  • typo in "Javascript" (#136) (6873a7a)
  • update templates (4418f1d)
  • use components for the tech within the splash screen (#178) (c436382)
  • with-tw removed unused styles and added motion saftey (#148) (598ed0e)

4.4.1

Patch Changes

  • changed ui for template

4.4.0

Minor Changes

  • improve ui examples of template app

4.3.5

Patch Changes

  • add warning for old git versions

4.3.4

Patch Changes

  • improve template styling

4.3.3

Patch Changes

  • Add description for packages in the template

4.3.2

Patch Changes

  • Redesign pages

4.3.0

Minor Changes

  • added Next-Auth protected routes when using tRPC

4.2.12

Patch Changes

  • upgrade next to 12.2.0

4.2.11

Patch Changes

  • modified the title to print a colorful ascii art

4.2.10

Patch Changes

  • add warning about next-auth when using Node 18

4.2.9

Patch Changes

  • fix resolved path to package root

4.2.8

Patch Changes

  • diable version flag

4.2.2

Patch Changes

  • fix esm issues

4.2.1

Patch Changes

  • trying to fix esm error

4.2.0

Minor Changes

  • a548f22: added cli args, esm support

4.1.1

Patch Changes

  • Updated package to full ESM support

4.1.0

Minor Changes

  • Create-t3-app now accepts args!

    When calling create-t3-app, you can specify the app name and directory directly from the cli.

    Additonal options are visable by passing -h or --help into the command line

4.0.8

Patch Changes

  • added loading spinners

4.0.7

Patch Changes

  • added tsup as build tool

4.0.6

Patch Changes

  • Added dev tooling.