# Use and adapt w-ai-admin-dashboard

Use the documented interfaces and source layout for **w-ai-admin-dashboard**. The sections below retain the README’s examples and configuration details.

## Production deployment

### 1. Build
```bash
cd admin-dashboard
npm install
npm run typecheck
npm run build
```

### 2. Environment
Copy `.env.example` to `.env.local` (local) or set env vars in your host (Vercel, etc.):

| Variable | Required | Description |
|----------|----------|-------------|
| `NEXT_PUBLIC_CONVEX_URL` | Yes | Convex deployment URL (`https://<deployment>.convex.cloud`) |
| `CONVEX_DEPLOYMENT` | For dev | e.g. `dev:hardy-gopher-480` |
| `NEXT_PUBLIC_EXTENDED_CAMPAIGN_APIS` | No | `1` for full campaign features |

### 3. Deploy Convex backend
```bash
cd admin-dashboard
npx convex deploy
```

### 4. Run production server
```bash
npm run start
```

Or deploy to Vercel / any Node host; build command: `npm run build`, output: `.next`.

## Convex

- Backend: `convex/`
- Config: `convex.json`

Commands:
```bash
npm run convex:dev     # dev with hot reload
npm run convex:codegen # regenerate types
npm run convex:deploy  # deploy to production
```

If you see access errors, run `npx convex dev` and select a deployment your account can access.

## Structure

- `src/app/` – Next.js pages (dashboard, campaigns, chat, customers, products, templates, etc.)
- `src/components/` – UI components
- `src/mock/` – Convex API layer (namespace routing)

## Commands in the root manifest

The captured [package.json](https://github.com/Up-to-code/w-ai-admin-dashboard/blob/HEAD/package.json) declares the following scripts. Run them from the directory containing that manifest.

| Command | Script |
| --- | --- |
| `npm run dev` | `next dev` |
| `npm run build` | `next build` |
| `npm run start` | `next start` |
| `npm run lint` | `eslint` |
| `npm run typecheck` | `tsc --noEmit` |
| `npm run test` | `vitest` |

## Troubleshoot a local change

1. Reproduce the smallest example from the [quick-start guide](/docs/up-to-code-w-ai-admin-dashboard/quick-start-guide).
2. Compare required configuration and dependency versions with the README.
3. Check the linked issue tracker for the same error. Include the command, runtime version, and relevant error when reporting a problem; omit credentials.

## Source and help

- [GitHub repository](https://github.com/Up-to-code/w-ai-admin-dashboard)
- [Original README](https://github.com/Up-to-code/w-ai-admin-dashboard/blob/main/README.md)
- [Issues and existing reports](https://github.com/Up-to-code/w-ai-admin-dashboard/issues)
- [Open the project website](https://w-ai-admin-dashboard.vercel.app)
