The application will implement the below design where we expose a chat based on socket.io, which will forward the request to a MQTT broker queue and answer the user’s query using our bot.
The project is based on the following repositories:
- financialchat It renders the front end and handle the chat feature.
- financialmqttbroker It allows the communication between the chat server and the chat bot.
- financialbot It communicates with the financial chat via the mqttbroker.
The project is based on the following technologies:
You need to download the respositories a run each one using the following commands. I recommend to run in the following order:
- financialmqttbroker
- financialbot
- financialchat
- Prerequisite
npm install pm2 -g
- Install dependencies
npm install
- Start each project
npm start
Navigate to http://localhost:3000/
.
- Stop each project
npm stop
- Restart each project
npm restart
- Install dependencies
npm install
- Test each project
npm test
Navigate to http://167.172.216.74:3000/.
- It allows the users to users to log in and talk with other users in a chatroom.
- It allows to have multiple chat rooms.
- It keeps the history of the last 50 messages in the chat room.
- It communicates with the chat bot (only one command is implemented)
All messages on the chat that starts with /
is recognize as a command.
-
/stock=COMPANY_CODE
It returns the stock values of the company code.