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

# 开发指南

> 工程结构、配置与调试说明。

## 工程结构

```
app/                # Next.js App Router 页面与 API
components/         # UI 组件
services/           # 业务逻辑（绑定、转换、日志、设置）
protocols/          # 协议类型定义
bindings.json       # 绑定配置（本地文件，建议忽略提交）
settings.json       # 全局设置（API Key，本地文件，建议忽略提交）
logs.json           # 请求日志（本地文件，建议忽略提交）
```

## 主要脚本

```bash theme={null}
npm run dev      # 开发服务器
npm run build    # 构建
npm run start    # 生产启动
npm run lint     # 代码检查
```

## 配置文件

### bindings.json

存储所有绑定配置（UI 操作会直接写入该文件）。建议在生产环境做持久化挂载。

### settings.json

用于 Bridge API 鉴权：

```json theme={null}
{
  "apiKey": "your-secret-key"
}
```

如果不设置 `apiKey`，则 Bridge API 不校验 Authorization。

### logs.json

用于记录请求日志（最近 10000 条）。

## 调试建议

* 使用「Sandbox」观察 **原始返回** 与 **转换后结果**。
* 若 SSE 流式不可用，请确认目标接口返回 `text/event-stream`。
* 如需确认请求体，查看服务端日志或 `logs.json`。
