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

# Deployment & Configuration

> Environment variables, build output, domains, and security headers for the Trace Symbols and Trace Footprints sites.

Both sites are standard Next.js 16 apps with `output: "standalone"` — deployable on Vercel,
Docker, or any Node host. Browsing works from the committed JSON index; only generation and
account features need the backend reachable.

## Environment variables

| Variable                        | Required | Default                                 | Purpose                                                                        |
| ------------------------------- | -------- | --------------------------------------- | ------------------------------------------------------------------------------ |
| `NEXT_PUBLIC_BACKEND_URL`       | Yes      | `https://api.buildwithtrace.com`        | Backend API base (client + server)                                             |
| `BACKEND_URL`                   | No       | falls back to `NEXT_PUBLIC_BACKEND_URL` | Server-side override used by proxy routes                                      |
| `NEXT_PUBLIC_SITE_URL`          | No       | per-site canonical                      | `https://symbols.buildwithtrace.com` / `https://footprints.buildwithtrace.com` |
| `NEXT_PUBLIC_POSTHOG_KEY`       | No       | `""`                                    | PostHog analytics (disabled if empty)                                          |
| `NEXT_PUBLIC_SUPABASE_ANON_KEY` | No       | `""`                                    | Supabase Realtime for live comments (optional)                                 |

<Tip>
  Point `NEXT_PUBLIC_BACKEND_URL` / `BACKEND_URL` at staging (`http://75.101.181.175`) to test
  generation/save against the staging backend without touching production.
</Tip>

## Local development

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm install
  pnpm dev          # next dev (Turbopack)
  ```

  ```bash with a staging backend theme={null}
  BACKEND_URL=http://75.101.181.175 \
  NEXT_PUBLIC_BACKEND_URL=http://75.101.181.175 \
  PORT=3007 pnpm dev
  ```
</CodeGroup>

The footprints repo needs `data/footprints_index.json` present (committed). The symbols repo
needs `data/symbols_index.json` (committed) and, for full pin data, the per-library files —
regenerate any missing data with `python3 scripts/sync.py --force` (see
[Data pipeline](/platforms/data-pipeline)).

## Domains

| Site       | Domain                          | Repo                              |
| ---------- | ------------------------------- | --------------------------------- |
| Symbols    | `symbols.buildwithtrace.com`    | `buildwithtrace/trace-symbols`    |
| Footprints | `footprints.buildwithtrace.com` | `buildwithtrace/trace-footprints` |

## Security headers

Set in `next.config.ts` on both sites:

* `X-Frame-Options: DENY`
* `X-Content-Type-Options: nosniff`
* `Referrer-Policy: strict-origin-when-cross-origin`
* `Permissions-Policy: camera=(), microphone=(), geolocation=()`
* `Strict-Transport-Security: max-age=31536000; includeSubDomains`

## Health check

`GET /api/health` returns `200` when the local index files are present, `503` otherwise:

<CodeGroup>
  ```json Symbols theme={null}
  { "status": "ok", "timestamp": "…",
    "data": { "symbols_index": true, "symbol_thumbnails": true, "libraries_dir": true } }
  ```

  ```json Footprints theme={null}
  { "status": "ok", "timestamp": "…", "data": { "footprints_index": true } }
  ```
</CodeGroup>
