# <%= appName %>

Nuxt.js full-stack application with server-side API capabilities, Vue 3, and Vite.

## Features

- 🚀 **Nuxt 4**: Latest Nuxt.js framework
- ⚡️ **Vite**: Lightning-fast development and build
- 🎨 **Vue 3**: Composition API and modern Vue features
- 🔥 **Server API**: Built-in server routes for backend logic
- 📁 **File-based Routing**: Automatic routing from file structure
- 🔧 **TypeScript**: Full TypeScript support
- 🛠️ **DevTools**: Nuxt DevTools enabled

## Setup

This project uses pnpm through its preparation wrapper:

```bash
bash ./scripts/prepare.sh
```

## Development

Start the development server on `http://localhost:<%= port %>`:

```bash
pnpm dev
```

The server will automatically restart when you make changes to your code.

## Production

Build the application for production:

```bash
pnpm build
```

Start the production server:

```bash
pnpm start
```

## Project Structure

```
<%= appName %>/
├── app/              # Application source code
│   ├── app.vue       # Root component
│   ├── components/   # Vue components
│   └── layouts/      # Layout components
├── server/           # Server-side code (optional)
│   ├── api/          # API endpoints
│   └── middleware/   # Server middleware
├── public/           # Static assets
├── assets/           # CSS and other assets
├── nuxt.config.ts    # Nuxt configuration
└── package.json      # Project dependencies
```

## Server API (Optional)

You can add server API by creating files in `server/api/` directory. See [server/README.md](./server/README.md) for more details.

## Learn More

- [Nuxt Documentation](https://nuxt.com/docs)
- [Vue 3 Documentation](https://vuejs.org/)
- [Vite Documentation](https://vitejs.dev/)
- [Deployment Guide](https://nuxt.com/docs/getting-started/deployment)

## 云盘源码与本地开发

Vite、Next.js、Nuxt 的 Unix 开发脚本在 `COZE_DRIVE_ROOT`（默认 `/Coze/Drive`）内通过
`scripts/local-workspace.cjs` 将源码用 `rsync` 同步到本机临时目录。系统需提供 Node.js、pnpm、bash 和 rsync。
所有开发与修复仍在云盘源码目录完成，从该目录执行 `.coze` 的 `[dev]` 命令。

- `prepare.sh` 同步并在本地安装依赖；安装成功且云盘依赖输入未变化时，仅将更新的锁文件回写云盘。
- `dev.sh` 在本地镜像运行开发服务，每轮 rsync 结束后等待一秒再同步，框架监听本地文件进行热更新。
  同步失败或依赖输入变化时停止服务；修复后重新运行 `prepare.sh` / `dev.sh`。
- `validate.sh` 使用独立的本地 `check` 目录，避免类型生成影响正在运行的 `dev` 服务。
- 同步排除 `.git`、`node_modules`、日志和框架输出；不要在镜像修复源码或将依赖、编译产物回传云盘。
  日志和 PID 默认保留在源码目录的 `logs/`，实际镜像路径见脚本输出。

本地镜像仅用于 `[dev].build/run/validate`。部署配置、`build.sh`、`start.sh` 保持原流程；
普通本地目录和 Windows PowerShell 入口也保持原流程。
存量项目通过新版 CLI 的 `coze-dev patch --dry-run` / `coze-dev patch` 升级，沿用 patch 总开关。
仅升级完整匹配旧模板的三个 Unix 开发脚本并保留端口；自定义开发脚本、命令或同名 helper 会跳过。
