Getting Started
Quick start guide for better-ts-stack, an interactive CLI for scaffolding TypeScript projects
What is better-ts-stack?
better-ts-stack is an interactive CLI that generates TypeScript projects. You choose the framework, database, authentication, and Docker setup from a few prompts, and the CLI writes a project that is ready to install and run.
Good for
- Starting a new TypeScript backend or full-stack project
- Prototyping an API with Express or NestJS
- Learning how a TypeScript project is structured
- Using the same project setup across a team
Quick Start
Run the CLI
npx better-ts-stackAnswer the prompts
The CLI asks, in order (every prompt can also be answered with a flag):
- Project name - becomes your folder name and
package.jsonname - Application type -
Backend APIorFull-stack- Backend: select a framework (Express or NestJS)
- Full-stack: select a frontend framework (Next.js 16 or TanStack Start)
- Database type -
none,PostgreSQL, orMongoDB - ORM/ODM (only shown when a database is selected)
- PostgreSQL ->
PrismaorDrizzle - MongoDB ->
Mongoose
- PostgreSQL ->
- Package manager -
npm,pnpm, orbun - Docker - include Docker configuration?
- Authentication - add auth?
- Express / NestJS: JWT-based auth (always available when asked)
- Next.js / TanStack: Better Auth (only prompted if a database was selected)
- Rate limiting - Express / NestJS only: limit requests per IP?
- CI - add a GitHub Actions workflow?
- AI agents - add an AGENTS.md for coding agents?
- VS Code - add workspace settings and recommended extensions?
- Git - initialize a repository?
- 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 devWhat's Included
Backend API
Express or NestJS server with TypeScript, security headers, CORS, 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 and NestJS, 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 already set up
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
Installation Options
npx vs global install, package manager differences
Usage
Every prompt and command-line flag
Modules
Backend, frontend, database, auth, and Docker options in detail
Project Structure
Understand the generated file layout
Need Help?
- Found a bug? Open an issue on GitHub
- Enjoying the tool? Leave a star on GitHub