A customizable chat window that can be integrated into web sites as a FAB, also has an admin panel to manage all client chats.
Clone this repository on your local machine.
cd to this repository and enter npm install
in the terminal to install all dependencies.
Enter mongo
in your terminal and make a collection named chat to store messages and a collection named users to store user details. (not necessary )
Change the name of the collection in the server.js(9th line onwards) according to the names of your collections.
Open another terminal, cd to this repo and shoot up a node server by typing node server.js
and a python server by typing python-m SimpleHTTPServer
(specify the port if required, default is 8000).
Open your browser and go to localhost:8080/chat.html
and in another window open localhost:8080/admin-2.html
User is prompted to enter name and email on first visit which is stored in localstorage, check whether it is being stored or not and messages are being received on the admin panel or not.
Start chatting and check whether the messages are being communicated properly or not by using db.collection.find()
in your mongo CLI. (replace collection by your collection name, say messages)
Customize the server.js file to change storage and access methods. (right now , every message is stored as an object with the fields name : ‘name of sender’, message : ‘message content’, uid : ‘user id’, createdOn : ‘timestamp’)
localhost:8000/chat.html
like this.