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-stackAnswer the prompts
The CLI is fully interactive - there are no flags or subcommands. You will be asked:
- Project name - becomes your folder name and
package.jsonname - Application type -
Backend APIorFull-stack- Backend: select a framework (Express now; NestJS coming soon)
- 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: JWT-based auth (always available when asked)
- Next.js / TanStack: Better Auth (only prompted if a database was selected)
- Git - initialize a repository with an initial commit?
- 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.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
Installation Options
npx vs global install, package manager differences
Interactive Usage
Full prompt-by-prompt walkthrough
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