即时通讯IM
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
Xinwei Xiong 863e925b30
Update README.md (#795)
11 months ago
.docker-compose_cfg feat: add license 1 year ago
.github style: add format and lint (#773) 11 months ago
CHANGELOG feat: add test format (#657) 11 months ago
assets fix: delete batch build all file (#561) 12 months ago
build/docker style: add format and lint (#773) 11 months ago
cmd style: add format and lint (#773) 11 months ago
config nginx minio configuration picture can not be sent (#763) 11 months ago
deployments Update README.md (#795) 11 months ago
docs Update go_code.md (#794) 11 months ago
internal style: add format and lint (#773) 11 months ago
pkg style: add format and lint (#773) 11 months ago
scripts style: add format and lint (#773) 11 months ago
test fix: part of the make rules optimization (#751) 11 months ago
.dockerignore feat: add test file 12 months ago
.env fix: docker images (#701) 11 months ago
.gitignore fix: delete batch build all file (#561) 12 months ago
.golangci.yml fix: part of the make rules optimization (#751) 11 months ago
.goreleaser.yaml fix: part of the make rules optimization (#751) 11 months ago
CHANGELOG.md feat: add link file 1 year ago
CODE_OF_CONDUCT.md docs: update create CODE_OF_CONDUCT.md (#705) 11 months ago
CONTRIBUTING.md docs: fix lint update CONTRIBUTING.md (#632) 12 months ago
Dockerfile fix: part of the make rules optimization (#751) 11 months ago
LICENSE v3 - main to cut out 1 year ago
Makefile feat: add openim log (#679) 11 months ago
README-zh_CN.md update readme: With the release of the new system, the readme is also updated accordingly. 12 months ago
README.md Update README.md (#793) 11 months ago
docker-compose.yaml fix: part of the make rules optimization (#751) 11 months ago
go.mod feat(deps): bump the gomod-deps group with 1 update (#771) 11 months ago
go.sum feat(deps): bump the gomod-deps group with 1 update (#771) 11 months ago
install.sh fix: part of the make rules optimization (#751) 11 months ago
install_guide.sh fix: part of the make rules optimization (#751) 11 months ago

README.md

Open source Instant Messaging Server

A+ good first

English 简体中文 Docs

About OpenIM

Open-IM-Server is a robust instant messaging server engineered using pure Golang, leveraging JSON over WebSocket for communication. The server treats everything as a message, facilitating straightforward customization without modifying the server code. Its microservice architecture enables deployment using clusters, ensuring high performance and scalability.

Whether you're looking to integrate instant messaging or real-time networking into your applications, Open-IM-Server is your go-to solution! 🚀

It's important to note that Open-IM-Server isn't a standalone product, and it doesn't include account registration and login services. However, we've made your life easier by open-sourcing the chat repository that includes login and registration features. Deploying the chat business server alongside Open-IM-Server quickly sets up a comprehensive chat product. 👥

🌟 Why OpenIM

🔍 Function screenshot display

multiple message Efficient meetings
One-to-one and group chats Special features - Custom messages
  1. Comprehensive Message Type Support 💬 Supports almost all types of messages, including text, images, emojis, voice, video, geographical location, files, quotes, business cards, system notifications, custom messages and more Supports one-on-one and multi-person audio and video calls

    Provides terminal support for multiple platforms such as iOS, Android, Flutter, uni-app, ReactNative, Electron, Web, H5

  2. Efficient Meetings Anytime, Anywhere 🌎

    Based on IM (Instant Messaging) with 100% reliable forced signaling capabilities, it paves the way for IM systems, deeply integrated with chat applications

    Supports hundreds of people in a single meeting, with subscription numbers reaching thousands, and server-side audio and video recording

  3. One-on-one and Group Chats for Various Social Scenarios 👥

    OpenIM has four roles: application administrator, group owner, group administrator, and regular member

    Powerful group features such as muting, group announcements, group validation, unlimited group members, and loading group messages as needed

  4. Unique Features 🌟

    Supports read-and-burn private chats, customizable duration

    Message editing function broadens social scenarios, making instant communication more diverse and interesting

  5. Open Source 👐

    The code of OpenIM is open source, self-controlled data, aimed at building a globally leading IM open source community, including client SDK and server

    Based on open source Server, many excellent open source projects have been developed, such as OpenKF (Open source AI customer service system)

  6. Easy to Expand 🔧

    The OpenIM server is implemented in Golang, introducing an innovative "everything is a message" communication model, simplifying the implementation of custom messages and extended features

  7. High Performance 🏎️

    OpenIM supports a hierarchical governance architecture in the cluster, tested by a large number of users, and abstracts the storage model of online messages, offline messages, and historical messages

  8. Full Platform Support 📺

    Supports native iOS, Android; cross-platform Flutter, uni-app, ReactNative; major web front-end frameworks such as React, Vue; applets; and PC platforms supported by Electron

  9. The ultimate deployment experience 🤖

    Supports cluster deployment

    Supports multi-architecture mirroring, our Docker images are hosted not only on GitHub but also on Alibaba Cloud and Docker Hub supporting multiple architectures. Visit our GitHub packages and read our version management document for more information.

  10. A large ecosystem of open source communities 🤲

    We have tens of thousands of users and many solutions to problems.

    We have a large open source community called OpenIMSDK that runs the core modules, we have an open source community called openim-sigs to explore more IM-based infrastructure products.

🚀 Quick Start

Deploying with Docker Compose
  1. Clone the project
# choose what you need
BRANCH=release-v3.1
git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim && export openim=$(pwd)/openim && cd $openim && make build

Note

Read our release policy: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md

  1. Modify .env
USER=root #no need to modify
PASSWORD=openIM123  #A combination of 8 or more numbers and letters, this password applies to redis, mysql, mongo, as well as accessSecret in config/config.yaml
ENDPOINT=http://127.0.0.1:10005 #minio's external service IP and port, or use the domain name storage.xx.xx, the app must be able to access this IP and port or domain,
API_URL=http://127.0.0.1:10002/object/ #the app must be able to access this IP and port or domain,
DATA_DIR=./  #designate large disk directory
  1. Deploy and start

Note This command can only be executed once. It will modify the component passwords in docker-compose based on the PASSWORD variable in .env, and modify the component passwords in config/config.yaml. If the password in .env changes, you need to first execute docker-compose down; rm components -rf and then execute this command.

make install
  1. Check the service
make check

https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/images/docker_build.png

Compile from Source

Ur need Go 1.18 or higher version, and make.

Version Details: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md

# choose what you need
BRANCH=release-v3.1
git clone -b $BRANCH https://github.com/OpenIMSDK/Open-IM-Server openim && export openim=$(pwd)/openim && cd $openim && make build

Read about the OpenIM Version Policy

make help to help you see the instructions supported by OpenIM.

All services have been successfully built as shown in the figure

Successful Compilation

Component Configuration Instructions

The config/config.yaml file has detailed configuration instructions for the storage components.

  • Zookeeper

    • Used for RPC service discovery and registration, cluster support.

      zookeeper:
        schema: openim                          #Not recommended to modify
        address: [ 127.0.0.1:2181 ]             #address
        username:                               #username
        password:                               #password
      
  • MySQL

    • Used for storing users, relationships, and groups, supports master-slave database.

      mysql:
        address: [ 127.0.0.1:13306 ]            #address
        username: root                          #username
        password: openIM123                     #password
        database: openIM_v2                     #Not recommended to modify
        maxOpenConn: 1000                       #maximum connection
        maxIdleConn: 100                        #maximum idle connection
        maxLifeTime: 60                         #maximum time a connection can be reused (seconds)
        logLevel: 4                             #log level 1=slient 2=error 3=warn 4=info
        slowThreshold: 500                      #slow statement threshold (milliseconds)
      
  • Mongo

    • Used for storing offline messages, supports mongo sharded clusters.

      mongo:
        uri:                                    #Use this value directly if not empty
        address: [ 127.0.0.1:37017 ]            #address
        database: openIM                        #default mongo db
        username: root                          #username
        password: openIM123                     #password
        maxPoolSize: 100                        #maximum connections
      
  • Redis

    • Used for storing message sequence numbers, latest messages, user tokens, and mysql cache, supports cluster deployment.

      redis:
        address: [ 127.0.0.1:16379 ]            #address
        username:                               #username
        password: openIM123                     #password
      
  • Kafka

    • Used for message queues, for message decoupling, supports cluster deployment.

      kafka:
        username:                               #username
        password:                               #password
        addr: [ 127.0.0.1:9092 ]                #address
        latestMsgToRedis:
          topic: "latestMsgToRedis"
        offlineMsgToMongo:
          topic: "offlineMsgToMongoMysql"
        msgToPush:
          topic: "msqToPush"
        msgToModify:
          topic: "msgToModify"
        consumerGroupID:
          msgToRedis: redis
          msgToMongo: mongo
          msgToMySql: mysql
          msgToPush: push
          msgToModify: modify
      
Start and Stop Services

Start services

./scripts/start_all.sh;

Check services

./scripts/check_all.sh

Stop services

./scripts/stop_all.sh
Open IM Ports
TCP Port Description Operation
TCP:10001 ws protocol, message port such as message sending, pushing etc, used for client SDK Port release or nginx reverse proxy, and firewall off
TCP:10002 api port, such as user, friend, group, message interfaces. Port release or nginx reverse proxy, and firewall off
TCP:10005 Required when choosing minio storage (openIM uses minio storage by default) Port release or nginx reverse proxy, and firewall off
Open Chat Ports
TCP Port Description Operation
TCP:10008 Business system, such as registration, login etc Port release or nginx reverse proxy, and firewall off
TCP:10009 Management backend, such as statistics, banning etc Port release or nginx reverse proxy, and firewall off

OpenIM isn't just an open-source instant messaging component, it's an integral part of your application ecosystem. Check out this diagram to understand how AppServer, AppClient, Open-IM-Server, and Open-IM-SDK interact.

App-OpenIM Relationship

🏗️ Overall Architecture

Delve into the heart of Open-IM-Server's functionality with our architecture diagram.

Overall Architecture

🛠️ To start developing OpenIM

OpenIM Our goal is to build a top-level open source community. We have a set of standards, in the Community repository.

If you'd like to contribute to this Open-IM-Server repository, please read our contributor documentation.

Before you start, please make sure your changes are in demand. The best for that is to create a new discussion OR Slack Communication, or if you find an issue, report it first.

👥 Community

📆 Community Meetings

We want anyone to get involved in our community and contributing code, we offer gifts and rewards, and we welcome you to join us every Thursday night.

Our conference is in the OpenIM Slack 🎯, then you can search the Open-IM-Server pipeline to join

We take notes of each biweekly meeting in GitHub discussions, Our historical meeting notes, as well as replays of the meetings are available at Google Docs 📑.

👀 Who are using OpenIM

Check out our user case studies page for a list of the project users. Don't hesitate to leave a 📝comment and share your use case.

📄 License

OpenIM is licensed under the Apache 2.0 license. See LICENSE for the full license text.

The OpenIM logo, including its variations and animated versions, displayed in this repository OpenIM under the assets/logo and assets/logo-gif directories, are protected by copyright laws.

🔮 Thanks to our contributors!