Skip to content

Instantly share code, notes, and snippets.

@Adophilus
Created February 13, 2023 20:34
Show Gist options
  • Save Adophilus/9781be7dbf42da50c7c8e293c914040e to your computer and use it in GitHub Desktop.
Save Adophilus/9781be7dbf42da50c7c8e293c914040e to your computer and use it in GitHub Desktop.

Meeting With Evans Precious

Chat Feature

  • help customers interact with clients
  • chat deletes after 24 hrs

Logic of operation

Sending messages

  • [Customer]: sends message to client
  • [Frontend]: sends message to Backend
  • [Backend]: receives request and stores message in a DB

Retrieving messages

  • [Customer]: opens up conversation with client
  • [Frontend]: hits up Backend to fetch latest messages
  • [Backend]: receives request, fetches messages from DB (according to query params), and sends messages back to Frontend
  • [Frontend]: renders messages appropriately
interface IMessage {
  sender string
  receipient string
  message string
  image string
  has_read bool
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment