Giter VIP home page Giter VIP logo

webchat's Introduction

webchat

Build Status

中文版 English

说明: master 分支还不太稳定,可以查看 https://github.com/hua1995116/webchat/tree/v2.2.0 稳定分支, 3.0 版本持续重构中。

功能

  • 注册登录功能
  • 聊天功能
  • 查看历史记录
  • 多个聊天室
  • 与机器人对接
  • 图片发送
  • 发送链接
  • 发送表情
  • 图片预览
  • 消息未读
  • 断线重连
  • 好友资料查看
  • 添加好友
  • 单聊
  • 搜索好友
  • 热门好友推荐

启动项目

Dev环境: MongoDB、Node 8.5.0+、Npm 5.3.0+

Prod环境: Redis、MongoDB、Node 8.5.0+、Npm 5.3.0+

启动客户端

$webchat cd client

$client npm install -----安装依赖

$client npm run serve -----运行

启动服务端

$client cd ..

$webchat npm install

$webchat npm run dev

打包

打包客户端

cd client

npm run build

服务端运行

cd ..

npm run prod

在线观看

技术交流

qq群: 437938625

微信群: 加微信拉你进微信群。

技术栈

  • 前端 vue,vue-router ,vuex
  • 后端 nodejs,express
  • 数据库 mongodb
  • 通讯 websocket
  • 脚手架工具 vue-cli

效果

版本更新

v3新增功能

  1. 网络异常判断、重连提示
  2. 多端信息同步
  3. 好友资料查看
  4. 添加好友
  5. 单聊
  6. 搜索好友
  7. 热门好友推荐
  8. 性别、手机号修改
  9. 搜索加好友

版本预览

v2 稳定版本

https://github.com/hua1995116/webchat/tree/v2.2.0

其他版本

RELEASE

项目wiki

https://qiufeng.blue/node/#websocket-%E7%B3%BB%E5%88%97

API

API

License

MIT

MIT License

Copyright (c) 2018 蓝色的秋风

webchat's People

Contributors

2008820 avatar bxychy avatar hua1995116 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webchat's Issues

你好,想请教一下关于axios.post 的问题

初次接触这方面的知识, 在努力的阅读和理解你的代码. 但是遇到一个问题 我看到你的./store/ 有 axios.post('/user/signin')..... 我知道是发送一个 post 请求,但是在项目中没能找到对于的内容,部分代码复刻到自己的项目中 执行到这步的时候 /user/signin 404 了, 我想知道这边的axios.post 为什么在你的代码中可以请求到一个不存在的路由呢?

安装问题

按你提供的指导
npm install -----安装依赖

npm run dev -----运行

自动打开的页面无法获取到
需要在哪个位置修改参数吗?

哥们报错一下问题怎么解决呀

dledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Exited with code 3
(node:1369) [DEP0018] DeprecationWarning: Unhandled promise rejections are dep
我的redis和服务都运行起来了,mongodb也连接上了,就是这出现了问题

bug

http://www.qiufengh.com:9090/#/ 这个下面的
已经注册好了,但是登录不上,输入完账号密码之后点击登录就没有然后了。。。就没有然后了。。。。还是登录的页面
然后注册的时候,会弹出空对话框,不知道是账号重复了还是密码格式有问题,空对话框没有内容

[部署问题]关于部署能正常看到界面 ,无法连接socket的问题。

这个是自己部署的时候遇到的问题,不算一个问题,有解决方案,写下来提供给后面的小伙伴作为解决思路。

自己的域名是http的,对外只提供了一个80端口。所以我的后台项目,socket链接,都要用80端口转发。所以涉及到加后缀区分的问题,我使用的2.2的版本,其中的socoket域名与项目域名配置文件写在一起了,我自己遇到的问题是 域名/wechat 都使用同一个,然后nginx在转发的时候把socket链接拦截。上我的配置文件。

下面是nginx配置。。刚开始我的项目后台与socket都是使用 http://baidu.com/wechat 这个地址链接,项目可以正常打开,但是socket链接不报错,用wscat 链接返回200. nginx err也没有错误日志。

后来在看nginx的log日志的时候,发现socket链接的时候host是http://baidu.com/wechat这样的,于是我就把socket的配置单独修改成 http://baidu.com/ 这样了,然后就能连上socket了。

我的配置文件修改后的样子。

下面是config/client 修改后的样子,然后把src/socket中的地址修改即可。

export default {
server: (process.env.NODE_ENV === 'development' || isLocal )? 'http://localhost:8080/' : '//baidu.com/wechat/',
socketSerever: (process.env.NODE_ENV === 'development' || isLocal )? 'http://localhost:8080/' : '//baidu.com/',
}

server 外面配置

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

upstream websocket {
server 127.0.0.1:8087;
}

配置的一般的项目

location /wechat/ {
proxy_pass http://127.0.0.1:8087/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
client_max_body_size 2000m;
}

socket 服务的 location

location /socket.io/ {
	proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_set_header X-NginX-Proxy true;
            proxy_http_version 1.1;
            proxy_pass http://websocket;
}

项目作者使用的是https,以下是作者提供的nginx的配置。提供给大家参考。

server { listen 443 ssl; server_name www.qiufengh.com; # ssl on; #填写绑定证书的域名 listen 443 ssl; error_log logs/https-error.log debug; ssl_certificate /usr/local/nginx/conf/ssl_nginx/2704699_www.qiufengh.com.pem; ssl_certificate_key /usr/local/nginx/conf/ssl_nginx/2704699_www.qiufengh.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; # proxy_set_header Host $http_host; proxy_http_version 1.1; proxy_pass http://localhost:9090; } location /static/files { root "/home/webchat/dist/"; } location = /50x.html { root html; } error_page 404 /; error_page 500 502 503 504 /50x.html; }

数据库表在哪里

大佬,我刚学Mongodb,使用前输入命令mongod --config c:\MongoDB\etc\mongo.conf启动就好了,还需不需要导入数据库什么的,真的不懂,刚学望指教

run dev 有报错

ERROR Failed to compile with 26 errors 15:26:22

These dependencies were not found:

  • babel-runtime/regenerator in ./src/store/index.js, .//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./src/view/Loan.vue and 5 others
  • babel-runtime/helpers/asyncToGenerator in ./src/store/index.js, .//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./src/view/Loan.vue and 5 others
  • babel-runtime/helpers/extends in .//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./src/App.vue, .//babel-loader/lib!.//vue-loader/lib/selector.js?type=script&index=0!./src/view/Loan.vue and 4 others
  • babel-runtime/core-js/promise in ./src/api/axios.js, ./src/components/Alert/index.js and 1 other
  • babel-runtime/core-js/json/stringify in ./src/api/axios.js, ./src/utils/localStorage.js
  • babel-runtime/core-js/number/max-safe-integer in ./src/utils/localStorage.js

To install them, you can run: npm install --save babel-runtime/regenerator babel-runtime/helpers/asyncToGenerator babel-runtime/helpers/extends babel-runtime/core-js/promise babel-runtime/core-js/json/stringify babel-runtime/core-js/number/max-safe-integer

页面已经打开但是,显示Cannot GET /

似乎部署比较难

我在两台Ubuntu VPS和一台windows系统上都没有成功的跑起来。。。

求助

今天下午打开 可以登录注册 但是不能发送信息,而且会报一大堆的错误

npm: '5.5.1' .

npm install 报错
npm ERR! Cannot read property '0' of undefined。
npm run dev 报错

[email protected] dev /Users/lanpan/Downloads/webchat-master
node build/dev-server.js NODE_ENV=development

Starting dev server...
(node:851) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mongo-client

events.js:182
throw er; // Unhandled 'error' event
^
MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool. (/Users/lanpan/Downloads/webchat-master/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:336:35)
at emitOne (events.js:115:13)
at Pool.emit (events.js:210:7)
at Connection. (/Users/lanpan/Downloads/webchat-master/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:280:12)
at Object.onceWrapper (events.js:318:30)
at emitTwo (events.js:125:13)
at Connection.emit (events.js:213:7)
at Socket. (/Users/lanpan/Downloads/webchat-master/node_modules/mongoose/node_modules/mongodb-core/lib/connection/connection.js:187:49)
at Object.onceWrapper (events.js:316:30)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
From previous event:
at NativeConnection. (/Users/lanpan/Downloads/webchat-master/node_modules/mongoose/lib/connection.js:317:17)
at NativeConnection.deprecated [as open] (internal/util.js:52:15)
at Mongoose.connect (/Users/lanpan/Downloads/webchat-master/node_modules/mongoose/lib/index.js:268:47)
at Object. (/Users/lanpan/Downloads/webchat-master/build/dev-server.js:34:22)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: node build/dev-server.js NODE_ENV=development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.