# NoteLett Web — Vercel Deployment Roadmap

> **App:** `@notelett/web`
> **Repo:** `learning_ai_notes` → `web/`
> **Status:** 🔴 Blocked — `file:` ref + hardcoded standalone output

---

## Current State

- **Framework:** Next.js 16.1.6, React 19.2.0, TailwindCSS v4
- **Output:** ❌ Hardcoded `output: "standalone"`
- **Dependencies:** 10 `@bytelyst/*` — **1 via `file:` ref** (`ui`), 9 via Gitea
- **Build:** `next build --webpack`
- **Special:** `outputFileTracingRoot` set to parent dir
- **Rich client** — dashboard, workspaces, search, reviews, note editor

## Gaps to Fix

### Gap 1: Convert `file:` ref (~5 min)

**File:** `web/package.json`

```diff
- "@bytelyst/ui": "file:../../learning_ai_common_plat/packages/ui",
+ "@bytelyst/ui": "^0.1.0",
```

- [ ] Update `package.json`
- [ ] Run `pnpm install`
- [ ] Verify build

### Gap 2: Make output Vercel-aware (~5 min)

**File:** `web/next.config.ts`

```diff
- output: "standalone",
- outputFileTracingRoot: path.join(process.cwd(), ".."),
+ ...(process.env.VERCEL ? {} : {
+   output: "standalone",
+   outputFileTracingRoot: path.join(process.cwd(), ".."),
+ }),
```

- [ ] Update `next.config.ts`
- [ ] Verify Docker build still works

### Gap 3: Registry Access (~5 min)

Once Caddy is configured on the Azure VM (see [SECURE_API_EXPOSURE.md](../single_azure_vm/docker/SECURE_API_EXPOSURE.md)), Gitea will be accessible at `https://gitea.bytelyst.com`.

- [ ] Update `.npmrc`:
  ```
  @bytelyst:registry=https://gitea.bytelyst.com/api/packages/ByteLyst/npm/
  //gitea.bytelyst.com/api/packages/ByteLyst/npm/:_authToken=${GITEA_NPM_TOKEN}
  ```
- [ ] Set `GITEA_NPM_TOKEN` as a Vercel environment variable

## Deployment Steps

### Step 1: Fix `file:` ref (~5 min)

### Step 2: Fix output mode (~5 min)

### Step 3: Fix registry access (~5 min)

### Step 4: Create Vercel Project (~5 min)

- [ ] Connect `learning_ai_notes` repo
- [ ] Set **Root Directory** to `web`
- [ ] Framework preset: **Next.js**

### Step 5: Environment Variables (~5 min)

- [ ] `NEXT_PUBLIC_PLATFORM_URL` = `https://api.bytelyst.com/platform`
- [ ] `NEXT_PUBLIC_BACKEND_URL` = `https://api.bytelyst.com/notelett`

### Step 6: Verify (~10 min)

- [ ] Test dashboard with metrics
- [ ] Test note creation + editor
- [ ] Test workspace filtering
- [ ] Test approval queue / agent timeline

### Step 7: Domain (~5 min)

- [ ] Add custom domain (e.g., `app.notelett.app`)

## Estimated Total Effort: ~40 minutes
