collabdocchat 1.2.5 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,124 @@
1
+ # 贡献指南
2
+
3
+ 感谢你考虑为 CollabDocChat 做出贡献!
4
+
5
+ ## 如何贡献
6
+
7
+ ### 报告 Bug
8
+
9
+ 如果你发现了 bug,请创建一个 issue 并包含以下信息:
10
+
11
+ - Bug 的详细描述
12
+ - 复现步骤
13
+ - 预期行为
14
+ - 实际行为
15
+ - 截图(如果适用)
16
+ - 环境信息(操作系统、Node.js 版本等)
17
+
18
+ ### 提出新功能
19
+
20
+ 如果你有新功能的想法:
21
+
22
+ 1. 先检查 issues 中是否已有类似建议
23
+ 2. 创建一个新的 issue,标记为 "enhancement"
24
+ 3. 详细描述功能需求和使用场景
25
+ 4. 等待社区讨论和反馈
26
+
27
+ ### 提交代码
28
+
29
+ 1. **Fork 项目**
30
+ ```bash
31
+ git clone https://github.com/yourusername/collabdocchat.git
32
+ cd collabdocchat
33
+ ```
34
+
35
+ 2. **创建分支**
36
+ ```bash
37
+ git checkout -b feature/your-feature-name
38
+ ```
39
+
40
+ 3. **编写代码**
41
+ - 遵循项目的代码风格
42
+ - 添加必要的注释
43
+ - 确保代码可以正常运行
44
+
45
+ 4. **测试**
46
+ ```bash
47
+ npm run dev
48
+ # 测试你的更改
49
+ ```
50
+
51
+ 5. **提交更改**
52
+ ```bash
53
+ git add .
54
+ git commit -m "feat: 添加某某功能"
55
+ ```
56
+
57
+ 提交信息格式:
58
+ - `feat:` 新功能
59
+ - `fix:` 修复 bug
60
+ - `docs:` 文档更新
61
+ - `style:` 代码格式调整
62
+ - `refactor:` 代码重构
63
+ - `test:` 测试相关
64
+ - `chore:` 构建/工具相关
65
+
66
+ 6. **推送到 GitHub**
67
+ ```bash
68
+ git push origin feature/your-feature-name
69
+ ```
70
+
71
+ 7. **创建 Pull Request**
72
+ - 在 GitHub 上创建 PR
73
+ - 详细描述你的更改
74
+ - 关联相关的 issue
75
+
76
+ ## 代码规范
77
+
78
+ ### JavaScript 风格
79
+
80
+ - 使用 ES6+ 语法
81
+ - 使用 2 空格缩进
82
+ - 使用单引号
83
+ - 函数和变量使用驼峰命名
84
+ - 常量使用大写下划线命名
85
+
86
+ ### 文件组织
87
+
88
+ - 每个文件只导出一个主要功能
89
+ - 相关功能放在同一目录
90
+ - 使用清晰的文件命名
91
+
92
+ ### 注释
93
+
94
+ - 为复杂逻辑添加注释
95
+ - 使用 JSDoc 格式注释函数
96
+ - 保持注释简洁明了
97
+
98
+ ## 开发流程
99
+
100
+ 1. 在本地开发和测试
101
+ 2. 确保代码符合规范
102
+ 3. 提交 PR 前先 pull 最新代码
103
+ 4. 等待代码审查
104
+ 5. 根据反馈修改代码
105
+ 6. 合并到主分支
106
+
107
+ ## 社区准则
108
+
109
+ - 尊重所有贡献者
110
+ - 保持友好和专业
111
+ - 接受建设性批评
112
+ - 帮助新手贡献者
113
+
114
+ ## 问题?
115
+
116
+ 如有任何问题,请:
117
+ - 查看 [README.md](README.md)
118
+ - 搜索现有 issues
119
+ - 创建新的 issue
120
+ - 发送邮件至 your.email@example.com
121
+
122
+ 再次感谢你的贡献!🎉
123
+
124
+
@@ -0,0 +1,345 @@
1
+ # CollabDocChat 安装指南
2
+
3
+ ## 📦 安装方式
4
+
5
+ ### 方式一:本地安装(推荐)
6
+
7
+ 这是最简单且最可靠的安装方式:
8
+
9
+ ```bash
10
+ # 1. 创建项目目录
11
+ mkdir my-collab-project
12
+ cd my-collab-project
13
+
14
+ # 2. 初始化 npm 项目
15
+ npm init -y
16
+
17
+ # 3. 安装 CollabDocChat
18
+ npm install collabdocchat
19
+
20
+ # 4. 进入安装目录
21
+ cd node_modules/collabdocchat
22
+
23
+ # 5. 启动应用
24
+ npm start
25
+ ```
26
+
27
+ ### 方式二:克隆仓库
28
+
29
+ 适合开发者和需要自定义的用户:
30
+
31
+ ```bash
32
+ # 1. 克隆项目
33
+ git clone https://github.com/shijinghao/collabdocchat.git
34
+ cd collabdocchat
35
+
36
+ # 2. 安装依赖
37
+ npm install
38
+
39
+ # 3. 启动应用
40
+ npm start
41
+ ```
42
+
43
+ ### 方式三:使用安装脚本
44
+
45
+ #### Windows 用户
46
+
47
+ 1. 下载 `install-and-start.bat`
48
+ 2. 双击运行或在命令行中执行:
49
+ ```cmd
50
+ install-and-start.bat
51
+ ```
52
+
53
+ #### Linux/Mac 用户
54
+
55
+ 1. 下载 `install-and-start.sh`
56
+ 2. 添加执行权限并运行:
57
+ ```bash
58
+ chmod +x install-and-start.sh
59
+ ./install-and-start.sh
60
+ ```
61
+
62
+ ## 🔧 环境要求
63
+
64
+ ### 必需软件
65
+
66
+ 1. **Node.js** (>= 16.0.0)
67
+ - 下载地址: https://nodejs.org/
68
+ - 验证安装: `node --version`
69
+
70
+ 2. **npm** (>= 7.0.0)
71
+ - 通常随 Node.js 一起安装
72
+ - 验证安装: `npm --version`
73
+
74
+ 3. **MongoDB** (>= 4.4)
75
+ - 下载地址: https://www.mongodb.com/try/download/community
76
+ - 验证安装: `mongod --version`
77
+
78
+ ### MongoDB 安装指南
79
+
80
+ #### Windows
81
+
82
+ 1. 下载 MongoDB Community Server
83
+ 2. 运行安装程序,选择"Complete"安装
84
+ 3. 安装 MongoDB Compass (可选的图形界面)
85
+ 4. 启动 MongoDB 服务:
86
+ ```cmd
87
+ net start MongoDB
88
+ ```
89
+
90
+ #### Mac (使用 Homebrew)
91
+
92
+ ```bash
93
+ # 安装 MongoDB
94
+ brew tap mongodb/brew
95
+ brew install mongodb-community
96
+
97
+ # 启动 MongoDB
98
+ brew services start mongodb-community
99
+ ```
100
+
101
+ #### Linux (Ubuntu/Debian)
102
+
103
+ ```bash
104
+ # 导入公钥
105
+ wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
106
+
107
+ # 添加源
108
+ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
109
+
110
+ # 安装
111
+ sudo apt-get update
112
+ sudo apt-get install -y mongodb-org
113
+
114
+ # 启动服务
115
+ sudo systemctl start mongod
116
+ sudo systemctl enable mongod
117
+ ```
118
+
119
+ ## ⚙️ 配置
120
+
121
+ ### 首次运行
122
+
123
+ 首次运行时,应用会自动创建配置文件。您也可以手动创建 `.env` 文件:
124
+
125
+ ```env
126
+ # 服务器配置
127
+ PORT=3000
128
+ NODE_ENV=development
129
+
130
+ # MongoDB 配置
131
+ MONGODB_URI=mongodb://localhost:27017/collabdocchat
132
+
133
+ # JWT 配置
134
+ JWT_SECRET=your-secret-key-change-this-in-production
135
+ JWT_EXPIRES_IN=7d
136
+
137
+ # 管理员账号(首次启动时创建)
138
+ ADMIN_USERNAME=admin
139
+ ADMIN_PASSWORD=admin123
140
+ ADMIN_EMAIL=admin@example.com
141
+ ```
142
+
143
+ ### 配置说明
144
+
145
+ - **PORT**: 服务器端口,默认 3000
146
+ - **MONGODB_URI**: MongoDB 连接字符串
147
+ - **JWT_SECRET**: JWT 密钥,生产环境请务必修改
148
+ - **JWT_EXPIRES_IN**: Token 过期时间
149
+ - **ADMIN_USERNAME/PASSWORD**: 默认管理员账号
150
+
151
+ ## 🚀 启动应用
152
+
153
+ ### 开发模式
154
+
155
+ ```bash
156
+ npm run dev
157
+ ```
158
+
159
+ 特点:
160
+ - 自动重启服务器
161
+ - 热重载前端
162
+ - 自动打开浏览器
163
+
164
+ ### 生产模式
165
+
166
+ ```bash
167
+ npm start
168
+ ```
169
+
170
+ ### 快速启动
171
+
172
+ ```bash
173
+ npm run quick-start
174
+ ```
175
+
176
+ 自动配置并启动应用。
177
+
178
+ ## 🔍 验证安装
179
+
180
+ ### 1. 检查服务器
181
+
182
+ 访问: http://localhost:3000
183
+
184
+ 应该看到登录页面。
185
+
186
+ ### 2. 检查客户端
187
+
188
+ 访问: http://localhost:5173
189
+
190
+ 应该看到应用界面。
191
+
192
+ ### 3. 登录测试
193
+
194
+ 使用默认管理员账号登录:
195
+ - 用户名: `admin`
196
+ - 密码: `admin123`
197
+
198
+ ## ❌ 常见问题
199
+
200
+ ### 问题 1: MongoDB 连接失败
201
+
202
+ **错误信息**: `MongoNetworkError: connect ECONNREFUSED`
203
+
204
+ **解决方案**:
205
+ 1. 确认 MongoDB 服务已启动
206
+ 2. 检查 `.env` 中的 `MONGODB_URI` 配置
207
+ 3. 验证 MongoDB 端口 (默认 27017)
208
+
209
+ ```bash
210
+ # Windows
211
+ net start MongoDB
212
+
213
+ # Mac
214
+ brew services start mongodb-community
215
+
216
+ # Linux
217
+ sudo systemctl start mongod
218
+ ```
219
+
220
+ ### 问题 2: 端口被占用
221
+
222
+ **错误信息**: `Error: listen EADDRINUSE: address already in use :::3000`
223
+
224
+ **解决方案**:
225
+ 1. 更改 `.env` 中的 `PORT` 配置
226
+ 2. 或者停止占用端口的进程
227
+
228
+ ```bash
229
+ # Windows - 查找并结束进程
230
+ netstat -ano | findstr :3000
231
+ taskkill /PID <进程ID> /F
232
+
233
+ # Mac/Linux
234
+ lsof -ti:3000 | xargs kill -9
235
+ ```
236
+
237
+ ### 问题 3: npm 依赖安装失败
238
+
239
+ **解决方案**:
240
+ ```bash
241
+ # 清除缓存
242
+ npm cache clean --force
243
+
244
+ # 删除 node_modules
245
+ rm -rf node_modules package-lock.json
246
+
247
+ # 重新安装
248
+ npm install
249
+ ```
250
+
251
+ ### 问题 4: Node.js 版本过低
252
+
253
+ **错误信息**: `Error: The engine "node" is incompatible`
254
+
255
+ **解决方案**:
256
+ 升级 Node.js 到 16.0.0 或更高版本。
257
+
258
+ ## 🛑 停止应用
259
+
260
+ ### 方法一:使用脚本
261
+
262
+ ```bash
263
+ npm run stop
264
+ ```
265
+
266
+ ### 方法二:手动停止
267
+
268
+ 在运行应用的终端按 `Ctrl + C`
269
+
270
+ ### 方法三:结束进程
271
+
272
+ ```bash
273
+ # Windows
274
+ taskkill /F /IM node.exe
275
+
276
+ # Mac/Linux
277
+ pkill -f node
278
+ ```
279
+
280
+ ## 📊 性能优化
281
+
282
+ ### 生产环境建议
283
+
284
+ 1. **使用 PM2 管理进程**:
285
+ ```bash
286
+ npm install -g pm2
287
+ pm2 start server/index.js --name collabdocchat
288
+ pm2 startup
289
+ pm2 save
290
+ ```
291
+
292
+ 2. **配置反向代理** (Nginx):
293
+ ```nginx
294
+ server {
295
+ listen 80;
296
+ server_name your-domain.com;
297
+
298
+ location / {
299
+ proxy_pass http://localhost:3000;
300
+ proxy_http_version 1.1;
301
+ proxy_set_header Upgrade $http_upgrade;
302
+ proxy_set_header Connection 'upgrade';
303
+ proxy_set_header Host $host;
304
+ proxy_cache_bypass $http_upgrade;
305
+ }
306
+ }
307
+ ```
308
+
309
+ 3. **启用 MongoDB 认证**:
310
+ ```javascript
311
+ // .env
312
+ MONGODB_URI=mongodb://username:password@localhost:27017/collabdocchat?authSource=admin
313
+ ```
314
+
315
+ ## 🔐 安全建议
316
+
317
+ 1. **修改默认管理员密码**
318
+ 2. **使用强 JWT 密钥**
319
+ 3. **启用 HTTPS**
320
+ 4. **配置防火墙规则**
321
+ 5. **定期更新依赖包**
322
+
323
+ ```bash
324
+ npm audit
325
+ npm audit fix
326
+ ```
327
+
328
+ ## 📞 获取帮助
329
+
330
+ 如果遇到问题:
331
+
332
+ 1. 查看 [GitHub Issues](https://github.com/shijinghao/collabdocchat/issues)
333
+ 2. 阅读 [完整文档](https://github.com/shijinghao/collabdocchat#readme)
334
+ 3. 提交新的 Issue
335
+
336
+ ## 🎉 安装成功!
337
+
338
+ 现在您可以:
339
+ - 创建文档并邀请团队成员协作
340
+ - 使用实时聊天功能
341
+ - 管理任务和项目
342
+ - 探索更多功能
343
+
344
+ 祝您使用愉快!🚀
345
+
package/README.md CHANGED
@@ -226,10 +226,20 @@ npm run serve
226
226
 
227
227
  ## 📝 更新日志
228
228
 
229
+ ### v1.2.5 (2026-01-26)
230
+ - 🔧 修复 Windows 下 CLI 启动问题
231
+ - 📚 优化安装和使用说明
232
+ - ✨ 简化启动流程
233
+
234
+ ### v1.2.4 (2026-01-26)
235
+ - 🐛 修复浏览器自动打开功能
236
+
237
+ ### v1.2.3 (2026-01-26)
238
+ - 📚 添加完整的 README 文档
239
+
229
240
  ### v1.2.2 (2026-01-26)
230
- - ✅ 发布到 npm
241
+ - ✅ 首次发布到 npm
231
242
  - 🔧 修复 package.json 配置
232
- - 📚 完善文档
233
243
 
234
244
  ### v1.2.0
235
245
  - ✨ 添加任务管理功能
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "collabdocchat",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "开源的实时协作文档聊天平台 - 集成任务管理、多人文档编辑、智能点名功能",
5
5
  "main": "./server/index.js",
6
6
  "type": "module",
@@ -20,7 +20,9 @@
20
20
  ".gitignore",
21
21
  "install-and-start.bat",
22
22
  "install-and-start.sh",
23
- "QUICK_START.md"
23
+ "QUICK_START.md",
24
+ "INSTALLATION.md",
25
+ "CONTRIBUTING.md"
24
26
  ],
25
27
  "keywords": [
26
28
  "collaboration",