Skip to content

Chat Room

Dikshali edited this page Sep 25, 2019 · 2 revisions

Chat Room

  • A logged-in user will be able to view the list of current chatrooms in the system. A user can join a chat room, view the posted messages, and post new messages.
  • A logged-in user can create a new chatroom.
  • In a chatroom, the messages will be displayed, indicating the message text, date/time of the message, name of user and number of likes.
  • A user can like a message by clicking on a like button displayed by each message.
  • A user can also delete messages that he/she created.
  • In a chatroom the user can also see the users currently active in the same chatroom in realtime (online user and offline users for a group).

Implementation

ChatRoom

  • User can create group with the help of the menu option in the application.
  • Group name (Chat room name) field is asked to create a chat room.
  • while creating details like createdOn, createdByName, createdById, GroupName, MembersListWithOnlineStatus(initially with the user id who created the group) is stored in Database with the groupId.

Messages

  • User can post messages and sends details like createdOn, createdByName, createdById, groupId, LikeUserId, message, messageId.

Data Design

Firebase Database

ChatRoom

  • groupChatRoom child is created in Database to store all the group information.
  • group details are stored against the groupId
  • Any user who joins the group its id gets added to the MembersListWithOnlineStatus with the online status that gets updated once he/she is outside/inside the chatroom.

Messages

  • messages child is created in Database to store all the message information chat room wise.
  • under messages, chatroomid child is created and all the message details goes in the particular chatroom.
  • any user who likes the message, their Id is stored in LikeUserId
Clone this wiki locally