E chat SDK introduction: compiling instant messaging backend projects from source

Keywords: Programming git Database MySQL Mobile

2. Introduction to mobile rear end: E chat SDK provides a basic back-end community version source code. By compiling / modifying the back-end source code, you can achieve deeper business customization, such as file upload / download, online / offline monitoring, API permission function, cluster function, etc. The backend project uses springboot+mybatis for development and maven for project management. The following describes how to compile back-end projects from source.

3. Operation steps: 3.1 download the source code of broker Release v1.01

git clone https://gitee.com/dzqmeiji/echatim-server-broker-community.git
cd echatim-server-broker-community/
git checkout -b v1.01 v1.01
mvn clean package -DskipTests=true  # Compile backend Middleware

3.2 download the source code of server Release v1.01

git clone https://gitee.com/dzqmeiji/echatim-server-community.git
cd echatim-server-community/
git checkout -b v1.01 v1.01
mvn clean package -DskipTests=true  # Compile backend project

3.3 download the source code of server Release v1.01

git clone https://gitee.com/dzqmeiji/echatim-server-community.git
cd echatim-server-community/
git checkout -b v1.01 v1.01
mvn clean package -DskipTests=true  # Compile backend project

3.4 import database structure and initial data Install MySQL 5.7 data service, create echatim database in mysql, import sqls/echatim-2020-04-30.sql file to echatim database. Create mysql root user with blank password

3.5 start backend project

cd server-community-deploy/target/
java -jar server-community-deploy-1.0.jar

After successful startup, you can see:

swagger test started. http://localhost:8082/swagger-ui.html
socket.io started. http://localhost:9092

API debugging: http://localhost:8082/swagger-ui.html socketIO address: http://localhost:9092

3.6 edit Web client configuration Source address

We use the E-chat local server as the chat background, and the configuration uses the local server configuration (there is no file service function in the community version)

//      src/main.js  Document content
719     sdkConfig.host = 'localhost';  //Use local server
720     sdkConfig.httpPort = 8082;  //Use local default configuration
721     sdkConfig.socketPort = 9092;  //Use local default configuration
722     sdkConfig.key = 'TSDKTEST00001'; # View database sdk_app table
723     sdkConfig.secret = '';  // This is a reserved configuration and does not need to be changed

Use yarn start to use the local back-end project to realize the chat function

3.7 edit mobile client configuration Source address

We use the E-chat local server as the chat background, and the configuration uses the local server configuration (there is no file service function in the community version)

//      src/dev.ts  Document content
export const DevConfig = {
    HOST:'localhost',
    FILE_SERVER_URL:'http://localhost:8082',
};

//      src/AppInitializer.ts  Document content
  sdkConfig.httpPort = 8082; //Use local default configuration
  sdkConfig.socketPort = 9092; //Use local default configuration
  sdkConfig.key = 'TSDKTEST00001;
  sdkConfig.secret = ''; // This is a reserved configuration and does not need to be changed

//  . env file content
  SKIP_PREFLIGHT_CHECK=true
  # config web
  HOST=192.168.0.100 # Change to local IP address
  PORT=18088

Using yarn web, you can use the local back-end project to realize the chat function

4. Summary: The Web back-end project provides a back-end implementation with only basic functions. More functions need to be customized freely, which also brings greater expansibility and flexibility to the project.

Posted by aaadee on Sun, 07 Jun 2020 02:25:40 -0700