Better-TS-Stack

Getting Started

Quick start guide for better-ts-stack - generate production-ready TypeScript projects in seconds

What is better-ts-stack?

better-ts-stack is an interactive CLI tool that generates fully configured TypeScript projects with your choice of backend framework, database, authentication, and Docker support. No config files to edit by hand - just answer a few prompts and get a production-ready codebase.

Good for

  • Starting new TypeScript backend or full-stack projects - Prototyping APIs with a type-safe Express setup - Learning modern TypeScript project structure
  • Standardizing project scaffolding across a team

Quick Start

Run the CLI

npx better-ts-stack

Answer the prompts

The CLI is fully interactive - there are no flags or subcommands. You will be asked:

  1. Project name - becomes your folder name and package.json name
  2. Application type - Backend API or Full-stack
    • Backend: select a framework (Express now; NestJS coming soon)
    • Full-stack: select a frontend framework (Next.js 16 or TanStack Start)
  3. Database type - none, PostgreSQL, or MongoDB
  4. ORM/ODM (only shown when a database is selected)
    • PostgreSQL -> Prisma or Drizzle
    • MongoDB -> Mongoose
  5. Package manager - npm, pnpm, or bun
  6. Docker - include Docker configuration?
  7. Authentication - add auth?
    • Express: JWT-based auth (always available when asked)
    • Next.js / TanStack: Better Auth (only prompted if a database was selected)
  8. Git - initialize a repository with an initial commit?
  9. Install dependencies - run the install command now?

The CLI does not ask for a port number. The server port defaults to 3000 via the PORT environment variable.

Start developing

cd your-project-name
npm install   # skip if you chose to install during setup
npm run dev

What's Included

Backend API

Express.js server with TypeScript, cors, helmet, morgan middleware, and a health check endpoint

Full-stack App

Next.js 16 or TanStack Start with React 19, Tailwind CSS v4, and file-based routing

Type-safe Database

PostgreSQL with Prisma or Drizzle, or MongoDB with Mongoose - your choice

Authentication

JWT + bcrypt for Express, Better Auth (with Prisma, Drizzle, or MongoDB adapter) for Next.js and TanStack Start

Docker Ready

Multi-stage Dockerfile and docker-compose.yml generated on request

Developer Tooling

ESLint 10, Prettier, TypeScript strict mode, and hot reload out of the box

Requirements

  • Node.js 24.0.0 or higher
  • Package manager - npm, pnpm, or bun

Check your Node.js version before running: node --version

Next Steps


Need Help?

On this page