
项目背景
这个项目主要是为了玩玩 NodeJS,项目的方向大概是做出类似 QQ 的在线聊天系统。想要在线体验可以点击在线演示。
项目使用 PM2 进行部署和管理,功能在不断的迭代开发中。如果你觉得这个项目比较有趣,或者能对你有所帮助,欢迎给个 Star。
项目地址:https://github.com/bergwhite/nodejs-chat
PS: 最近找工作,北京的欢迎联系。另外之前做过一个基于 Vue 全家桶二次开发的 V2EX 社区 https://github.com/bergwhite/v2ex-vue。
项目目录
├─bin │ www // 启动 express ├─database │ index.js // MongoDB ├─public // 静态文件 │ css │ index.css // 首页 CSS │ js │ index.js // 与 socket 服务进行通讯(关键文件) | socket-server.js // socket 服务(关键文件) │ img ├─routers │ index.js // 页面路由 ├─view │ error.ejs // 错误页 │ index.ejs // 首页 │ userCenter.ejs // 用户中心(规划中) │ userList.ejs // 用户列表(规划中) ├─app.js // express ├─package.json // npm 包 路由
目前只有 /目录和 /room/:id 正式使用了,其他路由的页面还在迭代开发中。
/ // 首页 /user // 用户列表 /user/:id // 用户中心 /user/:id/register // 注册( JSON ) /user/:id/login // 登陆( JSON ) /user/:id/logout // 注销( JSON ) /user/:id/info // 用户资料( JSON ) /room/:id // 指定聊天室 开始安装
使用之前,请在 package.json 中修改 MongoDB 的安装路径(--dbpath )。
git clone https://github.com/bergwhite/nodejs-chat // 克隆项目到本地 cd nodejs-chat // 进入项目目录 npm install // 安装依赖 npm run build // 构建线上代码 npm run mongod // 启动 MongoDB 服务 npm run start // 启动聊天室服务并启动网站 项目演示
目前项目存在一个已知的 bug,表情包无法在 div 模拟的输入框中插入(修复中)。
匿名聊天

用户聊天

成员&房间

离线通知

更多房间

房间独立

已上线功能
待上线功能
用户名
头像
聊天
数据库
项目缺陷
1 izayl 2017-05-31 14:32:29 +08:00 via Android 我也做了个类似的,多了一个 WebRTC 实现的音视频聊天功能 |