Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add ability to send messages #198

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

tuanthanh2067
Copy link
Owner

@tuanthanh2067 tuanthanh2067 commented Feb 16, 2022

Related issue

Fixes #177, Fixes #72

Type of Change

  • Feat: Change which adds functionality/new feature
  • Fix: Change which fixes an issue
  • Refactor: Change which improves the structure of the code
  • Docs: Change which improves documentation

Description

This PR implements Apollo Pubsub which allows users to send and receive messages real time. Messages will be stored in the db.

Demo

Screen.Recording.2022-02-16.at.1.28.21.PM.mov

Frontend

Just like you would use query or mutation, you can call the subscription and get their returned value. The subscription will keep listening for a specific CHANNEL. The channel here is named as followed CHANNEL_{roomId} (CHANNEL_abcd1234).

How to test

  • Login, use 2 accounts that are in same room
  • One will use subscription just like how we use query and mutation but when being called, it will keeps listening for a CHANNEL name.
  • Use the other account to sendMessage using mutation.

@vercel
Copy link

vercel bot commented Feb 16, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tuanthanh2067/seeksi/5Qja41vLgjroqoYmCyGKvWvLW79Z
✅ Preview: https://seeksi-git-feature-implement-realtime-chat-tuanthanh2067.vercel.app

Copy link
Collaborator

@oliver-pham oliver-pham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 👏 ! We'll probably have a separate issue to handle sending a photo in a message.

@tuanthanh2067 tuanthanh2067 merged commit 86edde9 into main Feb 17, 2022
@tuanthanh2067 tuanthanh2067 deleted the feature/implement-realtime-chat branch February 17, 2022 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement real time chat User conversation - display message history
2 participants