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

Persist chat messages for 24 hours via mongodb #1553

Open
7 tasks
evanugarte opened this issue Jan 12, 2025 · 0 comments
Open
7 tasks

Persist chat messages for 24 hours via mongodb #1553

evanugarte opened this issue Jan 12, 2025 · 0 comments
Assignees

Comments

@evanugarte
Copy link
Collaborator

game plan

  • follow dessert tutorial
  • Create a new model called ChatMessage in api/main_endpoints/models, the model should have 5 fields, createdAt, expiresAt, chatroomId, userId and text
  • have the model create an index on the createdAtField and chatroomId fields
  • adjust /send to include writing to mongodb with your new collection, specifically the writeMessage function
    router.post('/send', async (req, res) => {
  • change /getLatestMessage to return the messages from mongodb on a specific room id, test if this works with postman
    • you can comment out the token verification code to test without authentication
  • once the above works, open a pr for just the backend changes
  • once the pr is merged, lets move onto calling /getLatestMessage once the user joins a chatroom, so they can load the ongoing messages from users.
@ngtri1809 ngtri1809 self-assigned this Jan 18, 2025
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

No branches or pull requests

2 participants