# Setup

> Learn how to set up your Nuxt Starter Kit application.

<steps level="3">

### Install dependencies

```bash
pnpm install
```

### Setup environment variables

Define your environment variables in the `.env` file. You can use the `.env.example` file as a reference. The starter kit uses [@t3-oss/env-nuxt](https://www.npmjs.com/package/@t3-oss/env-nuxt) to typecheck the environment variables.

Required environment variables:

- `NUXT_PRIVATE_DATABASE_URL` - PostgreSQL connection string
- `BETTER_AUTH_SECRET` - Secret for better-auth session encryption
- `BETTER_AUTH_URL` - Your app URL (e.g., `http://localhost:9009` for local dev)

Optional but recommended:

- `NUXT_PRIVATE_POLAR_ACCESS_TOKEN` - For payment integration
- `NUXT_PRIVATE_POLAR_ORGANIZATION_ID` - Your Polar organization ID
- OAuth credentials for social login (Google, GitHub)

### Create database schema

Generate and apply database migrations:

```bash
pnpm db:generate  # Generate migrations from schema
pnpm db:migrate   # Apply migrations to database
```

### Start the development server

Start the development server for the web app:

```bash
pnpm dev:web
```

You can now access your app at `http://localhost:9009`.

### Polar

Nuxt Starter Kit uses [Polar](https://polar.sh/) to accept payments, see [Payments](/docs/payments) for more information.

This starter kit is designed to support subscriptions (free & Pro) and lifetime deals. You should configure three products in Polar:

- Pro Plan (yearly subscription)
- Pro Plan (monthly subscription)
- Lifetime Deal (one-time payment)

<note>

Any other product constellation needs adjustments in the `packages/layer-payment` layer and other parts of the codebase.

</note>
</steps>
