~ init

01

better-ts-stack

TypeScript projects, ready to run.

A CLI that scaffolds Express, NestJS, Next.js, and TanStack Start projects with a database, authentication, and Docker already set up.

Package manager
npx better-ts-stack@latest

Run it with no flags and it asks for each option. open builder ->

npm
264
downloads last week
ci
276
stacks tested per PR
version
v2.1.2
on npm

~ stack.config

02
framework--framework
database--database
package manager
extras

~ my-app/

30 files03
cli command

npx better-ts-stack my-app --framework nestjs --database prisma --auth --docker --yes

files
  • + database
  • + auth
  • + docker
  • + rate-limit
  • + ci
  • + agents
  • + vscode
  • prisma/
    • schema.prisma+database
  • src/
    • auth/
      • auth.controller.ts+auth
      • auth.guard.ts+auth
      • auth.module.ts+auth
      • auth.schemas.ts+auth
      • auth.service.ts+auth
      • jwt.ts+auth
      • users.service.ts+auth
      • zod-validation.pipe.ts+auth
    • health/
      • health.controller.ts
    • prisma/
      • prisma.module.ts+database
      • prisma.service.ts+database
    • app.module.ts
    • env.ts
    • main.ts
  • .dockerignore+docker
  • .env
  • .env.example
  • .gitignore
  • .prettierignore
  • .prettierrc
  • docker-compose.yml+docker
  • Dockerfile+docker
  • eslint.config.mjs
  • nest-cli.json
  • package.json
  • prisma.config.ts+database
  • README.md
  • tsconfig.eslint.json
  • tsconfig.json

same list as --dry-run, read from the CLI templates

~ modules

10 modules04
  1. 01Express

    --framework express

    Express 5 with security headers, CORS, a health check route, and tsx watch.

    • express
    • nestjs (no)
    • next (no)
    • tanstack (no)
  2. 02NestJS

    --framework nestjs

    NestJS 12 as ES modules, with security headers and a health controller.

    • express (no)
    • nestjs
    • next (no)
    • tanstack (no)
  3. 03Next.js

    --framework nextjs

    Next.js 16 App Router, React 19, Tailwind CSS v4, and shadcn-style components.

    • express (no)
    • nestjs (no)
    • next
    • tanstack (no)
  4. 04TanStack Start

    --framework tanstack

    File-based routing, Vite in development, and a Nitro production server.

    • express (no)
    • nestjs (no)
    • next (no)
    • tanstack
  5. 05Prisma

    --database prisma

    PostgreSQL with a starter schema, a client, and migration scripts.

    • express
    • nestjs
    • next
    • tanstack
  6. 06Drizzle

    --database drizzle

    PostgreSQL with a typed schema, a client, and drizzle-kit scripts.

    • express
    • nestjs
    • next
    • tanstack
  7. 07Mongoose

    --database mongoose

    MongoDB with a connection helper and a typed User model.

    • express
    • nestjs
    • next
    • tanstack
  8. 08Authentication

    --auth

    JWT, bcrypt, and Zod for backends. Better Auth with sign-in and sign-up pages for full-stack apps.

    • express
    • nestjs
    • next
    • tanstack
  9. 09Rate limiting

    --rate-limit

    Per-IP limits with express-rate-limit or @nestjs/throttler.

    • express
    • nestjs
    • next (no)
    • tanstack (no)
  10. 10Docker

    --docker

    A multi-stage Dockerfile, a Compose file, and scripts to run them.

    • express
    • nestjs
    • next
    • tanstack

~ ci.matrix

ubuntu · windows05

276

stacks tested on every pull request

Every pull request generates each combination the CLI can produce, then installs, builds, type-checks, lints, and starts it.

  1. 1generate
  2. 2install
  3. 3build
  4. 4type-check
  5. 5lint
  6. 6start

on ubuntu-latest and windows-latest

Tested combinations by framework and database
frameworknoneprismadrizzlemongototal
Express2424242496
NestJS2424242496
Next.js612121242
TanStack Start612121242

each cell × auth, rate limit (backends), docker, and npm / pnpm / bun. full-stack auth needs a database.

~ principles

06
  • strict by default

    Strict TypeScript in every template, with ESLint and Prettier configured.

  • only what you pick

    Skip the database or auth and their packages and files are not there.

  • nothing left behind

    A plain project you own. No generator runtime, no lock-in.

~ exit

07

ready when you are_

npx better-ts-stack

© 2026 better-ts-stack · open source under MIT