You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all, this is a basic one on one chat application developed using socket.io and MERN stack as a assignment for flo mobility interview processs
This web application includes features like features like real time chatting along with status monitoring of users made possible via web sockets
Data Base Design and Setup
The Data Base used is Mongo DB deployed in Atlas shared cluster and all the schemas and queries were done using mongoose
The Data base mainly consists for two collections namely
Users :
Stores details regarding name,email,password (passwords are hashed using bycrypt)
Messages :
Stores message conversations between users made possible by having fields like users array storing usersids and message field storing messages belonging between the users this simple structure helps in further extending the design and features when needed for instance addition of group chat feature etc..
API'S USED
API's that were used to build this application were mainly login, register, add message, get message,get users
WEB SOCKETS USED
Web sockets were mainly used to emit events and listen to events emitted from frontend each user was separately isolated in a roon like logical structure to make
real time messaging possible
For status monitoring to reduce the complexity of the problem instead of a cache based DB and I have used server's memory to store user's status which is emitted to all the rooms present whenever a users leaves or opens the chatty application
Assumptions made
The assusmptions made on developing backend is using of server's memory instead of a db like redis to cache the status of users believing that this
demo app will not cause any crash of memory limit