cabrelkemfang / spring-xmpp-websocket-reactjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

spring-xmpp-websocket-reactjs

IM System Diagram

Tech Stack

Installation

  1. Run backend services:

    docker-compose up
  2. Go to http://localhost:9090 and setup openfire XMPP server:

    • Server settings:
      • Set "XMPP Domain Name" to localhost
      • Set "Server Host Name (FQDN)" to localhost
      • Leave the rest as it is.
    • Database Settings:
      • Select "Standard Database Connection"
      • Select "MySQL"
      • Replace on the "Database URL" HOSTNAME with openfire-mysql and DATABASENAME with openfire, then fill in the username and password.
    • Continue and ignore the rest of the steps.
  3. Now you can use a websocket client to try out the backend application.

    • Endpoint: ws://localhost:8080/chat/sergio/pass
    • Connect will return {"messageType":"JOIN_SUCCESS"}
    • Send new message with body:
      {
          "from": "sergio",
          "to": "jose",
          "content": "hello world",
          "messageType": "NEW_MESSAGE"
      }
      
      will return {"from":"sergio","to":"jose","content":"hello world","messageType":"NEW_MESSAGE"}
  4. Run ReactJS App

npm install
npm start

Running Tests

To run tests, run the following command

  mvn clean install

About


Languages

Language:Java 53.3%Language:JavaScript 37.8%Language:CSS 6.0%Language:HTML 2.5%Language:Dockerfile 0.3%