> ## Documentation Index
> Fetch the complete documentation index at: https://cora-59c313ca.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Development

> Run the Cora Next.js app from the repository root, and preview this Mintlify documentation site from the docs/ folder.

<Card title="Technology stack" icon="layer-group" href="/tech-stack" horizontal>
  Next.js, Supabase, Cloudflare (Turnstile + R2), Google Maps, Twilio via Supabase SMS, Vercel, and more — how each is used in the repo.
</Card>

## Cora web application (Next.js)

The product UI is a **Next.js 16** app at the **repository root** (not inside `docs/`).

<Info>
  **Prerequisites**: Node.js **20+** (matches `package.json` engines if set), npm or pnpm, and a Supabase project for auth and data.
</Info>

<Steps>
  <Step title="Install dependencies">
    ```bash theme={null}
    npm install
    ```
  </Step>

  <Step title="Configure environment variables">
    Create **`.env.local`** in the repo root (see the root `README.md` for the minimum set). Typical keys include:

    * `NEXT_PUBLIC_SUPABASE_URL` — Supabase project URL
    * `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` — anon / publishable key
    * `NEXT_PUBLIC_HOME_PAGE` — full origin used by server actions that call internal APIs (e.g. `http://localhost:3000` in dev)
    * `NEXT_PUBLIC_GOOGLE_MAPS_API_KEY` — interactive map
    * `NEXT_PUBLIC_TURNSTILE_SITE_KEY` — login / signup when enabled
    * R2 / S3 variables for media uploads (`S3_ENDPOINT`, `S3_KEY_ID`, `S3_SECRET_KEY`) when using the bundled upload routes

    Never commit `.env.local` to git.
  </Step>

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

    Open [http://localhost:3000](http://localhost:3000). Auth and middleware use the Supabase SSR client under `src/lib/supabase/`.
  </Step>
</Steps>

## Preview this documentation site

These pages are built with **Mintlify**. Configuration and branding for the docs **only** live in [`docs/docs.json`](https://github.com/Davidc45/Cora/blob/main/docs/docs.json) (colors, fonts, `name`, `description`, navigation).

<Steps>
  <Step title="Install the Mintlify CLI">
    ```bash theme={null}
    npm i -g mint
    ```
  </Step>

  <Step title="Run from the docs directory">
    ```bash theme={null}
    cd docs
    mint dev
    ```

    By default the preview listens on port **3000**. If the Cora app is already using 3000, use e.g. `mint dev --port 3333`.
  </Step>
</Steps>

### Validate links (optional)

```bash theme={null}
cd docs
mint broken-links
```

### Mintlify troubleshooting

If the CLI fails (for example Sharp / native module issues on Apple Silicon), see Mintlify’s [CLI docs](https://www.npmjs.com/package/mintlify) or remove `~/.mintlify` and reinstall the CLI as described in their troubleshooting guide.
