|
1 | | -# README |
| 1 | +# Firebringer |
2 | 2 |
|
3 | | -## About |
| 3 | +<div align="center"> |
| 4 | + <img src="build/appicon.png" alt="Firebringer Logo" width="128" height="128"> |
| 5 | + <p><strong>基于节点的可视化 AI 内容生成工作流编辑器</strong></p> |
| 6 | +</div> |
4 | 7 |
|
5 | | -This is the official Wails React-TS template. |
| 8 | +## ✨ 功能特性 |
6 | 9 |
|
7 | | -You can configure the project by editing `wails.json`. More information about the project settings can be found |
8 | | -here: https://wails.io/docs/reference/project-config |
| 10 | +- **可视化工作流编辑器**:基于 ReactFlow 的拖拽式节点编辑界面 |
| 11 | +- **多模态 AI 支持**:生成文本、图像、视频和音频内容 |
| 12 | +- **多 AI 提供商**:集成 OpenAI、Claude 和 Gemini |
| 13 | +- **本地资源管理**:内置资源库,本地文件存储 |
| 14 | +- **项目管理**:保存、加载和管理多个工作流项目 |
| 15 | +- **跨平台**:支持 macOS、Windows 和 Linux 的原生桌面应用 |
9 | 16 |
|
10 | | -## Live Development |
| 17 | +## 📸 截图 |
11 | 18 |
|
12 | | -To run in live development mode, run `wails dev` in the project directory. This will run a Vite development |
13 | | -server that will provide very fast hot reload of your frontend changes. If you want to develop in a browser |
14 | | -and have access to your Go methods, there is also a dev server that runs on http://localhost:34115. Connect |
15 | | -to this in your browser, and you can call your Go code from devtools. |
| 19 | +<div align="center"> |
| 20 | + <img src="screenshot/light_projects.png" alt="亮色主题" width="45%"> |
| 21 | + <img src="screenshot/dark_projects.png" alt="暗色主题" width="45%"> |
| 22 | +</div> |
16 | 23 |
|
17 | | -## Building |
| 24 | +## 🛠️ 技术栈 |
18 | 25 |
|
19 | | -To build a redistributable, production mode package, use `wails build`. |
| 26 | +**后端:** |
| 27 | +- Go 1.24 |
| 28 | +- Wails v2(桌面应用框架) |
| 29 | +- SQLite(sqlx + go-sqlite3) |
| 30 | +- AI SDK:anthropic-sdk-go、go-openai、google genai |
| 31 | + |
| 32 | +**前端:** |
| 33 | +- React 19 + TypeScript |
| 34 | +- Vite 7(构建工具) |
| 35 | +- ReactFlow(@xyflow/react)- 可视化画布 |
| 36 | +- Tailwind CSS 4 - 样式 |
| 37 | +- shadcn/ui - UI 组件库 |
| 38 | + |
| 39 | +## 🚀 快速开始 |
| 40 | + |
| 41 | +### 环境要求 |
| 42 | + |
| 43 | +- Go 1.24+ |
| 44 | +- Node.js 18+ 和 pnpm |
| 45 | +- Wails CLI:`go install github.com/wailsapp/wails/v2/cmd/wails@latest` |
| 46 | + |
| 47 | +### 安装 |
| 48 | + |
| 49 | +```bash |
| 50 | +# 克隆仓库 |
| 51 | +git clone https://github.com/yourusername/firebringer.git |
| 52 | +cd firebringer |
| 53 | + |
| 54 | +# 安装前端依赖 |
| 55 | +cd frontend |
| 56 | +pnpm install |
| 57 | +cd .. |
| 58 | +``` |
| 59 | + |
| 60 | +### 开发 |
| 61 | + |
| 62 | +运行热重载的开发模式: |
| 63 | + |
| 64 | +```bash |
| 65 | +wails dev |
| 66 | +``` |
| 67 | + |
| 68 | +应用将启动并包含: |
| 69 | +- 带有 React 应用的主窗口 |
| 70 | +- 开发服务器 http://localhost:34115(用于浏览器测试 Go 方法) |
| 71 | +- 本地文件服务器 http://localhost:34116(用于生成的资源) |
| 72 | + |
| 73 | +### 构建 |
| 74 | + |
| 75 | +构建生产就绪的安装包: |
| 76 | + |
| 77 | +```bash |
| 78 | +wails build |
| 79 | +``` |
| 80 | + |
| 81 | +可执行文件将生成在 `build/bin/` 目录。 |
| 82 | + |
| 83 | +## 📖 使用说明 |
| 84 | + |
| 85 | +### 创建工作流 |
| 86 | + |
| 87 | +1. 从侧边栏创建新项目 |
| 88 | +2. 向画布添加节点(文本、图像、视频、音频) |
| 89 | +3. 通过拖拽输出到输入句柄来连接节点 |
| 90 | +4. 为每个节点配置 AI 提供商和模型 |
| 91 | +5. 点击"运行"执行节点并生成内容 |
| 92 | +6. 在资源库中查看生成的资源 |
| 93 | + |
| 94 | +### 节点类型 |
| 95 | + |
| 96 | +- **文本节点**:使用 LLM 生成文本内容 |
| 97 | +- **图像节点**:从文本描述生成图像 |
| 98 | +- **视频节点**:从提示创建视频 |
| 99 | +- **音频节点**:生成音频/语音内容 |
| 100 | +- **分组节点**:组织和分组多个节点 |
| 101 | + |
| 102 | +### 连接节点 |
| 103 | + |
| 104 | +节点可以将内容传递给下游节点: |
| 105 | +- 将一个节点的输出句柄连接到另一个节点的输入句柄 |
| 106 | +- 源节点的输出成为目标节点的输入上下文 |
| 107 | +- 支持多种输入(文本、图像、视频、音频) |
| 108 | + |
| 109 | +## 🔧 配置 |
| 110 | + |
| 111 | +### AI 提供商设置 |
| 112 | + |
| 113 | +1. 打开设置(齿轮图标) |
| 114 | +2. 导航到"模型提供商" |
| 115 | +3. 添加您的 API 密钥: |
| 116 | + - OpenAI(文本、图像生成) |
| 117 | + - Claude(文本生成) |
| 118 | + - Gemini(文本生成) |
| 119 | + |
| 120 | +### 存储位置 |
| 121 | + |
| 122 | +- **数据库**:`~/Library/Application Support/firebringer/firebringer.db` |
| 123 | +- **生成的资源**:`~/Library/Application Support/firebringer/generated/` |
| 124 | +- **模型能力**:`~/Library/Application Support/firebringer/model_data.json` |
| 125 | + |
| 126 | +## 💻 开发指南 |
| 127 | + |
| 128 | +### 项目结构 |
| 129 | + |
| 130 | +``` |
| 131 | +firebringer/ |
| 132 | +├── main.go # 应用入口 |
| 133 | +├── binding/ # Wails 绑定(暴露给前端) |
| 134 | +│ ├── ai/ # AI 服务绑定 |
| 135 | +│ └── database/ # 数据库服务绑定 |
| 136 | +├── service/ # 核心业务逻辑 |
| 137 | +│ ├── ai/ # AI 提供商实现 |
| 138 | +│ └── storage/ # 文件存储工具 |
| 139 | +├── database/ # 数据持久化层 |
| 140 | +│ ├── models.go # 数据模型 |
| 141 | +│ └── repository.go # 数据库操作 |
| 142 | +└── frontend/ # React 应用 |
| 143 | + ├── src/ |
| 144 | + │ ├── components/ # UI 组件 |
| 145 | + │ │ ├── nodes/ # 节点实现 |
| 146 | + │ │ ├── settings/ # 设置对话框 |
| 147 | + │ │ └── ui/ # shadcn/ui 组件 |
| 148 | + │ └── hooks/ # 自定义 React Hooks |
| 149 | + └── wailsjs/ # 自动生成的 Wails 绑定 |
| 150 | +``` |
| 151 | + |
| 152 | +### 添加新的 AI 提供商 |
| 153 | + |
| 154 | +1. 在 `service/ai/{provider}.go` 中实现 `AIClient` 接口 |
| 155 | +2. 在 `NewClient()` 工厂函数中添加提供商分支(`service/ai/utils.go`) |
| 156 | +3. 在 `database/models.go` 中添加提供商常量 |
| 157 | +4. 更新 `model_data.json` 添加提供商的模型 |
| 158 | +5. 通过 `binding/ai/service.go` 暴露方法 |
| 159 | + |
| 160 | +### 关键开发模式 |
| 161 | + |
| 162 | +- **服务层优先**:先在 `service/` 中实现逻辑,再通过 `binding/` 暴露 |
| 163 | +- **Wails 绑定**:永远不要手动编辑 `frontend/wailsjs/go/` - 它们是自动生成的 |
| 164 | +- **节点执行**:使用 `useNodeRun` Hook,通过 `runTrigger` UUID 管理状态 |
| 165 | +- **资源访问**:前端使用 `http://localhost:34116/{filename}` 访问生成的文件 |
| 166 | + |
| 167 | +## 🤝 贡献 |
| 168 | + |
| 169 | +欢迎贡献!请随时提交 Pull Request。 |
| 170 | + |
| 171 | +## 📄 许可证 |
| 172 | + |
| 173 | +本项目采用 Creative Commons Attribution 4.0 International License 许可 - 详见 [LICENSE](LICENSE) 文件。 |
| 174 | + |
| 175 | +## 🙏 致谢 |
| 176 | + |
| 177 | +- [Wails](https://wails.io/) - 桌面应用框架 |
| 178 | +- [ReactFlow](https://reactflow.dev/) - 基于节点的可视化编辑器 |
| 179 | +- [shadcn/ui](https://ui.shadcn.com/) - UI 组件库 |
| 180 | + |
| 181 | +## 📞 支持 |
| 182 | + |
| 183 | +问题和功能请求请使用 [GitHub Issues](https://github.com/miaomint/firebringer/issues) 页面。 |
0 commit comments