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
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!
The text was updated successfully, but these errors were encountered:
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!
app/messages
messages
table).The text was updated successfully, but these errors were encountered: