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

# Local Development

> Get your local dev environment up and running

Local development is fully supported and straightforward. You'll be running the app on your machine in just a few minutes.

## Quick Start

<Steps>
  <Step title="Make sure you have the prerequisites">
    You need:

    * **Node.js 20.9+**
    * **pnpm** as your package manager
    * A **PostgreSQL database** (local or hosted -- see below)
  </Step>

  <Step title="Run the bootstrap wizard">
    ```bash theme={null}
    pnpm bootstrap
    ```

    This single command does a lot for you: it checks your Node version, runs `pnpm install`, walks you through setting your env vars, runs `pnpm db:migrate` as soon as your `DATABASE_URL` is confirmed, and then saves the rest of your config.
  </Step>

  <Step title="Start the dev server">
    ```bash theme={null}
    pnpm dev
    ```

    Open [http://localhost:3000](http://localhost:3000) and you're in business.
  </Step>
</Steps>

## Database Setup

<Info>
  **Supabase PostgreSQL** is the recommended default for both local dev and production. It's free to start and works great with this stack.
</Info>

Other PostgreSQL hosts that work well: Neon, Railway, Render, Fly, or self-hosted Postgres. Just make sure they support the extensions your enabled features need.

### Database Workflow

Your day-to-day database commands:

<CodeGroup>
  ```bash Apply migrations theme={null}
  pnpm db:migrate
  ```

  ```bash Generate new migration (after schema edits) theme={null}
  pnpm db:generate
  ```
</CodeGroup>

* **Schema source of truth:** `lib/db/schema/*`
* **Migration history:** `drizzle/*`

<Tip>
  The typical flow: edit your schema files in `lib/db/schema/`, then run `pnpm db:generate` to create the SQL migration, then `pnpm db:migrate` to apply it.
</Tip>

## What You Need for Each Feature

Not every feature works with zero config. Here's what different features need:

<AccordionGroup>
  <Accordion title="Core (always needed)">
    * `DATABASE_URL` -- Your PostgreSQL connection string
    * `BETTER_AUTH_SECRET` -- For session encryption
    * At least one LLM provider key (OpenAI, Anthropic, Google, etc.)
  </Accordion>

  <Accordion title="Chat with PDFs / Document RAG">
    * Storage provider config (for file uploads)
    * `OPENAI_API_KEY` (for embeddings)
    * A Postgres host that supports `pgvector`
  </Accordion>

  <Accordion title="Voice Studio">
    * `ELEVENLABS_API_TOKEN`
    * Storage provider config (generated audio is persisted)
  </Accordion>

  <Accordion title="Video Studio">
    * `REPLICATE_API_TOKEN`
    * Storage provider config (source images and final videos are persisted)
  </Accordion>

  <Accordion title="Image Studio">
    * Storage provider config (generated images are persisted)
    * `REPLICATE_API_TOKEN` for Replicate-backed models
    * `OPENAI_API_KEY` for GPT Image
  </Accordion>

  <Accordion title="Analytics">
    * PostHog, Plausible, or DataFast credentials
  </Accordion>

  <Accordion title="Payments">
    * Polar, Stripe, or LemonSqueezy keys and webhook secrets
  </Accordion>
</AccordionGroup>

<Tip>
  `pnpm bootstrap` can collect the storage settings too, so you do not need to hand-wire upload/media env vars up front unless you're doing a manual setup.
</Tip>

## The Local-First Reality

<Note>
  "The app boots locally" does not mean "every feature works locally." Many features depend on third-party APIs, so you'll need the right provider keys for whatever you're testing.
</Note>

What runs locally:

* Next.js dev server
* Your PostgreSQL database (local or hosted)
* All UI and routing

What needs external services:

* LLM providers (OpenAI, Anthropic, Google, etc.)
* Storage (for file uploads)
* Voice, video, and some image generation
* Email sending
* Payment processing
* Analytics tracking

For most teams, the smoothest path is **local Next.js + hosted Supabase PostgreSQL + hosted provider APIs** for whatever features you're actively working on. You don't need to configure everything at once -- just add provider keys as you need them.
