Skip to content
New issue

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

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

Already on GitHub? # to your account

Messages Infrastructure #16

Open
1 task
jaydenpersonnat opened this issue Oct 25, 2023 · 0 comments
Open
1 task

Messages Infrastructure #16

jaydenpersonnat opened this issue Oct 25, 2023 · 0 comments
Assignees

Comments

@jaydenpersonnat
Copy link
Collaborator

jaydenpersonnat commented Oct 25, 2023

Resources
Supabase Realtime
Realtime with NextJS (video)

Description
Implement a rudimentary system for messaging between patients and clinicians. Clinicians and patients should be able to start chats with one another, and have multiple running chats. Note that clinician-to-patient and patient-to-clinician messaging should be possible, but not patient-to-patient or clinician-to-clinician. Don't worry about styling for now, we want to focus on the functionality of messaging first.

This is a 2-person deliverable, and it's up to you to split work appropriately and/or find time to meet to work together. Everything may not be 100% clear at first, so take some time together to do research wherever you need to!

  • Implement basic messaging between patients and clinicians
    • Create a page in app/messages
    • Check out Supabase Realtime, an API working through PostgreSQL's replication functionality. You should be able to subscribe to tables and listen for relevant inserts to update your chat logs as messages get sent. There is also a short video with some helpful demos/instructions on using realtime that you might find helpful (e.g. timestamp 4:43)
    • You can focus just on text for now, no need to look into things like photos, files, etc.
    • Patients and clinicians in the same clinic should be able to start or continue chats with one another.
    • Make sure you're enabling realtime in your database wherever you need it (i.e. the messages table).
    • Be sure to unsubscribe to any channels whenever listening for inserts is no longer necessary.
    • NOTE: As seen on Figma, eventually we'll want to make it easy for users to see all their chats, so try to avoid implementing this in a way that requires a separate route per chat. (e.g. you can listen for all new messages, and select those that have the current user as a sender/recipient, then direct those messages to be displayed in the appropriate chat)
      • It may be worthwhile to create a component for each chat, then pass in the relevant messages as props!
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants