feat: ship self-hosted KOC LOOP workflows
This commit is contained in:
39
README.md
39
README.md
@@ -1,20 +1,22 @@
|
||||
# KOC LOOP
|
||||
|
||||
KOC 内容分发与数据回收闭环,运行于 vinext、Cloudflare D1 和 R2。
|
||||
KOC 内容分发与数据回收闭环。当前私有化分支运行于标准 Next.js Node.js、MySQL 8、Nginx 和本地持久化文件存储。
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Node.js `>=22.13.0`
|
||||
- MySQL `>=8.0`(本地完整运行)
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run db:migrate
|
||||
npm run dev
|
||||
npm run build
|
||||
```
|
||||
|
||||
复制 `.dev.vars.example` 为 `.dev.vars` 并配置运行时变量。飞书动态导入需要:
|
||||
复制 `.env.self-hosted.example` 为 `.env.self-hosted`,设置 `DATABASE_URL` 或 `MYSQL_*` 连接信息。飞书动态导入需要:
|
||||
|
||||
- `FEISHU_APP_ID`
|
||||
- `FEISHU_APP_SECRET`
|
||||
@@ -31,16 +33,7 @@ npm run build
|
||||
|
||||
系统首次登录时创建唯一的超级管理员。后续管理员和普通用户均由“用户管理”页面创建,普通用户不能访问 KOC 资源库。
|
||||
|
||||
This starter does not use `wrangler.jsonc`.
|
||||
|
||||
## Included Shape
|
||||
|
||||
- edit site code under `app/`
|
||||
- `.openai/hosting.json` declares optional Sites D1 and R2 bindings
|
||||
- `vite.config.ts` simulates declared bindings for local development
|
||||
- `db/schema.ts` starts intentionally empty
|
||||
- `examples/d1/` contains an optional D1 example surface
|
||||
- `drizzle.config.ts` supports local migration generation when needed
|
||||
完整私有化部署请看 [KOC LOOP 私有化部署指南](docs/KOC%20LOOP%20私有化部署指南.md)。Docker Compose 会启动 Nginx、KOC 服务和 MySQL;外部领取页与后台使用同一域名下的 `/koc/` 路径。
|
||||
|
||||
## 后台账号与角色
|
||||
|
||||
@@ -50,6 +43,16 @@ This starter does not use `wrangler.jsonc`.
|
||||
|
||||
后台不提供注册、找回密码和普通用户个人改密。密码重置统一由管理员在后台完成。
|
||||
|
||||
## KOC 资源导入
|
||||
|
||||
超级管理员和管理员可在“KOC资源”页面下载标准 Excel 模板,批量导入已有资源。模板只需填写小红书账号主页,合作来源可选填;上传后系统自动解析账号名称、小红书号、IP属地和粉丝数。
|
||||
|
||||
- 单次最多导入 100 个账号,支持 `.xlsx` 和 `.csv`,文件不超过 5MB。
|
||||
- 当前自动解析支持小红书账号主页;上传后先展示新增、更新和异常数据,存在异常时不会写入数据库。
|
||||
- 按“平台 + 账号主页”去重;解析出相同小红书号时也会更新已有账号。
|
||||
- 重复账号更新公开资料和合作来源,不产生两份资源。
|
||||
- 导入的合作来源会进入现有资源搜索、筛选和导出结果。
|
||||
|
||||
## Agent MCP
|
||||
|
||||
生产地址:
|
||||
@@ -110,11 +113,15 @@ Authorization: Bearer <KOC_MCP_API_KEY>
|
||||
## Useful Commands
|
||||
|
||||
- `npm run dev`: start local development
|
||||
- `npm run build`: verify the vinext build output
|
||||
- `npm test`: build the starter and verify its rendered loading skeleton
|
||||
- `npm run build`: 验证标准 Next.js Node.js 生产构建
|
||||
- `npm test`: 构建并执行业务与私有化架构测试
|
||||
- `npm run db:generate`: generate Drizzle migrations after schema changes
|
||||
- `npm run db:migrate`: 应用 MySQL 增量迁移
|
||||
- `npm run db:check`: 检查 MySQL 连接
|
||||
- `npm run db:import-json -- <file>`: 导入 D1 JSON 数据
|
||||
- `npm run storage:import -- <dir>`: 导入 R2 对象目录
|
||||
|
||||
## Learn More
|
||||
|
||||
- [vinext Documentation](https://github.com/cloudflare/vinext)
|
||||
- [Drizzle D1 Guide](https://orm.drizzle.team/docs/get-started/d1-new)
|
||||
- [Next.js Self-Hosting](https://nextjs.org/docs/app/guides/self-hosting)
|
||||
- [Drizzle MySQL Guide](https://orm.drizzle.team/docs/get-started-mysql)
|
||||
|
||||
Reference in New Issue
Block a user