> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elata.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Elata Demo

> Scaffold Elata starter apps from published templates.

## What This Package Is

`@elata-biosciences/create-elata-demo` is a CLI scaffolder that generates ready-to-run Elata web apps.

Use it when you want a clean scaffolded app or a consumer-facing reference project.

***

## When To Use It

Use this package when you want:

* the fastest path to a working Elata app
* a reference project that matches the published package surface
* a known-good baseline before integrating packages into an existing app

Do not start with repo-internal demos when this package already covers your use case.

***

## Templates

The scaffolder exposes three user-facing app starters:

| Template    | Description                                                                     |
| ----------- | ------------------------------------------------------------------------------- |
| `rppg-demo` | React + Vite rPPG starter app                                                   |
| `eeg-demo`  | React + Vite EEG starter app with synthetic data and browser EEG wiring         |
| `eeg-ble`   | Muse-compatible EEG starter with Chrome or Bluefy-on-iOS Web Bluetooth guidance |

Short aliases are also supported:

| Alias  | Resolves to |
| ------ | ----------- |
| `rppg` | `rppg-demo` |
| `eeg`  | `eeg-demo`  |
| `ble`  | `eeg-ble`   |
| `ble`  | `eeg-ble`   |

***

## Install And Invocation

This package is usually invoked without installing it permanently:

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm create @elata-biosciences/elata-demo my-app
  pnpm dlx @elata-biosciences/create-elata-demo my-app
  ```

  ```bash npm theme={null}
  npm create @elata-biosciences/elata-demo my-app
  npx @elata-biosciences/create-elata-demo my-app
  ```
</CodeGroup>

***

## List Available Templates

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm dlx @elata-biosciences/create-elata-demo -- --list-templates
  ```

  ```bash npm theme={null}
  npx @elata-biosciences/create-elata-demo -- --list-templates
  ```
</CodeGroup>

***

## Recommended Usage

<CodeGroup>
  ```bash pnpm theme={null}
  # Interactive template chooser
  pnpm create @elata-biosciences/elata-demo my-app

  # rPPG starter app (alias)
  pnpm create @elata-biosciences/elata-demo my-app -- --template rppg

  # EEG starter app
  pnpm create @elata-biosciences/elata-demo my-app -- --template eeg-demo

  # EEG starter app (alias)
  pnpm create @elata-biosciences/elata-demo my-app -- --template eeg

  # EEG starter app with BLE alias
  pnpm create @elata-biosciences/elata-demo my-app -- --template eeg-ble

  # Short BLE alias
  pnpm create @elata-biosciences/elata-demo my-app -- --template ble
  ```

  ```bash npm theme={null}
  # Interactive template chooser
  npm create @elata-biosciences/elata-demo my-app

  # rPPG starter app (alias)
  npm create @elata-biosciences/elata-demo my-app -- --template rppg

  # EEG starter app
  npm create @elata-biosciences/elata-demo my-app -- --template eeg-demo

  # EEG starter app (alias)
  npm create @elata-biosciences/elata-demo my-app -- --template eeg

  # EEG starter app with BLE alias
  npm create @elata-biosciences/elata-demo my-app -- --template eeg-ble

  # Short BLE alias
  npm create @elata-biosciences/elata-demo my-app -- --template ble
  ```
</CodeGroup>

When the CLI is run interactively without `--template`, it prompts you to pick a template. In non-interactive runs, it falls back to `rppg-demo`.

If you omit the project directory, the CLI also prompts for the project name.

***

## What You Get

Each generated app includes:

* a minimal Vite + React app shell
* Elata packages pinned to a compatible set of versions
* a template-specific `README.md`
* a `build` script that type-checks and runs `vite build`

After scaffolding:

<CodeGroup>
  ```bash pnpm theme={null}
  cd my-app
  pnpm install
  pnpm run dev
  ```

  ```bash npm theme={null}
  cd my-app
  npm install
  npm run dev
  ```
</CodeGroup>

***

## What Happens Behind The Scenes

The scaffolder binary:

1. Prompts for the app type first when running interactively without `--template`
2. Prompts for `projectName` when missing
3. Validates the selected starter name
4. Copies the chosen template into the target directory
5. Renames `_gitignore` to `.gitignore`
6. Rewrites placeholders like `__APP_NAME__` and package-version placeholders

***

## Workspace Caveat

If you scaffold a new app inside another `pnpm` workspace and that app is not added to the workspace globs, run this from the parent directory:

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm --dir my-app --ignore-workspace install
  pnpm --dir my-app --ignore-workspace run dev
  ```

  ```bash npm theme={null}
  cd my-app
  npm install
  npm run dev
  ```
</CodeGroup>

***

## Repo Verification

The package is tested from the repo with:

```bash theme={null}
pnpm --dir packages/create-elata-demo test
./run.sh test create-elata-demo
```

The second command also smoke-tests each template by scaffolding, installing dependencies, and running a build.

***

## When To Use The Scaffolder vs. Examples

| If you want...                                                       | Use                                                        |
| -------------------------------------------------------------------- | ---------------------------------------------------------- |
| A clean, self-contained scaffolded app with pinned deps              | `create-elata-demo`                                        |
| A full product-shaped reference with routing, game loops, and charts | [Example Apps](/sdk/guides/example-apps)                   |
| To modify the SDK itself                                             | In-repo dev demos (`eeg-demo/`, `packages/rppg-web/demo/`) |

***

## Next

<CardGroup cols={3}>
  <Card title="Build Your First App" icon="rocket" iconType="light" href="/sdk/tutorials/first-app">
    Scaffold and run a starter app
  </Card>

  <Card title="Choose A Package" icon="compass" iconType="light" href="/sdk/guides/choose-the-right-package">
    Package decision guide
  </Card>

  <Card title="Example Apps" icon="grid-2" iconType="light" href="/sdk/guides/example-apps">
    Full reference implementations
  </Card>
</CardGroup>
