Files
HarborForge/README.md
zhi 6673372532 feat: integrate AbstractWizard for initialization
- Add wizard service (git.hangman-lab.top/hzhang/abstract-wizard:latest)
- Add wizard-init service: uploads init-config on first deploy
- Backend reads wizard config on startup, creates admin user + default project
- Add init-config/harborforge.json with default admin credentials
- Update README with initialization docs
- Startup order: mysql → wizard → wizard-init → backend → frontend
2026-03-06 13:15:54 +00:00

84 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# HarborForge
Agent/人类协同任务管理平台
## 项目结构
```
HarborForge/
├── HarborForge.Backend/ # 后端 (FastAPI + MySQL)
├── HarborForge.Frontend/ # 前端 (React + Vite)
├── docker-compose.yml # Docker 部署配置
├── nginx-host.conf.example # 宿主机 nginx 配置示例
└── .env.example # 环境变量模板
```
## 快速开始
```bash
# 克隆并初始化子模块
git clone https://git.hangman-lab.top/zhi/HarborForge.git
cd HarborForge
git submodule update --init --recursive
# 配置环境变量
cp .env.example .env
# 启动服务
docker compose up -d
```
## 部署架构
```
宿主机 nginx (80/443)
├── / → frontend (Docker, port 3000)
└── /api/ → backend (Docker, port 8000)
Docker 内部:
wizard (AbstractWizard) → 初始化配置管理
wizard-init → 首次启动上传默认配置
backend → 启动时从 wizard 读取配置,创建 admin 用户等
```
前端 Docker 容器不包含 nginx使用轻量的 `serve` 提供静态文件。
API 代理由宿主机 nginx 统一处理。
### AbstractWizard 初始化
首次部署时,`wizard-init` 会将 `init-config/harborforge.json` 上传到 AbstractWizard。
后端启动时自动从 AbstractWizard 读取配置并创建 admin 用户和默认项目。
修改初始化配置:
```bash
# 直接编辑 init-config/harborforge.json首次部署前
# 或通过 AbstractWizard API 修改(部署后)
curl -X PATCH http://localhost:18080/api/v1/config/harborforge.json \
-d '{"admin": {"password": "new_secure_password"}}'
```
### 宿主机 nginx 配置
参考 `nginx-host.conf.example`,复制到 `/etc/nginx/sites-available/` 并修改域名。
## 子模块
- [HarborForge.Backend](https://git.hangman-lab.top/zhi/HarborForge.Backend) - FastAPI 后端 API
- [HarborForge.Frontend](https://git.hangman-lab.top/zhi/HarborForge.Frontend) - React 前端
## 端口
| 服务 | 默认端口 | 环境变量 |
|------|----------|----------|
| Frontend | 3000 | `FRONTEND_PORT` |
| Backend | 8000 | `BACKEND_PORT` |
| MySQL | 3306 | `MYSQL_PORT` |
## 前端页面
- 📊 仪表盘 — 统计概览
- 📋 Issues — 创建、列表、详情、状态变更、评论
- 📁 项目 — 项目管理、成员、关联 issue
- 🏁 里程碑 — 进度追踪、完成百分比
- 🔔 通知 — 实时通知中心、未读计数