refactor: rename manager codebase dir new-api → heicode, module github.com/heicode/manager
Remove user-facing new-api naming; Docker/network/container names use heicode. Go imports updated; Dockerfiles and workflows ldflags fixed. Made-with: Cursor
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
| 路径 | 角色 | 栈 / 备注 |
|
||||
|------|------|-----------|
|
||||
| `cc-haha/` | **Heicode** 客户端:CLI(Ink)+ 本地 HTTP/WS 服务 + **Desktop**(Tauri + React) | Bun + TypeScript;产品入口 `bin/heicode` |
|
||||
| `new-api/` | **Heicode Manager**:网关 + 管理控制台 | Go(Gin/GORM)+ `web/default` 前端(Bun/Rsbuild/React) |
|
||||
| `heicode/` | **Heicode Manager**:网关 + 管理控制台 | Go(Gin/GORM)+ `web/default` 前端(Bun/Rsbuild/React) |
|
||||
| `website/` | 产品介绍站点 | Next.js;根 `docker-compose.yml` 提供 `heicode-www` :8888 |
|
||||
| `docs/` | 愿景、**里程碑**(`docs/milestones/`)、**Agnet 集成**(`docs/integration/`) | Markdown |
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
## 权威子文档(改代码前先打开对应一篇)
|
||||
|
||||
- **客户端(cc-haha)**:[`cc-haha/AGENTS.md`](./cc-haha/AGENTS.md) — 目录结构、运行命令、测试、提交约定。
|
||||
- **网关(new-api)**:[`new-api/CLAUDE.md`](./new-api/CLAUDE.md) — Go 分层、JSON/i18n/DB 规则等。
|
||||
- **网关(heicode)**:[`heicode/CLAUDE.md`](./heicode/CLAUDE.md) — Go 分层、JSON/i18n/DB 规则等。
|
||||
- **产品愿景与交付节奏**:[`docs/vision-heicode-full-stack-agentic-dev.md`](./docs/vision-heicode-full-stack-agentic-dev.md)、[`docs/milestones/README.md`](./docs/milestones/README.md)。
|
||||
|
||||
## 最小开发闭环
|
||||
@@ -32,7 +32,7 @@ bun run src/server/index.ts
|
||||
cd desktop && bun run tauri dev
|
||||
```
|
||||
|
||||
联调本机 Manager(new-api)时常见:
|
||||
联调本机 Manager(heicode)时常见:
|
||||
|
||||
```bash
|
||||
HEICODE_TAIJIAICLOUD_BASE_URL=http://localhost:3000 bun run src/server/index.ts
|
||||
@@ -45,11 +45,11 @@ HEICODE_TAIJIAICLOUD_BASE_URL=http://localhost:3000 bun run src/server/index.ts
|
||||
- **客户端登录 / Provider**:`cc-haha/src/server/api/heicode-auth.ts`,路由前缀 `/api/heicode-auth/*`(由 `cc-haha/src/server/router.ts` 挂载)。
|
||||
- **模型发现**:`cc-haha/src/server/services/providerService.ts`、`cc-haha/src/server/api/providers.ts`。
|
||||
- **Provider 预设**:`cc-haha/src/server/config/providerPresets.json` + `providerPresets.ts`。
|
||||
- **Manager 侧 Heicode OAuth**:`new-api/controller/heicode_oauth.go`,路由 `new-api/router/heicode-router.go`(例如 `/heicode/oauth/authorize`、`/heicode/oauth/session`)。
|
||||
- **Manager 侧 Heicode OAuth**:`heicode/controller/heicode_oauth.go`,路由 `heicode/router/heicode-router.go`(例如 `/heicode/oauth/authorize`、`/heicode/oauth/session`)。
|
||||
|
||||
## 协作约定(根级)
|
||||
|
||||
1. **改哪一层跟哪篇文档**:Go 行为以 `new-api/CLAUDE.md` 为准;客户端 TS/React 以 `cc-haha/AGENTS.md` 为准。
|
||||
1. **改哪一层跟哪篇文档**:Go 行为以 `heicode/CLAUDE.md` 为准;客户端 TS/React 以 `cc-haha/AGENTS.md` 为准。
|
||||
2. **小步提交**:沿用历史风格(如 `feat:` / `fix:` / `docs:`);PR 写清影响面与验证步骤。
|
||||
3. **集成与「SK」边界**:平台契约见 [`docs/integration/agnet-platform-api-design.md`](./docs/integration/agnet-platform-api-design.md),里程碑见 `docs/milestones/`。
|
||||
4. **不要臆测计费**:计费与订阅在平台侧,不在 Heicode 客户端内实现。
|
||||
@@ -57,7 +57,9 @@ HEICODE_TAIJIAICLOUD_BASE_URL=http://localhost:3000 bun run src/server/index.ts
|
||||
## Docker / 站点
|
||||
|
||||
- 根目录 [`docker-compose.yml`](./docker-compose.yml):构建 `website/` 静态站点镜像(端口 **8888**)。
|
||||
- Manager 本地编排以 `new-api/docker-compose.yml` 及仓库内 override 为准(若存在)。
|
||||
- Manager 本地编排以 `heicode/docker-compose.yml` 及仓库内 override 为准(若存在)。
|
||||
- **VM / 生产同步代码**:优先在目标机上 **`git clone` / `git pull`** 与本仓库远程一致;**不要**用 `scp` 传整份源码或 compose(仅在仓库不可用或紧急热修时例外)。
|
||||
- **VM 部署后清镜像**:每次 `docker compose ... up -d --build` 后执行 **`sudo docker image prune -f`**,清掉重建产生的悬空层;定期可 **`sudo docker system prune -f`**(不删仍在使用的卷)。避免只叠新镜像、旧层占满磁盘。
|
||||
|
||||
## 当前线上入口(2026-04)
|
||||
|
||||
@@ -68,11 +70,13 @@ HEICODE_TAIJIAICLOUD_BASE_URL=http://localhost:3000 bun run src/server/index.ts
|
||||
|
||||
## Manager 生产拓扑(Azure)
|
||||
|
||||
- 应用层:Azure VM 上运行 `new-api`(当前用 Docker 容器承载应用进程)。
|
||||
- 数据层:仅使用云资源
|
||||
- 应用层:Azure VM 上运行 `heicode`(当前用 Docker 容器承载应用进程)。
|
||||
- 数据库与缓存:使用 Azure 托管服务(不在 VM 上跑 PostgreSQL/Redis 容器)
|
||||
- PostgreSQL: `heicode.postgres.database.azure.com` / DB `heicode`
|
||||
- Redis: `heicode.redis.cache.windows.net:6380`(TLS)
|
||||
- 说明:VM 上本地 `postgres/redis` 不参与生产,若被创建应删除,避免数据源混淆。
|
||||
- 容器落盘:VM 仅承载应用进程;**容器内产生的文件**(如 `/data` 上传与持久文件、`/app/logs`)通过 **bind mount** 写到 VM 本地磁盘,便于备份与重建容器后不丢。编排见 `heicode/docker-compose.azure-vm.yml`,目录由环境变量 `HEICODE_DATA_ROOT` 指定。
|
||||
- 说明:不要在生产 VM 上再启本地 `postgres`/`redis` 容器并指向业务库,避免与托管实例混淆。
|
||||
- 镜像清理:发版构建后删除悬空/旧镜像层(见上文「VM 部署后清镜像」),防止 OS 盘被 Docker 占满。
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user