Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/amanvarshney01/create-better-t-stack/llms.txt

Use this file to discover all available pages before exploring further.

General Questions

Better-T-Stack is an opinionated CLI tool that scaffolds full-stack TypeScript projects. It generates a clean monorepo with your choice of frontend, backend, API layer, database/ORM, authentication, and addons.Key features:
  • Roll your own stack: pick only what you need
  • Minimal templates with zero bloat
  • Latest dependencies by default
  • Full type safety end-to-end
  • Free and open source
No global installation required! Run the CLI directly with your package manager:
npm create better-t-stack@latest
# or
pnpm create better-t-stack@latest
# or
bun create better-t-stack@latest
All major package managers are supported:
  • npm (default)
  • pnpm
  • bun (recommended)
The CLI will detect and use your preferred package manager, or you can specify it with --package-manager.
Node.js 20 or higher is required (LTS recommended).Download from nodejs.org
The create command is designed for new projects. However:
  • You can use the add command to extend an existing Better-T-Stack project with additional addons
  • You can manually migrate code from an existing project into a new Better-T-Stack scaffold
  • The generated project structure is standard TypeScript/monorepo, so you can integrate it as needed
The generated project structure varies based on your stack:Server-based stacks:
my-app/
├── apps/
│   ├── web/        # Frontend (if selected)
│   ├── native/     # React Native (if selected)
│   └── server/     # Backend API
└── packages/
    └── db/         # Database & ORM layer
Convex stacks:
my-app/
├── convex/         # Convex backend functions
└── apps/
    └── web/        # Frontend
See the Project Structure page for detailed layouts.

Choosing Your Stack

No. Better-T-Stack is intentionally unopinionated about which stack you choose. You pick what fits your needs, and the CLI validates compatibility.The --yes flag uses a default stack (TanStack Router + Hono + Drizzle + SQLite), but this is just a convenience option.See Compatibility for rules about valid combinations.
Both are excellent type-safe RPC frameworks:Choose tRPC if:
  • You want the most mature, battle-tested solution
  • You need extensive community resources and examples
  • You’re building a traditional client-server app
Choose oRPC if:
  • You want a lighter, more modern alternative
  • You prefer a simpler API surface
  • You’re interested in newer patterns
Both work with all supported backends and frontends.
Both are powerful TypeScript-first ORMs:Choose Drizzle if:
  • You want SQL-like queries with TypeScript
  • You prefer lightweight and fast
  • You want full control over SQL
  • You’re using Cloudflare Workers (better D1 support)
Choose Prisma if:
  • You want a higher-level abstraction
  • You prefer declarative schema definitions
  • You need advanced features like migrations UI
  • You want the most mature ecosystem
See Compatibility for database-specific constraints.
Better Auth (recommended):
  • Open-source, self-hosted authentication
  • No vendor lock-in
  • Free for unlimited users
  • Full control over data and privacy
  • Supports social logins, email/password, passkeys
Clerk:
  • Managed authentication service
  • Easier initial setup (less configuration)
  • Generous free tier, paid plans for scale
  • Advanced features like organizations, admin UI
  • Great developer experience
Yes! You can select multiple frontends:
create-better-t-stack my-app \
  --frontend tanstack-router native-uniwind
This generates:
  • apps/web/ - Web frontend (TanStack Router)
  • apps/native/ - React Native app (with NativeWind)
  • Both can share the same backend and type definitions

Common Issues

This is usually a networking issue. Try these solutions:
  1. Set the correct server URL
    # In apps/native/.env
    EXPO_PUBLIC_SERVER_URL=http://YOUR_IP:3000
    
    Replace YOUR_IP with your machine’s IP address (not localhost).
  2. Check your firewall Ensure your firewall allows connections on the backend port (usually 3000).
  3. Use Expo tunnel
    npx expo start --tunnel
    
    This creates a tunnel that bypasses local network issues.
  4. Verify backend is running Make sure your backend server is running and accessible.
Set the BTS_TELEMETRY_DISABLED environment variable:For a single run:
BTS_TELEMETRY_DISABLED=1 npx create-better-t-stack@latest
Permanently (add to shell profile):
# In ~/.bashrc, ~/.zshrc, etc.
export BTS_TELEMETRY_DISABLED=1
See Analytics for details on what’s collected.
Some stack combinations are incompatible. Common issues:
  • Mongoose requires MongoDB database
  • Prisma doesn’t support MongoDB with other databases
  • tRPC/oRPC requires a backend (can’t use with --backend none)
  • Cloudflare Workers runtime has specific constraints
Use the --yolo flag to bypass checks (not recommended), or see Compatibility for valid combinations.
Try these steps:
  1. Clear cache
    # npm
    npm cache clean --force
    
    # pnpm
    pnpm store prune
    
    # bun
    bun pm cache rm
    
  2. Delete and reinstall
    rm -rf node_modules
    rm package-lock.json  # or pnpm-lock.yaml, bun.lockb
    npm install  # or pnpm install, bun install
    
  3. Use a different package manager
    create-better-t-stack --package-manager bun
    
This is usually resolved by:
  1. Install dependencies first
    npm install  # or pnpm install, bun install
    
  2. Restart your TypeScript server In VS Code: Cmd+Shift+P → “TypeScript: Restart TS Server”
  3. Check your Node version Ensure you’re using Node.js 20 or higher.
For local database setup issues:SQLite:
  • Usually works out of the box
  • Check file permissions in your project directory
PostgreSQL/MySQL with Docker:
  • Ensure Docker is running
  • Check that ports aren’t already in use
  • Try docker-compose up -d manually
Remote databases (Turso, Neon, Supabase):
  • Verify your API credentials
  • Check network connectivity
  • Ensure you have the correct permissions
You can skip database setup with --manual-db and configure it manually later.

Advanced Usage

The CLI generates minimal, unopinionated templates. After generation, you can:
  • Modify any generated files
  • Add new dependencies
  • Change folder structure
  • The code is yours!
For contributing template changes, see Contributing.
You can use Better-T-Stack from Node.js:
import { create } from "create-better-t-stack";

const result = await create("my-app", {
  frontend: ["tanstack-router"],
  backend: "hono",
  database: "sqlite",
  orm: "drizzle",
});

result.match({
  ok: (data) => console.log(`Created: ${data.projectDirectory}`),
  err: (error) => console.error(`Failed: ${error.message}`),
});
See Programmatic API for complete documentation.
Currently, the CLI uses built-in templates. However:
  • You can modify templates after generation
  • You can fork the repository and modify templates in packages/template-generator/templates
  • Custom template support may be added in the future
See the GitHub repository for template structure.
The CLI stores a local history of projects you’ve created:
create-better-t-stack history
create-better-t-stack history --limit 20
create-better-t-stack history --json
create-better-t-stack history --clear
This is stored locally on your machine and includes:
  • Project name and path
  • Stack configuration
  • Creation timestamp
You can clear it anytime with --clear.

Getting Help

Documentation

Browse the complete documentation

GitHub Issues

Report bugs or request features

GitHub Discussions

Ask questions and share ideas

Discord

Join our community for real-time help

Build docs developers (and LLMs) love