# Commands (/docs/starter/commands)

Run these from the repository root.

## Develop and build [#develop-and-build]

| Command             | Purpose                                        |
| ------------------- | ---------------------------------------------- |
| `pnpm dev`          | Start the web app in development mode.         |
| `pnpm build`        | Create a production build.                     |
| `pnpm start`        | Start the production build.                    |
| `pnpm lint`         | Run ESLint, then each app's own lint script.   |
| `pnpm typecheck`    | Typecheck the workspaces.                      |
| `pnpm test`         | Run Vitest, then each app's own tests.         |
| `pnpm test:watch`   | Run Vitest in watch mode.                      |
| `pnpm test:e2e`     | Run Playwright browser checks.                 |
| `pnpm test:e2e:ui`  | Open the browser checks in Playwright's UI mode. |
| `pnpm format`       | Format supported repository files.             |
| `pnpm format:check` | Check formatting without writing files.        |

In a project with a [frontend and its API](../cli/frontend-and-api.mdx), `pnpm dev` and `pnpm start` start the API too, on port 3001, and the frontend forwards `/api` to it. `pnpm lint`, `pnpm typecheck`, and `pnpm test` also run the API's own scripts: with FastAPI, ruff, mypy, and pytest through uv.

In a project [without a website](../cli/without-a-website.mdx), `pnpm dev` and `pnpm start` run the API alone, on port 3001, and there are no browser checks: no `pnpm test:e2e` or `pnpm test:e2e:ui`.

Playwright's first run may require installing Chromium with `pnpm exec playwright install chromium`. CI runs the browser checks automatically.

## Database [#database]

| Command            | Purpose                                        |
| ------------------ | ---------------------------------------------- |
| `pnpm db:generate` | Generate Drizzle migrations from the schemas.  |
| `pnpm db:migrate`  | Apply checked-in Drizzle migrations.           |
| `pnpm db:push`     | Push schema directly (local development only). |
| `pnpm db:studio`   | Open Drizzle Studio.                           |
| `pnpm db:check`    | Check migration consistency.                   |
| `pnpm db:seed`     | Seed the configured database.                  |

See [Database](./database.mdx).

## Docker [#docker]

| Command             | Purpose                                                                  |
| ------------------- | ------------------------------------------------------------------------ |
| `pnpm docker:dev`   | Build and start `docker-compose.yml` (with a separate API, both images). It names the file, so a `compose.yaml` from `pnpm clubedge deploy` doesn't take its place (Starter v0.27.0). |
| `pnpm docker:build` | Build the production image from the root `Dockerfile`.                  |
| `pnpm docker:start` | Run that image on port 3000 with `apps/web/.env.local`.                  |

Without a website, `pnpm docker:dev` runs the API alone, on port 3001, and there is no `docker:build` or `docker:start`: the image is `apps/api/Dockerfile`. See [Docker](./docker.mdx).

## Local services [#local-services]

`pnpm check:services` checks every configured service with a real round trip. `pnpm check:env` checks that the environment has every production variable the project's modules need, without connecting to anything; Vercel and Netlify builds run it first ([Vercel](./deploy/vercel.mdx), [Netlify](./deploy/netlify.mdx)). With a separate API, both run the API's own checks. The `infra:*` commands depend on your [local services](./local-services.mdx) choice:

<Tabs items={['Docker', 'Supabase CLI', 'No Docker (local)']} groupId="infra" persist>
  <Tab value="Docker">
    - `pnpm infra:up` and `pnpm infra:down`: start and stop the local services from `docker-compose.dev.yml`.
    - `pnpm infra:reset`: stop them and delete their data. `pnpm infra:logs` follows their logs.
  </Tab>
  <Tab value="Supabase CLI">
    - `pnpm infra:up` and `pnpm infra:down`: start and stop the local Supabase stack.
    - `pnpm infra:status`: print its URLs and keys. `pnpm infra:reset` stops it and deletes its data.
  </Tab>
  <Tab value="No Docker (local)">
    - `pnpm infra:up`: run only the local database, for example for `pnpm check:services` or browser tests.
    - `pnpm infra:reset`: delete the local database and files in `.data/` (stop `pnpm dev` first).
  </Tab>
</Tabs>

Some modules add a service to run next to `pnpm dev`:

- `pnpm auth:dev`, with `--auth firebase`: start Firebase's Auth Emulator on port 9099. See [Authentication](./modules/auth.mdx).
- `pnpm jobs:dev`, with `--jobs inngest`: start Inngest's Dev Server on port 8288. See [Background jobs](./modules/jobs.mdx).

With Neon there is nothing to start: `pnpm clubedge neon` shows the database's status, `neon claim` keeps it, and `neon create` makes a new one. See [A database on Neon](../cli/neon.mdx).

## The mobile app [#the-mobile-app]

In a project with a [mobile app](./mobile-app.mdx) (`--shell capacitor`):

| Command | Purpose |
| --- | --- |
| `pnpm --filter @clubedge/shell android` | Build the app for Android and open it in Android Studio. The first run creates `apps/shell/android`. |
| `pnpm --filter @clubedge/shell ios` | The same for iOS and Xcode, on a Mac. The first run creates `apps/shell/ios`. |
| `pnpm --filter @clubedge/shell sync` | Copy a new build of the web app into the native projects. |

Add `--demo` to any of these for the demo: sample data on the device, and no server.

## The native app [#the-native-app]

In a project with the [native app](./native-app.mdx) (`--mobile expo`):

| Command | Purpose |
| --- | --- |
| `pnpm --filter @clubedge/mobile-app android` | Build the app, install it on the Android emulator or a phone, and start Expo's dev server. The first run generates `apps/mobile/android`. |
| `pnpm --filter @clubedge/mobile-app ios` | The same for iOS, on a Mac. The first run generates `apps/mobile/ios`. |
| `pnpm --filter @clubedge/mobile-app start` | Start the dev server for the app already installed. |
| `pnpm --filter @clubedge/mobile-app prebuild` | Generate `android/` and `ios/` from `app.config.ts`, to build a release in Android Studio or Xcode. |

In development, the app calls the API that `pnpm dev` serves, so start it first.

## The project itself [#the-project-itself]

| Command                              | Purpose                                                                                       |
| ------------------------------------ | --------------------------------------------------------------------------------------------- |
| `pnpm clubedge status`               | The project's Starter release, modules, and Git state, and the command to run next.          |
| `pnpm clubedge doctor`               | Check Node.js, pnpm, dependencies, the lockfile, and the env file, then `pnpm check:services`. |
| `pnpm clubedge add <module> <option>` | Add a module or switch its option.                                                           |
| `pnpm clubedge remove <module>`      | Remove one or more modules.                                                                   |
| `pnpm clubedge upgrade`              | Move the project to the newest Starter release.                                               |
| `pnpm clubedge deploy`               | Deploy to the project's platform, creating what it runs on the first time.                    |

See [Check a project](../cli/check-a-project.mdx), [Change a project](../cli/change-a-project.mdx), and [Deploy](../cli/deploy/index.mdx).
