# Without a website (/docs/cli/without-a-website)

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

`--framework none` leaves the website out: the project is its API, Hono or FastAPI, in `apps/api`, with or without the [native app](../starter/native-app.mdx) in `apps/mobile`, which calls the API directly. It needs CLI 0.44.0 and Starter v0.28.0.

## Choose it [#choose-it]

A project needs a web app or an API, so `--framework none` needs `--api hono` or `--api fastapi`:

| Flags | Apps |
| --- | --- |
| `--framework none --api hono` | The Hono API, in TypeScript |
| `--framework none --api fastapi` | The FastAPI API, in Python, managed with [uv](https://docs.astral.sh/uv/) |
| `--mobile expo`, with either | The [native app](../starter/native-app.mdx), which calls the API at its own address |

```text
A project needs a web app or an API: choose one with --framework or --api.
```

Interactive runs offer None after the frameworks, then ask **Which API should the apps call?** and **Add a native mobile app?**. The [mobile app](../starter/mobile-app.mdx) (`--shell capacitor`) packages a website's pages, so it isn't offered. In the [builder](https://starter.clubedge.live/builder?preset=api-native), pick No website as the framework.

The project's `package.json` records `"framework": "none"`, so `add`, `remove`, and `upgrade` keep it without a website, and the commands that manage env files leave `apps/web/.env.local` out.

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

<Files>
  <Folder name="apps" defaultOpen>
    <Folder name="api" defaultOpen>
      <Folder name="src" />
      <File name=".env.local" />
      <File name="Dockerfile" />
    </Folder>
    <Folder name="mobile" />
  </Folder>
  <Folder name="packages" defaultOpen>
    <Folder name="contract" />
    <Folder name="core" />
    <Folder name="db" />
    <File name="… one package per module you chose" />
  </Folder>
  <File name="docker-compose.yml" />
  <File name="SETUP.md" />
  <File name="package.json" />
</Files>

- **`apps/api`**: the API, package `@clubedge/api`, as in a [frontend and its API](./frontend-and-api.mdx#what-you-get). It owns the database and the modules, and reads `apps/api/.env.local`, the project's env file; the database commands read `DATABASE_URL` there.
- **`packages/contract`**: the contract the API implements, `openapi.yaml`, the client generated from it, which the native app calls the API with, and the conformance suite.
- **`apps/mobile`**, with `--mobile expo`: the native app, with its own `.env.local`.
- No `apps/web`, root `Dockerfile`, `packages/ui`, or browser tests (`e2e/`): there are no pages. The project's name lives in the API's site config, `apps/api/src/config/site.json`, and in the native app's copy.

`SETUP.md` has a section on it, "Without a website".

## Run it [#run-it]

```sh
pnpm dev
```

`pnpm dev` starts the API on port 3001, and `pnpm start` serves its production build there. In development, the API listens on every interface (`HOST=0.0.0.0` in `apps/api/.env.local`), so a phone or another device on the same network reaches it at your computer's address. Its liveness endpoint is [http://localhost:3001/api/health](http://localhost:3001/api/health).

- `pnpm check:services` and `pnpm check:env` check the API, and `pnpm clubedge doctor` checks `apps/api/.env.local` against its example.
- `pnpm docker:dev` runs the API alone in Docker Compose, on the same port.
- `pnpm test:e2e`, `pnpm docker:build`, and `pnpm docker:start` belong to a website, so the project doesn't have them.

With the API running, `pnpm --filter @clubedge/mobile-app android` (or `ios`) builds the native app and starts it on an emulator or a phone: see [Set it up](../starter/native-app.mdx#set-it-up).

## Modules without a website [#modules-without-a-website]

The API runs the modules as it does next to a website ([Modules on these stacks](./frontend-and-api.mdx#modules-on-these-stacks)), but a few options need the website. The Starter's rules refuse them, and the CLI says why:

| Refused | Why | Instead |
| --- | --- | --- |
| `--payments stripe` | Checkout and the customer portal send users back to the website's pages. | `--payments none`, or a web app |
| `--jobs inngest` | Inngest reaches the jobs through the website's address. | `--jobs pg-boss` or `bullmq`, which run in the API; with FastAPI, `bullmq` |
| `--auth better-auth` with `--api fastapi` | Without a website, Better Auth runs in the API, and FastAPI can't run it. | `--api hono`, or another `--auth` |
| `--deploy fly`, `vercel`, `netlify`, or `render` | They deploy a web app, and the project has only its API. | `--deploy docker` or `railway` |

```text
Payments send users back to the website's pages, and a project without a website has none: choose --payments none, or a web app with --framework.
```

Prompts, the builder, and `add` only offer what the rules allow, and a module left to its default gives way to the first option they allow. With the native app, sign-in is also limited to what it implements: Supabase Auth, Better Auth, or none.

## Sign-in [#sign-in]

<Tabs items={['Better Auth', 'Supabase Auth', 'Firebase', 'Appwrite']} groupId="auth" persist>
  <Tab value="Better Auth">
    Better Auth runs in the Hono API, which serves it at `/api/auth`, once `BETTER_AUTH_SECRET` is set in `apps/api/.env.local`: at least 32 random characters, such as the output of `openssl rand -hex 32`. `pnpm check:env` refuses a shorter one, and until it is set, no one can sign in. `BETTER_AUTH_URL` is the API's public URL, `http://localhost:3001` in development.

    It trusts the native app's address scheme, so the app signs in there. With an [email module](../starter/modules/email.mdx), Better Auth's emailed links open the app: confirming a new account opens its sign-in screen, and a password reset link opens its reset screen.
  </Tab>
  <Tab value="Supabase Auth">
    The API checks the access token each request carries with Supabase: set `SUPABASE_URL` and `SUPABASE_PUBLISHABLE_KEY` in `apps/api/.env.local`, and `SUPABASE_SECRET_KEY` to let users delete their account. The native app signs in with Supabase itself, with the same project's settings.

    For Supabase's emailed links to open the native app, add its address scheme to the Redirect URLs in Supabase's URL configuration, such as `my-product://**`, where `my-product` comes from the site config's `serviceId`.
  </Tab>
  <Tab value="Firebase">
    Clients sign users in with Firebase's SDK and send the ID token with each request (`Authorization: Bearer <token>`). The API verifies it, and accepts only confirmed email addresses. In development, `pnpm auth:dev` starts the Auth Emulator: point the API at it with `FIREBASE_PROJECT_ID=demo-clubedge` and `FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099`. The native app doesn't sign in with Firebase, so this is for clients of your own.
  </Tab>
  <Tab value="Appwrite">
    Clients sign users in with Appwrite's SDK and send a JWT from it with each request (`Authorization: Bearer <token>`). The API checks it with Appwrite, and accepts only confirmed email addresses. The native app doesn't sign in with Appwrite, so this is for clients of your own.
  </Tab>
</Tabs>

The API keeps the account endpoints: the display name and account deletion, which checks the password, removes the user's app data, then deletes the user from the provider. Passwords change with the provider. With the native app, its settings screen uses them.

## Deploy [#deploy]

`pnpm clubedge deploy` publishes the API itself, as the project's one public service:

<Tabs items={['Docker', 'Railway']} groupId="deploy" persist>
  <Tab value="Docker">
    With `--deploy docker`, `deploy` writes a `compose.yaml` whose one app is the API, `api`, behind [Caddy](https://caddyserver.com), which serves it at your `DOMAIN` over HTTPS and passes the client's address to it (`TRUSTED_PROXY_HOPS=1`). With Better Auth, the API gets `BETTER_AUTH_URL`, `https://$DOMAIN` unless `.env.production` sets another. Put the variables of `apps/api/.env.example` in `.env.production`, then migrate with the API's image and start:

    ```sh
    docker compose --env-file .env.production run --rm api node /app/migrate.mjs
    docker compose --env-file .env.production up -d   # --build builds the image on the server
    ```

    See [Docker Compose](./deploy/docker.mdx).
  </Tab>
  <Tab value="Railway">
    With `--deploy railway`, `deploy` creates one service, `<package>-api`, built from `apps/api/Dockerfile`, with the public `*.up.railway.app` domain the native app calls, and Postgres unless your env file points elsewhere. The migrations run before each release. It sets `CLIENT_IP_HEADER=x-real-ip`, and with Better Auth a generated `BETTER_AUTH_SECRET` and the service's public URL as `BETTER_AUTH_URL`. See [Railway](./deploy/railway.mdx#without-a-website).
  </Tab>
</Tabs>

For the native app's release builds, set its `EXPO_PUBLIC_API_URL` to the API's `https://` address.

Fly.io, Vercel, Netlify, and Render deploy a web app, so the CLI refuses them for a project without one. `deploy --preview` deploys a web app only, so it refuses too, and prints how to copy production's Railway environment instead.

## The contract [#the-contract]

The API implements `packages/contract/openapi.yaml` and passes the [conformance suite](./frontend-and-api.mdx#prove-an-api), as next to a website. To change it, edit the contract first, regenerate the client with `pnpm --filter @clubedge/contract generate`, then implement the change in the API.

Installed apps keep calling the contract they shipped with, so the CI's `contract` job fails a pull request that breaks it, and `GET /api/app-version` tells them when to update: see [Apps installed on phones](./frontend-and-api.mdx#apps-installed-on-phones). CI also serves the API's production build and checks `/api/health` on port 3001, then builds the API's image, runs its migrations, and checks the image the same way.
