# Instant Messaging ### Introduce Raingad-IM is an open source instant communication demo, which needs to be used together with the front and back ends. It is mainly used for learning and communication, and provides you with the development ideas of instant communication. Many functions need to be developed by itself, and the original intention of development is to quickly establish the internal communication system, Intranet communication and community communication. | type | url | | --------- | ---- | | Front-end source code | https://gitee.com/raingad/im-chat-front | | Back-end source code | https://gitee.com/raingad/im-instant-chat | | Web Demo | http://im.raingad.com/index.html | | H5 Demo | http://im.raingad.com/h5 | | Android Demo | https://emoji.raingad.com/file/raingad.apk | Dmeo account:13800000002 password:123456 The ending number can be modified to 2、3、4......18、19、20 Dmeo account:13800000020 password:123456 ### Supported features -Supports single chat and group chat, and supports sending emoticons, images, voice, video, and file messages -Single chat supports displaying the status of messages that have been read but not read, and displaying online status -Group chat creation, deletion, group member management, group announcements, group bans, etc -Support for top contacts and message privacy; -Support for setting new message sound reminders and browser notifications -Support administrator to recall group member messages -Support group members cannot add friends to each other -Supports one-on-one audio and video calls (connected to both web and mobile devices, not supported by mini programs) -Supports online preview of files, images, and most media files -Support for mobile devices (H5, APP, and mini programs, some functions are not compatible) -New support for enterprise mode and community mode, with community mode supporting registration and adding friends functions -The app supports online and offline push of single chat messages (requires self application for unipush service) -Support simple backend management, including user management, group management, system settings, etc ### Software architecture Back-end technology stack:`thinkphp6+workerman+redis` Front-end technology stack:`vue2+Lemon-IMUI+element-UI` ### Installation > The installation program needs to have some experience in PHP and server operation and maintenance, if not, please join the communication group to contact the author, the author provides paid deployment services! #### Preparatory work You need to install the running environment first. The BAOTA server is recommended. The LNMP architecture is recommended. The following software needs to be installed: | environment | version | remark | Recommended | | --------- | ---- | ---- | ---| | linux | >= 7.0 | The following versions were not tested | 7.9 | | nginx | >= 1.17 | | latest | | php | >= 7.1 | incompatible php8 | 7.3 | | mysql | >= 5.7 | Must be 5.7 and above | 5.7 | | redis | >= 5.0 | | 7.0 | **重要操作** 1. PHP needs to install an extension : `redis` `fileinfo` 2. PHP needs to undisable the function : `shell_exec` `proc_open` `pcntl_exec` `pcntl_alarm` `pcntl_fork` `pcntl_waitpid` `pcntl_wait` `pcntl_signal` `pcntl_signal_dispatch` `putenv` #### Source code download - Clone to local : ``` git clone https://gitee.com/raingad/im-instant-chat.git ``` - 进入项目目录,执行: ``` composer install ``` or - 【Recommended】Download the full source code and put it on your own server. Take a look at the [(releases)](https://gitee.com/raingad/im-instant-chat/releases) at the top of the gitee project home page and download the latest release in the distribution. #### Start installation 1. Create a website by pointing the site's running directory to the 'public' directory in the project root. 2. Enable pseudo-static and set the reverse proxy, the following only shows the pseudo-static and reverse proxy configuration of nginx, apache please Baidu or use chatGPT conversion. ``` location ~* (runtime|application)/{ return 403; } location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } } #Reverse proxy port 8282, no modification required location /wss { proxy_pass http://127.0.0.1:8282; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header X-Real-IP $remote_addr; } ``` 3. If you have a domain name and want to use services such as audio and video calls and voice messaging, you also need to configure a certificate to enable HTTPS. You can use a free 'Let's Encrypt' certificate. If you don't need these services, you can directly use the HTTP protocol, but the functionality will be limited. 4. Access your IP or domain name to enter the custom installation wizard. 5. Access your IP or domain name to enter the custom installation wizard. #### If installation fails 1. Enter `public\sql\database.sql` to import the database into your own database. 2. Enter the project root directory, modify `example.env` to `.env` , and modify the corresponding database parameters. **Please carefully read the configuration instructions in env**. > if you want to save chat files to oss, you need to configure them in the background. Do not modify the environment configuration files after configuration. ### Start the message push service Because the chat software needs to use websockt, so we need to start workerman, the system has built-in corresponding services, you can manage the home page in the background to run services, but the first use needs to be debugged. 1. Enter the project root directory to run `php think worker:gateway start -d`, or run `php start.php start -d` to run the message service. Do not use `- d` during testing. Under windows, run the `start_for_ win.bat` file in the root directory directly. Since there are many restrictions on the use of Workerman under Windows, it is recommended to use Linux system in formal environment, while windows system is only recommended for development environment. 2. The message service needs to release port 8282. If you need to modify it, please modify the corresponding parameters in the `WORKER` section of the environment configuration file. For windows users, please modify port 8282 in [`app\worker\start_gateway.php`]. The port number needs to be changed according to the situation. 3. The system uses the domain name as the address of the websocket service directly, so it needs to configure the proxy in the nginx of the website and listen to port 8282. The parameters of the proxy configuration have been written in the pseudo-static. 4. For more information about the use of workerman, please visit [workerman official website](https://www.workerman.net/) official website. 5. After the deployment, the password for the administrator account is: `administrator``123456`, and the management entry is located in the lower left corner of the chat interface. ### Install deployment Services The author provides the installation services of the system, including the back-end and front-end deployment to the online, to ensure the perfect operation of the project, 200 yuan per time, the installation service can provide detailed installation tutorials and interface documents, if necessary, you can contact the author! ### QQ Communication group If you have any questions, please leave a message or join our QQ group! It's not easy to create. Click a star. [QQ Communication group:336921267](https://jq.qq.com/?_wv=1027&k=jMQAt9lh)