diff --git a/README.md b/README.md index c2cb225..0148078 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,24 @@ A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with ![demo](https://cdn.jsdelivr.net/gh/amanvarshney01/create-better-t-stack/demo.gif) +## Philosophy + +- Roll your own stack: you pick only the parts you need, nothing extra. +- Minimal templates: bare-bones scaffolds with zero bloat. +- Latest dependencies: always use current, stable versions by default. +- Free and open source: forever. + ## Quick Start ```bash -# Using npm -npx create-better-t-stack@latest - -# Using bun +# Using bun (recommended) bun create better-t-stack@latest # Using pnpm pnpm create better-t-stack@latest + +# Using npm +npx create-better-t-stack@latest ``` ## Features @@ -37,7 +44,7 @@ pnpm create better-t-stack@latest - DB Setup: Turso, Neon, Supabase, Prisma PostgreSQL, MongoDB Atlas, Cloudflare D1, Docker - Web Deploy: Cloudflare Workers -Type safety end-to-end, clean monorepo layout, and zero‑lock‑in: you choose only what you need. +Type safety end-to-end, clean monorepo layout, and zero lock-in: you choose only what you need. ## Repository Structure diff --git a/apps/cli/README.md b/apps/cli/README.md index 94e541e..419039b 100644 --- a/apps/cli/README.md +++ b/apps/cli/README.md @@ -15,14 +15,14 @@ A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with Run without installing globally: ```bash -# Using npm -npx create-better-t-stack@latest - -# Using bun +# Using bun (recommended) bun create better-t-stack@latest # Using pnpm pnpm create better-t-stack@latest + +# Using npm +npx create-better-t-stack@latest ``` Follow the prompts to configure your project or use the `--yes` flag for defaults. @@ -58,14 +58,15 @@ Options: --auth Include authentication --no-auth Exclude authentication --frontend Frontend types (tanstack-router, react-router, tanstack-start, next, nuxt, svelte, solid, native-nativewind, native-unistyles, none) - --addons Additional addons (pwa, tauri, starlight, biome, husky, turborepo, none) + --addons Additional addons (pwa, tauri, starlight, biome, husky, turborepo, fumadocs, ultracite, oxlint, none) --examples Examples to include (todo, ai, none) --git Initialize git repository --no-git Skip git initialization --package-manager Package manager (npm, pnpm, bun) --install Install dependencies --no-install Skip installing dependencies - --db-setup Database setup (turso, d1, neon, supabase, prisma-postgres, mongodb-atlas, none) + --db-setup Database setup (turso, d1, neon, supabase, prisma-postgres, mongodb-atlas, docker, none) + --web-deploy Web deployment (workers, none) --backend Backend framework (hono, express, elysia, next, convex, fastify, none) --runtime Runtime (bun, node, workers, none) --api API type (trpc, orpc, none) @@ -84,7 +85,7 @@ This CLI collects anonymous usage data to help improve the tool. The data collec ### Disabling Telemetry -You can disable telemetry by setting the `BTS_TELEMETRY` environment variable: +You can disable telemetry by setting the `BTS_TELEMETRY_DISABLED` environment variable: ```bash # Disable telemetry for a single run @@ -94,10 +95,6 @@ BTS_TELEMETRY_DISABLED=1 npx create-better-t-stack my-app export BTS_TELEMETRY_DISABLED=1 ``` -### Development - -During development, telemetry is automatically disabled when `NODE_ENV=development`. - ## Examples Create a project with default configuration: @@ -118,10 +115,10 @@ Create a project with Elysia backend and Node.js runtime: npx create-better-t-stack my-app --backend elysia --runtime node ``` -Create a project with multiple frontend options: +Create a project with multiple frontend options (one web + one native): ```bash -npx create-better-t-stack my-app --frontend tanstack-router native +npx create-better-t-stack my-app --frontend tanstack-router native-nativewind ``` Create a project with examples: diff --git a/apps/web/content/docs/analytics.mdx b/apps/web/content/docs/analytics.mdx index e4967c5..162c132 100644 --- a/apps/web/content/docs/analytics.mdx +++ b/apps/web/content/docs/analytics.mdx @@ -23,10 +23,26 @@ Not collected: Telemetry is enabled by default. To disable: -```bash -# Disable for a single run -BTS_TELEMETRY_DISABLED=1 bun create better-t-stack@latest -``` + + + ```bash + # Disable for a single run + BTS_TELEMETRY_DISABLED=1 bun create better-t-stack@latest + ``` + + + ```bash + # Disable for a single run + BTS_TELEMETRY_DISABLED=1 pnpm create better-t-stack@latest + ``` + + + ```bash + # Disable for a single run + BTS_TELEMETRY_DISABLED=1 npx create-better-t-stack@latest + ``` + + Add `export BTS_TELEMETRY_DISABLED=1` to your shell profile to make it permanent. diff --git a/apps/web/content/docs/cli-commands.mdx b/apps/web/content/docs/cli-commands.mdx deleted file mode 100644 index 408a6cb..0000000 --- a/apps/web/content/docs/cli-commands.mdx +++ /dev/null @@ -1,595 +0,0 @@ ---- -title: CLI Commands -description: Complete reference for all Better-T-Stack CLI commands and options ---- - -## Quick Usage - - - - ```bash - # Interactive setup - bun create better-t-stack@latest - - # With project name - bun create better-t-stack@latest my-project - ``` - - - ```bash - pnpm create better-t-stack@latest - pnpm create better-t-stack@latest my-project - ``` - - - ```bash - npx create-better-t-stack@latest - npx create-better-t-stack@latest my-project - ``` - - - -## Commands Overview - -| Command | Description | -|---------|-------------| -| `init` (default) | Create a new Better-T-Stack project | -| `add` | Add addons or deployment configurations to existing projects | -| `sponsors` | Display project sponsors | -| `docs` | Open documentation in browser | -| `builder` | Open web-based stack builder | - ---- - -## `init` - Create Project (Default) - -The primary command for creating new Better-T-Stack projects. - -### Basic Usage - - - - ```bash - # Interactive setup - bun create better-t-stack@latest - - # With project name - bun create better-t-stack@latest my-project - - # With specific directory - bun create better-t-stack@latest ./path/to/project - - # Use current directory - bun create better-t-stack@latest . - ``` - - - ```bash - pnpm create better-t-stack@latest - pnpm create better-t-stack@latest my-project - pnpm create better-t-stack@latest ./path/to/project - pnpm create better-t-stack@latest . - ``` - - - ```bash - npx create-better-t-stack@latest - npx create-better-t-stack@latest my-project - npx create-better-t-stack@latest ./path/to/project - npx create-better-t-stack@latest . - ``` - - - -### Flags Reference - -#### General Options - -| Flag | Type | Default | Description | -|------|------|---------|-------------| -| `--yes, -y` | boolean | `false` | Skip prompts, use defaults | -| `--help, -h` | boolean | - | Show help information | -| `--version, -V` | boolean | - | Show CLI version | - -#### Frontend Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--frontend` | Multiple values | `tanstack-router` | Frontend frameworks to include | - -**Available Frontend Values:** -- `tanstack-router` - React with TanStack Router -- `react-router` - React with React Router -- `tanstack-start` - React with TanStack Start (SSR) -- `next` - Next.js framework -- `nuxt` - Vue.js with Nuxt -- `svelte` - SvelteKit -- `solid` - SolidJS -- `native-nativewind` - React Native with NativeWind -- `native-unistyles` - React Native with Unistyles -- `none` - No frontend - -**Examples:** -```bash -# Single web frontend ---frontend tanstack-router - -# Web + Mobile ---frontend tanstack-router native-nativewind - -# No frontend (API-only) ---frontend none -``` - -Note: Select at most one web frontend (one of: tanstack-router, react-router, tanstack-start, next, nuxt, svelte, solid) and at most one native frontend (one of: native-nativewind, native-unistyles). -Do not combine `none` with other frontend values. - -#### Backend Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--backend` | Single value | `hono` | Backend framework | - -**Available Backend Values:** -- `hono` - Hono web framework -- `express` - Express.js -- `fastify` - Fastify framework -- `elysia` - Elysia framework -- `next` - Next.js API routes -- `convex` - Convex backend-as-a-service -- `none` - No backend - -**Examples:** -```bash ---backend hono ---backend convex ---backend none -``` - -#### Runtime Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--runtime` | Single value | `bun` | Runtime environment | - -**Available Runtime Values:** -- `bun` - Bun runtime -- `node` - Node.js runtime -- `workers` - Cloudflare Workers (Hono only) -- `none` - No runtime (Convex/none backend) - -**Examples:** -```bash ---runtime bun ---runtime workers # Only with --backend hono -``` - -#### Database Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--database` | Single value | `sqlite` | Database type | - -**Available Database Values:** -- `sqlite` - SQLite database -- `postgres` - PostgreSQL -- `mysql` - MySQL -- `mongodb` - MongoDB -- `none` - No database - -**Examples:** -```bash ---database postgres ---database none -``` - -#### ORM Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--orm` | Single value | `drizzle` | ORM/Database toolkit | - -**Available ORM Values:** -- `drizzle` - Drizzle ORM (TypeScript-first) -- `prisma` - Prisma ORM (feature-rich) -- `mongoose` - Mongoose (MongoDB only) -- `none` - No ORM - -**Examples:** -```bash ---orm drizzle ---orm prisma ---orm none -``` - -#### API Layer Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--api` | Single value | `trpc` | API layer type | - -**Available API Values:** -- `trpc` - tRPC (end-to-end type safety) -- `orpc` - oRPC (OpenAPI compatible) -- `none` - No API layer - -**Examples:** -```bash ---api trpc ---api orpc ---api none -``` - -#### Authentication Options - -| Flag | Type | Default | Description | -|------|------|---------|-------------| -| `--auth` | boolean | `true` | Enable authentication | -| `--no-auth` | boolean | - | Disable authentication | - -**Examples:** -```bash ---auth # Enable auth ---no-auth # Disable auth -``` - -#### Addons Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--addons` | Multiple values | `turborepo` | Additional features | - -**Available Addon Values:** -- `turborepo` - Turborepo build system -- `pwa` - Progressive Web App support -- `tauri` - Desktop app with Tauri -- `biome` - Biome linter/formatter -- `husky` - Git hooks with Husky -- `starlight` - Documentation site - - `fumadocs` - Fumadocs docs site - - `ultracite` - Markdown/MDX processing - - `oxlint` - Fast linter -- `none` - No addons - -Note: Do not combine `none` with other addon values. - -**Examples:** -```bash ---addons turborepo pwa ---addons biome husky ---addons none -``` - -#### Examples Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--examples` | Multiple values | `[]` | Example applications | - -**Available Example Values:** -- `todo` - Todo CRUD application -- `ai` - AI chat interface -- `none` - No examples - -**Examples:** -```bash ---examples todo ---examples todo ai ---examples none -``` - -Note: Do not combine `none` with other example values. - -#### Database Setup Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--db-setup` | Single value | `none` | Database hosting setup | - -**Available Database Setup Values:** -- `turso` - Turso SQLite hosting -- `neon` - Neon PostgreSQL -- `supabase` - Supabase PostgreSQL -- `prisma-postgres` - Prisma PostgreSQL -- `mongodb-atlas` - MongoDB Atlas -- `d1` - Cloudflare D1 (Workers only) -- `docker` - Local Docker setup -- `none` - Manual setup - -**Examples:** -```bash ---db-setup neon ---db-setup docker ---db-setup none -``` - -#### Deployment Options - -| Flag | Values | Default | Description | -|------|--------|---------|-------------| -| `--web-deploy` | Single value | `none` | Web deployment setup | - -**Available Deployment Values:** -- `workers` - Cloudflare Workers -- `none` - No deployment setup - -**Examples:** -```bash ---web-deploy workers ---web-deploy none -``` - -#### Project Management Options - -| Flag | Type | Default | Description | -|------|------|---------|-------------| -| `--git` | boolean | `true` | Initialize git repository | -| `--no-git` | boolean | - | Skip git initialization | -| `--install` | boolean | `true` | Install dependencies | -| `--no-install` | boolean | - | Skip dependency installation | -| `--package-manager` | string | auto-detect | Package manager to use | - -**Package Manager Values:** -- `npm` - Use npm -- `pnpm` - Use pnpm -- `bun` - Use bun - -**Examples:** -```bash ---git --install --package-manager pnpm ---no-git --no-install -``` - ---- - -## `add` - Add to Existing Project - -Add addons or deployment configurations to existing Better-T-Stack projects. - -### Usage - - - - ```bash - # Interactive addon selection - bun create better-t-stack@latest add - - # Add specific addons - bun create better-t-stack@latest add --addons pwa tauri - - # Add deployment - bun create better-t-stack@latest add --web-deploy workers - - # Add both - bun create better-t-stack@latest add --addons biome --web-deploy workers - ``` - - - ```bash - pnpm create better-t-stack@latest add - pnpm create better-t-stack@latest add --addons pwa tauri - pnpm create better-t-stack@latest add --web-deploy workers - pnpm create better-t-stack@latest add --addons biome --web-deploy workers - ``` - - - ```bash - npx create-better-t-stack@latest add - npx create-better-t-stack@latest add --addons pwa tauri - npx create-better-t-stack@latest add --web-deploy workers - npx create-better-t-stack@latest add --addons biome --web-deploy workers - ``` - - - -### Flags - -| Flag | Values | Description | -|------|--------|-------------| -| `--addons` | Multiple values | Addons to add (same as init) | -| `--web-deploy` | Single value | Deployment to add | -| `--project-dir` | string | Target project directory (default: current) | -| `--install` | boolean | Install dependencies after adding | -| `--no-install` | boolean | Skip dependency installation | -| `--package-manager` | string | Package manager to use | - -### Examples - -```bash -# Add PWA support to current project -npx create-better-t-stack@latest add --addons pwa - -# Add multiple addons with dependency installation -npx create-better-t-stack@latest add --addons biome husky --install - -# Add to specific project directory -npx create-better-t-stack@latest add --project-dir ./my-project --addons tauri -``` - ---- - -## `sponsors` - View Sponsors - -Display Better-T-Stack project sponsors. - -### Usage - - - - ```bash - bun create better-t-stack@latest sponsors - ``` - - - ```bash - pnpm create better-t-stack@latest sponsors - ``` - - - ```bash - npx create-better-t-stack@latest sponsors - ``` - - - -Shows a list of project sponsors with their GitHub profiles and websites. - ---- - -## `docs` - Open Documentation - -Open Better-T-Stack documentation in your default browser. - -### Usage - - - - ```bash - bun create better-t-stack@latest docs - ``` - - - ```bash - pnpm create better-t-stack@latest docs - ``` - - - ```bash - npx create-better-t-stack@latest docs - ``` - - - -Opens: https://better-t-stack.dev/docs - ---- - -## `builder` - Open Stack Builder - -Open the web-based interactive stack builder. - -### Usage - - - - ```bash - bun create better-t-stack@latest builder - ``` - - - ```bash - pnpm create better-t-stack@latest builder - ``` - - - ```bash - npx create-better-t-stack@latest builder - ``` - - - -Opens: https://better-t-stack.dev/new - -The web builder provides a visual interface for configuring your stack and generates the corresponding CLI command. - ---- - -## Complete Examples - -### Full-Stack Web Application - -```bash -bun create better-t-stack@latest my-webapp \ - --frontend tanstack-router \ - --backend hono \ - --runtime bun \ - --database postgres \ - --orm drizzle \ - --api trpc \ - --auth \ - --db-setup neon \ - --addons pwa turborepo \ - --examples todo ai -``` - -### Mobile + Web Application - -```bash -bun create better-t-stack@latest my-mobile-app \ - --frontend tanstack-router native-nativewind \ - --backend hono \ - --database sqlite \ - --orm drizzle \ - --auth \ - --db-setup turso \ - --addons turborepo -``` - -### Cloudflare Workers Project - -```bash -bun create better-t-stack@latest my-workers-app \ - --frontend tanstack-router \ - --backend hono \ - --runtime workers \ - --database sqlite \ - --orm drizzle \ - --db-setup d1 \ - --web-deploy workers -``` - -### API-Only Project - -```bash -bun create better-t-stack@latest my-api \ - --frontend none \ - --backend fastify \ - --runtime node \ - --database postgres \ - --orm prisma \ - --api trpc \ - --db-setup docker -``` - -### Quick Defaults - -```bash -# Use all defaults with immediate setup -bun create better-t-stack@latest my-project --yes - -# Convex full-stack (automatically configures compatible options) -bun create better-t-stack@latest my-convex-app --backend convex -``` - ---- - -## Compatibility Notes - -Some options have compatibility requirements: - -- **Cloudflare Workers**: Only with `--backend hono`, `--orm drizzle` or `--orm none`, `--runtime workers` -- **MongoDB**: Requires `--orm mongoose` or `--orm prisma` -- **Convex**: Forces `--no-auth`, `--database none`, `--orm none`, `--api none`, `--runtime none`, `--db-setup none`; sets `--examples todo`; Solid frontend is not supported with Convex -- **PWA**: Requires compatible web frontend -- **Tauri**: Requires compatible web frontend -- **AI Examples**: Not compatible with `--backend elysia` or `--frontend solid` -- **tRPC + Nuxt/Svelte/Solid**: Use `--api orpc` (tRPC is not supported with `nuxt`, `svelte`, or `solid`) -- **Todo Example**: Requires a database when a backend (other than Convex) is selected -- **Web Deploy**: `--web-deploy workers` requires selecting a web frontend -- **Examples with `--api none`**: Cannot select examples when `--api none` (unless `--backend convex`) -- **Runtime `none`**: Only allowed with `--backend convex` or `--backend none` -- **Mongoose ORM**: Requires `--database mongodb` -- **Drizzle ORM**: Not compatible with `--database mongodb` -- **Database requires ORM**: Selecting a database requires a non-`none` ORM -- **ORM requires database**: Selecting a non-`none` ORM requires a database -- **Auth requires database**: `--auth` requires a non-`none` database -- **DB Setup constraints**: - - `--db-setup turso` → requires `--database sqlite` - - `--db-setup neon` → requires `--database postgres` - - `--db-setup prisma-postgres` → requires `--database postgres` - - `--db-setup mongodb-atlas` → requires `--database mongodb` - - `--db-setup supabase` → requires `--database postgres` - - `--db-setup d1` → requires `--database sqlite` and `--runtime workers` - - `--db-setup docker` → not compatible with `--database sqlite` or `--runtime workers` - -The CLI will validate compatibility and show helpful error messages for invalid combinations. diff --git a/apps/web/content/docs/cli/add.mdx b/apps/web/content/docs/cli/add.mdx index 292f2f1..388a897 100644 --- a/apps/web/content/docs/cli/add.mdx +++ b/apps/web/content/docs/cli/add.mdx @@ -8,28 +8,61 @@ description: Add addons or deployment to an existing project ```bash - bun create better-t-stack@latest add [options] + bun create better-t-stack@latest add ``` ```bash - pnpm create better-t-stack@latest add [options] + pnpm create better-t-stack@latest add ``` ```bash - npx create-better-t-stack@latest add [options] + npx create-better-t-stack@latest add ``` -### Options +## Flags + +### Addons + +- `--addons` Multiple values to add features + - Values: `pwa`, `tauri`, `starlight`, `biome`, `husky`, `turborepo`, `fumadocs`, `ultracite`, `oxlint`, `none` + - Do not combine `none` with other values + +### Deployment -- `--addons` Multiple values - `--web-deploy` One of: `workers`, `none` -- `--project-dir` Path -- `--install` / `--no-install` + - Requires that the project includes a web frontend + +### Project directory and install + +- `--project-dir` Path to target project (default: current directory) +- `--install` / `--no-install` Install dependencies after applying changes - `--package-manager` One of: `bun`, `pnpm`, `npm` -See also: [Compatibility](/docs/compatibility) +## Examples + +```bash +# Add PWA and Turborepo to the current project +bun create better-t-stack@latest add --addons pwa turborepo --install +``` + +```bash +# Add Cloudflare Workers deployment +bun create better-t-stack@latest add --web-deploy workers +``` + +```bash +# Operate on a specific project directory using bun +bun create better-t-stack@latest add --project-dir ./apps/web --addons biome --package-manager bun +``` + +## Compatibility notes + +- Web deployment requires a web frontend to be present +- Addons must be compatible with the selected frontend; the CLI validates this and fails with a clear error if incompatible + +For general compatibility rules, see the main CLI reference. diff --git a/apps/web/content/docs/cli/builder.mdx b/apps/web/content/docs/cli/builder.mdx index 39df6b0..1d30afa 100644 --- a/apps/web/content/docs/cli/builder.mdx +++ b/apps/web/content/docs/cli/builder.mdx @@ -23,3 +23,4 @@ description: Open the web-based stack builder +This command has no flags. diff --git a/apps/web/content/docs/cli/docs.mdx b/apps/web/content/docs/cli/docs.mdx index f5902b2..649e3e7 100644 --- a/apps/web/content/docs/cli/docs.mdx +++ b/apps/web/content/docs/cli/docs.mdx @@ -23,3 +23,4 @@ description: Open the documentation +This command has no flags. diff --git a/apps/web/content/docs/cli/init.mdx b/apps/web/content/docs/cli/init.mdx index eb6bd22..f094019 100644 --- a/apps/web/content/docs/cli/init.mdx +++ b/apps/web/content/docs/cli/init.mdx @@ -31,5 +31,121 @@ You can pass `.` to use the current directory. bun create better-t-stack@latest my-app --yes ``` -See also: [Compatibility](/docs/compatibility) +## Flags Reference + +### General + +- `--yes, -y` Skip all prompts and use defaults +- `--help, -h` Show help +- `--version, -V` Show CLI version + +### Frontend + +- `--frontend` Choose one web frontend and optionally one native frontend + - Web: `tanstack-router`, `react-router`, `tanstack-start`, `next`, `nuxt`, `svelte`, `solid` + - Native: `native-nativewind`, `native-unistyles` + - Special: `none` + - Notes: At most one from each group; do not combine `none` with others + +### Backend + +- `--backend` One of: `hono`, `express`, `fastify`, `next`, `elysia`, `convex`, `none` + +### Runtime + +- `--runtime` One of: `bun`, `node`, `workers`, `none` + - `workers` only with `--backend hono` + - `none` only with `--backend convex` or `--backend none` + +### Database + +- `--database` One of: `sqlite`, `postgres`, `mysql`, `mongodb`, `none` + +### ORM + +- `--orm` One of: `drizzle`, `prisma`, `mongoose`, `none` + - `mongoose` requires `--database mongodb` + - `drizzle` is not compatible with `--database mongodb` + +### API + +- `--api` One of: `trpc`, `orpc`, `none` + - Use `orpc` with `nuxt`, `svelte`, or `solid` (tRPC not supported there) + +### Authentication + +- `--auth` Enable auth +- `--no-auth` Disable auth + - Auth requires a non-`none` database + +### Addons + +- `--addons` Multiple values: `pwa`, `tauri`, `starlight`, `biome`, `husky`, `turborepo`, `fumadocs`, `ultracite`, `oxlint`, `none` + - Do not combine `none` with other values + +### Examples + +- `--examples` Multiple values: `todo`, `ai`, `none` + - Do not combine `none` with other values + +### Database setup + +- `--db-setup` One of: `turso`, `neon`, `prisma-postgres`, `mongodb-atlas`, `supabase`, `d1`, `docker`, `none` + - `turso` → requires `--database sqlite` + - `neon`, `prisma-postgres`, `supabase` → require `--database postgres` + - `mongodb-atlas` → requires `--database mongodb` + - `d1` → requires `--database sqlite` and `--runtime workers` + - `docker` → not compatible with `--database sqlite` or `--runtime workers` + +### Web deployment + +- `--web-deploy` One of: `workers`, `none` + - Requires selecting a web frontend + +### Project setup + +- `--git` / `--no-git` Initialize git repository +- `--install` / `--no-install` Install dependencies +- `--package-manager` One of: `bun`, `pnpm`, `npm` + +## Examples + +```bash +# Full-stack web app +bun create better-t-stack@latest my-webapp \ + --frontend tanstack-router \ + --backend hono \ + --runtime bun \ + --database postgres \ + --orm drizzle \ + --api trpc \ + --auth \ + --db-setup neon \ + --addons pwa turborepo \ + --examples todo +``` + +```bash +# Cloudflare Workers +bun create better-t-stack@latest my-workers \ + --frontend tanstack-router \ + --backend hono \ + --runtime workers \ + --database sqlite \ + --orm drizzle \ + --db-setup d1 \ + --web-deploy workers +``` + +## Compatibility notes + +- Workers runtime only with `--backend hono` and `--orm drizzle` or `--orm none` +- MongoDB requires `--orm mongoose` or `--orm prisma` +- Convex backend forces: no auth, no db, no orm, no api, no runtime, no db-setup; Solid is not supported +- Todo example requires a database when a non-Convex backend is selected +- AI example is not compatible with `--backend elysia` or `--frontend solid` + +The CLI validates incompatible combinations and fails fast with clear messages. + +See also: Compatibility overview in the main CLI reference. diff --git a/apps/web/content/docs/cli/sponsors.mdx b/apps/web/content/docs/cli/sponsors.mdx index b44f1cc..4e8f802 100644 --- a/apps/web/content/docs/cli/sponsors.mdx +++ b/apps/web/content/docs/cli/sponsors.mdx @@ -23,3 +23,4 @@ description: View project sponsors +This command has no flags. diff --git a/apps/web/content/docs/index.mdx b/apps/web/content/docs/index.mdx index 05acb1f..8131476 100644 --- a/apps/web/content/docs/index.mdx +++ b/apps/web/content/docs/index.mdx @@ -5,93 +5,244 @@ description: Create your first Better-T-Stack project in minutes ## Philosophy -- With Better T Stack, you freely choose only the parts you want; nothing extra is added. -- Pick your frontend, backend, API layer, database, ORM, auth, addons — or skip any of them. Compatibility is enforced. -- No lock‑in: it’s a generator, not a framework fork. +- Roll your own stack: pick only what you need, nothing extra. +- Minimal templates: bare-bones scaffolds with zero bloat. +- Latest dependencies: always current and stable by default. +- Free and open source: forever. ## Get Started +### CLI (prompts) + + + + ```bash + bun create better-t-stack@latest + ``` + + + ```bash + pnpm create better-t-stack@latest + ``` + + + ```bash + npx create-better-t-stack@latest + ``` + + + +Follow the interactive prompts to choose your frontend, backend, database, ORM, API layer, and addons. + +Skip prompts and use the default stack: + + + + ```bash + bun create better-t-stack@latest my-app --yes + ``` + + + ```bash + pnpm create better-t-stack@latest my-app --yes + ``` + + + ```bash + npx create-better-t-stack@latest my-app --yes + ``` + + + + + ### Stack Builder (UI) - Visit [/new](/new) to pick your stack and copy the generated command - Or open it via: -```bash -bun create better-t-stack@latest builder -``` - -### CLI (prompts) - -```bash -bun create better-t-stack@latest -``` - -Follow the interactive prompts to choose your frontend, backend, database, ORM, API layer, and addons. - -Skip prompts and use the default stack: - -```bash -bun create better-t-stack@latest my-app --yes -``` - -Prefer a visual flow? Use the Stack Builder at [/new](/new) to pick your stack and copy the generated command. You can also open it via: - -```bash -bun create better-t-stack@latest builder -``` + + + ```bash + bun create better-t-stack@latest builder + ``` + + + ```bash + pnpm create better-t-stack@latest builder + ``` + + + ```bash + npx create-better-t-stack@latest builder + ``` + + ## Common Setups ### Default Stack -```bash -bun create better-t-stack@latest my-webapp \ - --frontend tanstack-router \ - --backend hono \ - --database sqlite \ - --orm drizzle \ - --auth \ - --addons turborepo -``` + + + ```bash + bun create better-t-stack@latest my-webapp \ + --frontend tanstack-router \ + --backend hono \ + --database sqlite \ + --orm drizzle \ + --auth \ + --addons turborepo + ``` + + + ```bash + pnpm create better-t-stack@latest my-webapp \ + --frontend tanstack-router \ + --backend hono \ + --database sqlite \ + --orm drizzle \ + --auth \ + --addons turborepo + ``` + + + ```bash + npx create-better-t-stack@latest my-webapp \ + --frontend tanstack-router \ + --backend hono \ + --database sqlite \ + --orm drizzle \ + --auth \ + --addons turborepo + ``` + + ### Convex + React -```bash -bun create better-t-stack@latest my-convex-app \ - --frontend tanstack-router \ - --backend convex -``` + + + ```bash + bun create better-t-stack@latest my-convex-app \ + --frontend tanstack-router \ + --backend convex + ``` + + + ```bash + pnpm create better-t-stack@latest my-convex-app \ + --frontend tanstack-router \ + --backend convex + ``` + + + ```bash + npx create-better-t-stack@latest my-convex-app \ + --frontend tanstack-router \ + --backend convex + ``` + + ### API Only -```bash -bun create better-t-stack@latest my-api \ - --frontend none \ - --backend fastify \ - --runtime node \ - --database postgres \ - --orm prisma \ - --api trpc -``` + + + ```bash + bun create better-t-stack@latest my-api \ + --frontend none \ + --backend fastify \ + --runtime node \ + --database postgres \ + --orm prisma \ + --api trpc + ``` + + + ```bash + pnpm create better-t-stack@latest my-api \ + --frontend none \ + --backend fastify \ + --runtime node \ + --database postgres \ + --orm prisma \ + --api trpc + ``` + + + ```bash + npx create-better-t-stack@latest my-api \ + --frontend none \ + --backend fastify \ + --runtime node \ + --database postgres \ + --orm prisma \ + --api trpc + ``` + + ### Mobile App (Expo) -```bash -bun create better-t-stack@latest my-native \ - --frontend native-nativewind \ - --backend hono \ - --database sqlite \ - --orm drizzle \ - --auth -``` + + + ```bash + bun create better-t-stack@latest my-native \ + --frontend native-nativewind \ + --backend hono \ + --database sqlite \ + --orm drizzle \ + --auth + ``` + + + ```bash + pnpm create better-t-stack@latest my-native \ + --frontend native-nativewind \ + --backend hono \ + --database sqlite \ + --orm drizzle \ + --auth + ``` + + + ```bash + npx create-better-t-stack@latest my-native \ + --frontend native-nativewind \ + --backend hono \ + --database sqlite \ + --orm drizzle \ + --auth + ``` + + ### Empty Monorepo -```bash -bun create better-t-stack@latest my-workspace \ - --frontend none \ - --backend none -``` + + + ```bash + bun create better-t-stack@latest my-workspace \ + --frontend none \ + --backend none + ``` + + + ```bash + pnpm create better-t-stack@latest my-workspace \ + --frontend none \ + --backend none + ``` + + + ```bash + npx create-better-t-stack@latest my-workspace \ + --frontend none \ + --backend none + ``` + + ## Flags Cheat Sheet