# Create your first Ovok app

Canonical page: https://docs.ovok.com/get-started/quickstart

<Effort complexity={1} clients="Web, React Native" time="10 minutes" />

`create-ovok` sets up a Turborepo with a web app, a mobile app or both, already connected to your Ovok project. The
web app signs a practitioner in and lists the project's patients, so you can see data flow end to end before you
write any code.

## Set up [Console] [#set-up-console]

You need:

- Node.js 22 or newer and [pnpm](https://pnpm.io/installation).
- An Ovok project and its tenant code. [Set up your project](/authentication/project-setup) shows where to find it.
- A practitioner account in that project, to sign in to the web app.
- For the mobile app, Xcode or Android Studio to build the development client.

## Create the workspace [Terminal] [#create-the-workspace-terminal]

Run `create-ovok` with the name of your workspace folder:

```bash title="Terminal"
pnpm create ovok my-app
```

It asks for the apps you want and your tenant code, then installs dependencies and makes the first git commit. The
recommended setup creates a web app and a mobile app for iOS and Android, pointed at the sandbox.

Flags answer the questions up front, which is useful in scripts:

| Flag | Answers |
| --- | --- |
| `--platform web\|mobile\|mobile-web` | The apps to start with |
| `--type ios\|android` | One mobile platform instead of both |
| `--tenant {{TENANT_CODE}}` | Your Ovok tenant code |
| `--base-url https://api.sandbox.ovok.com` | The Ovok API URL |
| `--yes` | Every other question, with the recommended setup |
| `--skip-install` | Leaves `pnpm install` to you |
| `--disable-git` | Leaves the folder without a git repository |

The result:

- `apps/` holds the apps you chose.
- `.env` sets `OVOK_BASE_URL` and `OVOK_TENANT_CODE` for every app.
- `.mcp.json` registers the Ovok MCP server, so coding agents in the workspace can read your project.
- Each app has an `AGENTS.md` with the Ovok rules for coding agents, and a `CLAUDE.md` that imports it.

## Start the web app [Client-side] [#start-the-web-app-client-side]

```bash title="Terminal"
cd my-app
pnpm dev
```

The web app creates one client for the whole app from `.env`:

```ts title="apps/web/src/ovok.ts"
import { Ovok } from '@ovok/core/next';

export const ovok = new Ovok({
  baseUrl: import.meta.env.OVOK_BASE_URL,
  tenantCode: import.meta.env.OVOK_TENANT_CODE,
  fhirPath: '/fhir/R4/',
});
```

Sign in with your practitioner's email and password. The app calls `ovok.auth.login` and then searches the project's
`Patient` resources.

### Verify your integration [#verify-your-integration]

You should see a list of up to 10 patients from your project, or an empty list in a new project. If you don't:

1. Check that `.env` has your tenant code and `https://api.sandbox.ovok.com`.
2. Check that the account is a practitioner in that project.
3. Look up the error the app shows in [Errors](/errors).

## Start the mobile app [Client-side] [#start-the-mobile-app-client-side]

The mobile app runs in an Expo development client, which you build once per platform:

```bash title="Terminal"
cd apps/mobile
pnpm ios      # or: pnpm android
```

After the first build, `pnpm dev` starts the bundler and the installed client reloads as you edit.

## Test your integration [#test-your-integration]

1. Start the web app and sign in as a practitioner.
2. Create a patient in the project, for example with the [Slim API](/slim-apis/patient/create-patient).
3. Sign in again and check the new patient appears.

| Scenario | How to trigger it | Expected result |
| --- | --- | --- |
| Signed in | Valid practitioner email and password | The patient list |
| Wrong password | Any other password | An error message; no list |
| Second factor needed | An account with MFA on | A note to finish with `ovok.auth.verifyMfa` |

## Optional: Grow the workspace [Terminal] [#optional-grow-the-workspace-terminal]

Add apps and shared code with the generators `create-ovok` installed:

```bash title="Terminal"
pnpm turbo gen app       # add a web or mobile app
pnpm turbo gen package   # add a shared package
pnpm turbo gen agents    # refresh the Ovok rules in every AGENTS.md
```

## See also [#see-also]

- [Set up your project](/authentication/project-setup)
- [JavaScript SDK](/web-sdk)
- [React Native SDK](/native-sdk)
- [Build with AI agents](/working-with-ai-agents)
