# Create a project (/docs/cli/create-a-project)

```npm
npx @clubedge/create-clubedge-app my-app
```

Without a destination, the CLI asks where to create the project. Interactive runs then ask for a framework and whether to customize the modules. Pass flags to skip the questions.

<Callout>
  Prefer to pick in a page? The [builder](https://starter.clubedge.live/builder) shows every module and option, applies the same requirements as the CLI, and gives you the command to copy.
</Callout>

## Choose a framework [#choose-a-framework]

The Starter ships the same application for two full-stack React frameworks, and a React + Vite frontend that calls a separate API, or no website at all. Next.js is the default; pick another with `--framework`, or choose interactively:

```npm
npx @clubedge/create-clubedge-app my-app --framework tanstack-start
```

| `--framework`    | App                                         | Production output             |
| ---------------- | ------------------------------------------- | ----------------------------- |
| `next`           | Next.js App Router                          | Next.js standalone build      |
| `tanstack-start` | TanStack Start with Vite                    | Nitro `.output` server bundle |
| `vite`           | React + Vite single-page app, with `--api`  | Static files served by a Node server (`node server.mjs`) that forwards `/api` to the API |
| `none`           | No website: the API alone, with `--api` (CLI 0.44.0 or newer) | The API's image ([Without a website](./without-a-website.mdx)) |

Next.js and TanStack Start are full-stack: the app lives in `apps/web` and uses the same shared packages, so the project layout, root scripts, and Docker commands are identical.

### A frontend and its API [#a-frontend-and-its-api]

`--framework vite` is a frontend: it needs a separate API in `apps/api`, chosen with `--api hono` (TypeScript) or `--api fastapi` (Python). A full-stack framework has its own server, so it takes no `--api`.

```npm
npx @clubedge/create-clubedge-app my-app --framework vite --api fastapi
```

The two apps meet at one HTTP contract, and deploy is `docker` or `railway`. With either API, every option of the other modules works, with the same defaults as Next.js, except `--jobs pg-boss` with FastAPI, since pg-boss has no Python version. See [A frontend and its API](./frontend-and-api.mdx).

### A mobile app [#a-mobile-app]

With CLI 0.42.0 or newer, `--shell capacitor` also packages the React + Vite frontend as an Android and iOS app with Capacitor, in `apps/shell`. It needs `--framework vite` and its API; Next.js and TanStack Start render their pages on their own server, so they can't be packaged. Interactive runs ask for it after the frontend and its API.

```npm
npx @clubedge/create-clubedge-app my-app --framework vite --api hono --shell capacitor
```

The app calls the API through your deployed website and keeps its session on the device. See [The mobile app](../starter/mobile-app.mdx).

### A native app [#a-native-app]

With CLI 0.44.0 and Starter v0.28.0, `--mobile expo` adds a native Android and iOS app built with Expo and React Native, in `apps/mobile`. It has its own screens and calls the same API with the contract client, so it needs `--api hono` or `--api fastapi`, with `--framework vite`, where it calls the API through the website, or `--framework none`, where it calls the API directly. Next.js and TanStack Start have no separate API for it to call. Interactive runs ask for it after the API.

```npm
npx @clubedge/create-clubedge-app my-app --framework vite --api hono --mobile expo
```

It signs in with Supabase Auth or Better Auth, or has no sign-in, and a project can have it next to the mobile app. See [The native app](../starter/native-app.mdx).

### Without a website [#without-a-website]

With CLI 0.44.0 and Starter v0.28.0, `--framework none` leaves the website out: the project is its API, with or without the native app, which then calls the API directly.

```npm
npx @clubedge/create-clubedge-app my-app --framework none --api hono --mobile expo
```

`pnpm dev` runs the API on port 3001. Payments and Inngest need a website, so the CLI refuses them; Better Auth then runs in the API, so it needs Hono; and the API deploys with `docker` or `railway`. See [Without a website](./without-a-website.mdx).

## Choose modules [#choose-modules]

Authentication, file storage, caching, email, payments, background jobs, observability, local infrastructure, and deployment are modules. Each has a default, and anything you leave out is removed completely. See [Modules](./modules.mdx) for every option.

```npm
# Only the monorepo, UI, database, and tooling
npx @clubedge/create-clubedge-app my-app --auth none --storage none --cache memory --email none

# A SaaS starting point: your own auth, payments, and background jobs, no Docker needed
npx @clubedge/create-clubedge-app my-app --auth better-auth --payments stripe --jobs pg-boss --infra local
```

## Preview, script, and reproduce [#preview-script-and-reproduce]

The target directory must be empty or not exist. The CLI never deletes or overwrites existing files, and if scaffolding fails it removes whatever it wrote, so a failed run leaves nothing behind.

```npm
# Preview the files and edits without writing anything
npx @clubedge/create-clubedge-app my-app --dry-run

# Non-interactive, for scripts and CI
npx @clubedge/create-clubedge-app my-app --yes --no-git --framework tanstack-start

# Try an unreleased Starter change
npx @clubedge/create-clubedge-app my-app --ref main

# Reproduce a specific Starter release or commit
npx @clubedge/create-clubedge-app my-app --ref v0.23.0
npx @clubedge/create-clubedge-app my-app --ref <commit-sha>

# Test local Starter changes before releasing them
npx @clubedge/create-clubedge-app my-app --template-dir ../clubedge-starter
```

All flags are listed in the [command reference](./reference.mdx).

## What you get [#what-you-get]

- A pnpm and Turborepo monorepo with the web app in `apps/web` (the API in `apps/api` with `--api`, the native app in `apps/mobile` with `--mobile`, and the mobile app in `apps/shell` with `--shell`) and the shared packages for your modules under `packages/`. A project without a website has no `apps/web`. See [Project structure](../starter/project-structure.mdx).
- `apps/web/.env.local` (and `apps/api/.env.local` with `--api`, `apps/mobile/.env.local` with `--mobile`, `apps/shell/.env.local` with `--shell`), created from the examples and pointing at the local services you chose. [Environment](../starter/environment.mdx) describes every variable.
- With a website, a landing page named after your project at `/`, and the dashboard at `/dashboard`.
- An initialized Git repository and installed dependencies, unless you pass `--no-git` or `--no-install`.
- The project's origin: CLI version, Starter repository, ref, commit, framework, and modules, recorded in `package.json` and `README.md`. The CLI uses it later to [change or upgrade the project](./change-a-project.mdx). The project's own `version` starts at `0.1.0` (CLI 0.41.0 or newer), and later changes keep it.
