# User Dashboard (LysnrAI) — Vercel Deployment Roadmap

> **App:** `user-dashboard-web`
> **Repo:** `learning_voice_ai_agent` → `user-dashboard-web/`
> **Status:** ⚠️ Partial — needs Gitea registry access + env vars

---

## Current State

- **Framework:** Next.js 16.1.6, React 19.2.3, TailwindCSS v4, shadcn/ui
- **Output:** Vercel-aware (`process.env.VERCEL ? {} : { output: 'standalone' }`)
- **Dependencies:** 14 `@bytelyst/*` packages via Gitea registry (`^0.1.0`)
- **Build:** `next build --webpack`
- **Server-side:** Azure Cosmos DB, Stripe, JWT, bcryptjs
- **No `file:` references** ✅

## Gaps to Fix

### Gap 1: Gitea Registry Access on Vercel (~5 min)

The `.npmrc` currently points to local Gitea (`http://localhost:3300`). 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

### Gap 2: Environment Variables (~10 min)

- [ ] `COSMOS_ENDPOINT` — Azure Cosmos DB endpoint
- [ ] `COSMOS_KEY` — Azure Cosmos DB key
- [ ] `JWT_SECRET` — JWT signing secret
- [ ] `STRIPE_SECRET_KEY` — Stripe server-side key
- [ ] `STRIPE_PUBLISHABLE_KEY` — Stripe public key
- [ ] `NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY` — Client-side Stripe key
- [ ] `PLATFORM_SERVICE_URL` = `https://api.bytelyst.com/platform`
- [ ] `ACTIONTRAIL_SERVICE_URL` = `https://api.bytelyst.com/actiontrail`
- [ ] `AZURE_KEYVAULT_URL` — AKV (optional)

## Deployment Steps

### Step 1: Fix Registry Access (~5 min)

- [ ] Update `.npmrc` to `gitea.bytelyst.com` registry
- [ ] Set `GITEA_NPM_TOKEN` on Vercel

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

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

### Step 3: Configure Environment Variables (~10 min)

- [ ] Add all env vars listed above
- [ ] Set `GITEA_NPM_TOKEN` for registry auth

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

- [ ] Trigger deploy
- [ ] Test login, dashboard, billing flow
- [ ] Verify Stripe integration
- [ ] Verify Cosmos connectivity

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

- [ ] Add custom domain (e.g., `portal.lysnrai.com`)

## Risks

- **Cosmos latency:** Same region concern as admin-web.
- **Stripe webhooks:** Stripe webhook URL must be updated to Vercel domain.
- **Platform-service connectivity:** `PLATFORM_SERVICE_URL` → `https://api.bytelyst.com/platform` (requires Caddy gateway on Azure VM).

## Estimated Total Effort: ~35 minutes
