Git Product home page Git Product logo

im's Introduction

IM(即时通讯)

基于Golang、Websocket、MongoDB 实现即时通讯

技术栈

语言: Golang 数据库: MongoDB 框架: GIN 协议: Websocket

核心包

https://github.com/gorilla/websocket

扩展安装

go get -u github.com/gin-gonic/gin
go get github.com/gorilla/websocket
go get go.mongodb.org/mongo-driver/mongo
go get -u github.com/golang-jwt/jwt/v4
go get github.com/satori/go.uuid

Docker 安装 mongoDB

docker run -d --network some-network --name some-mongo \
-e MONGO_INITDB_ROOT_USERNAME=admin \
-e MONGO_INITDB_ROOT_PASSWORD=admin \
-p 27017:27017 \
mongo

数据字典

用户集合

{
  "account": "账号",
  "password": "密码",
  "nickname": "昵称",
  "sex": 1, // 0-未知 1-男 2-女
  "email": "邮箱",
  "avatar": "头像",
  "created_at": 1, //创建时间
  "updated_at": 1, //更新时间
}

消息集合

{
  "user_identity": "用户唯一标识",
  "room_identity": "房间唯一标识",
  "data": "发送数据",
  "created_at": 1, //创建时间
  "updated_at": 1, //更新时间
}

房间集合

{
    "number":"房间号",
		"name":"房间名称",
		"info":"房间简介",
		"user_identity":"房间创建者唯一标识",
		"created_at":1, //房间创建时间
		"updated_at":1, //房间更新时间
}

用户和房间集合

{
    "user_identity":"用户的唯一标识",
		"room_identity":"房间的唯一标识",
		"message_identity":"消息的唯一标识",
		"created_at":1, //创建时间
		"updated_at":1, //更新时间
}

im's People

Contributors

peaksee avatar

Stargazers

 avatar

Watchers

 avatar

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.