All Projects → Q956164483 → Chatroom

Q956164483 / Chatroom

vue2聊天室,图灵机器人,node爬虫

Projects that are alternatives of or similar to Chatroom

Vue Chat
👥Vue全家桶+Socket.io+Express/Koa2打造一个智能聊天室。
Stars: ✭ 887 (+761.17%)
Mutual labels:  koa, koa2, socketio
Koahub Demo
koahub+async/await+mysql
Stars: ✭ 15 (-85.44%)
Mutual labels:  koa, koa2
Mysrv
Yet another Node.js web framework, based on koa.js 又一个 Node.js MVC 框架,基于Koa2
Stars: ✭ 10 (-90.29%)
Mutual labels:  koa, koa2
Koa Sslify
Enforce HTTPS in node.js koa apps
Stars: ✭ 100 (-2.91%)
Mutual labels:  koa, koa2
Koa Dec Router
An ES6 decorator + class based router, support inherit, override, priority, auto load controllers, etc.
Stars: ✭ 19 (-81.55%)
Mutual labels:  koa, koa2
Cykspace Node
博客后台服务~~ 👉👉 http://www.cykspace.com
Stars: ✭ 23 (-77.67%)
Mutual labels:  koa, koa2
Vue Socket.io Chat
💬 TypeScript + Vue + Express/Koa + Socket.io
Stars: ✭ 61 (-40.78%)
Mutual labels:  koa, koa2
Koa Passport
Passport middleware for Koa
Stars: ✭ 748 (+626.21%)
Mutual labels:  koa, koa2
Trafficlight
🚦 Flexible NodeJS Routing Decorators for API Routing
Stars: ✭ 69 (-33.01%)
Mutual labels:  koa, koa2
Nodejs Koa Blog
基于 Node.js Koa2 实战开发的一套完整的博客项目网站
Stars: ✭ 1,162 (+1028.16%)
Mutual labels:  koa, koa2
Chatroom Vue
一个简单的多人聊天室。基于vue和node+Socket.IO
Stars: ✭ 71 (-31.07%)
Mutual labels:  socket, socketio
Nodeclub Koa
use koa to rewrite nodeclub
Stars: ✭ 18 (-82.52%)
Mutual labels:  koa, koa2
Koa Ts
koa2+typescript
Stars: ✭ 82 (-20.39%)
Mutual labels:  koa, koa2
Koa Generator
Koa' application generator for 1.x and 2.x( Express-style and support all middlewares include async/await )
Stars: ✭ 929 (+801.94%)
Mutual labels:  koa, koa2
Koa Weixin Jssdk
koa weixin jssdk middleware
Stars: ✭ 7 (-93.2%)
Mutual labels:  koa, koa2
Mean Angular4 Chat App
MEAN stack with Angular 4 Chat App
Stars: ✭ 41 (-60.19%)
Mutual labels:  socket, socketio
Vue Koa Demo
🔰A simple full stack demo(CSR & SSR & Docker Support) written by Vue2 & Koa2(Koa1 verson also completed)
Stars: ✭ 730 (+608.74%)
Mutual labels:  koa, koa2
Node Typescript Koa Rest
REST API boilerplate using NodeJS and KOA2, typescript. Logging and JWT as middlewares. TypeORM with class-validator, SQL CRUD. Docker included. Swagger docs, actions CI and valuable README
Stars: ✭ 739 (+617.48%)
Mutual labels:  koa, koa2
Koatty
Koa2 + Typescript = Koatty. Use Typescript's decorator implement IOC and AOP.
Stars: ✭ 67 (-34.95%)
Mutual labels:  koa, koa2
Koach Javascript
Production ready Koa2 boilerplate.
Stars: ✭ 79 (-23.3%)
Mutual labels:  koa, koa2

vue+koa2聊天室,实时推送比特币价格,爬取电影网站

技术栈

vue+vuex+vue-router+socket.io+koa2+mongodb+pm2自动化部署+图灵机器人+[npm script打包,cdn同步,服务器上传一个命令全搞定]

功能清单

登陆注册

获取聊天记录(包含前端分页优化)

发送文字,表情,文件消息

创建群组,添加群组,群组搜索

修改个人信息,群组信息

图片裁剪压缩上传

私聊

图灵机器人接入

定时任务爬取电影和btc等数字货币的价格并使用socket.io实时推送给所有客户端

前端一键打包同步到七牛cdn并上传到服务器的实现

server端的pm2自动部署

效果演示chrome下F12或者手机扫描下面的二维码

后端的代码暂时不开放出来,因为涉及到很多个人的配置数据,如果实在需要可以加微信 MSC199312 (需要付费0.0!),毕竟这个小项目断断续续也做了几个星期,也还花了些心思,而且涉及的知识点也都还是很广很实用的,还望理解,其实主要原因还是穷[泪奔]

部分代码

客户端 main.js

import Vue from 'vue'
import App from './App'
import router from './router'
import VueLazyload from 'vue-lazyload'
import store from '@/store'
import io from 'socket.io-client'
import '@/assets/js/remChange'
import '@/assets/js/request'
// import { wxConfig, updateShare } from '@/assets/js/wxenv'
import '@/assets/css/common.scss'
import 'swiper/dist/css/swiper.min.css'
import config from '@/assets/js/config'
import filters from '@/assets/js/filters'
import { openToast } from '@/assets/js/tools'

Vue.config.productionTip = false

// 初始化全局过滤器
Object.keys(filters).forEach(item => {
  Vue.filter(item, filters[item])
})

// 懒加载
Vue.use(VueLazyload, {
  attempt: 1,
  // preLoad: 1.3,
  error: require('./assets/images/404.png'),
  loading: require('./assets/images/loading-img2.gif'),
  // the default is ['scroll', 'wheel', 'mousewheel', 'resize', 'animationend', 'transitionend']
  listenEvents: [ 'scroll' ]
})

Vue.prototype.$config = config

router.beforeEach((to, from, next) => {
  // 如果未匹配到路由
  if (to.matched.length === 0) {
    // 如果上级也未匹配到路由则跳转登录页面,如果上级能匹配到则转上级路由
    from.name ? next({ name: from.name }) : next('/')
  } else {
    // 路由切换时改变页面标题
    document.querySelector('title').innerHTML = to.name
    // 统计代码
    if (to.path) _czc.push(['_trackPageview', '/#' + to.fullPath], '')
    next()
  }
})

// 路由变化重新配置微信分享
router.afterEach(to => {
  // wxConfig(() => updateShare())
})

// socket.io 初始化
const socket = io.connect(config.socketBase)
Vue.prototype.$socket = socket
Vue.prototype.$socketEmiter = (name, data) => {
  store.commit('isLoading', true)
  return new Promise((resolve) => {
    socket.emit(name, data, res => {
      console.log(`${name}>>>`, res)
      store.commit('isLoading', false)
      if (res.status === 1) {
        resolve(res.data)
      } else {
        openToast({
          msg: res.message,
          duration: 1500
        })
      }
    })
  })
}

/* eslint-disable no-new */
const app = new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})

server端 app.js

const Koa = require('koa')
const { resolve } = require('path')
const glob = require('glob')
const { connectDatabase, initAllSchema, initDefaultUser } = require('./database/init')
const config = require('./config')

const useMiddlewares = app => {
  glob.sync(resolve(__dirname, './middlewares', '**/*.js')).forEach(item => {
    require(item)(app)
  })
}

(async () => {

  console.log('数据库初始化...')
  await connectDatabase()
  initAllSchema()
  await initDefaultUser()

  const app = new Koa()

  console.log('挂载socket.io...')
  const server = require('http').Server(app.callback())
  const io = require('socket.io').listen(server)
  require('./socket')(io)

  // 暴露出io可在其他地方做推送功能
  module.exports.io = io

  console.log('挂载中间件...')
  useMiddlewares(app)

  console.log('初始化定时任务...')
  // 多了进行一下封装?
  require('./tools/crawlMovie')
  require('./tools/crawlCoin')

  server.listen(config.server.PORT, () => {
    console.log('正在监听' + config.server.PORT + '端口...')
  })

})()

部分运行截图

主页 聊天 群信息 个人信息 发送表情 发送图片和文件 图片裁剪 菜单 群聊搜索 群信息

最后贴上git地址欢迎给个star

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].