Open ChristBKK opened 8 years ago
Question: do we want to abandon slack and implement chatrooms (group/individual) on the app itself?
I just want to build a Chat :+1: with Meteor if we then use it as our own chat (when I understand that right?) is fine for me :)
Ok, since this github repository is all about the app we're building together and these issues are feature suggestions, let's treat chat as a part of the app.
Since we will have rooms of 5-7 people, we can actually start with using the collection api (mongodb) for delivering messages. But we can implement "streams" as an exercise for the "general" chatroom where the number of chat participants are likely to grow.
Also, capped collections have a downside, you cannot remove indivdual documents from them. So a user cannot delete their own message!
I have implemented the chat functionality with socialize:messages
package in one of my mvp which uses mongo to store and show messages. I even made a demo to help out others as the creator of those packages was super busy (he was super helpful !!). Here is the demo link https://github.com/kaiyes/chatDemo
http://chatdemo-social.meteor.com/
Also I tried vanilla meteor for chat which works just as fine for normal chat (including one to one chat).
But I would love to see the streams
method because I want to learn how it works. I think In big apps, storing in mongo db can quickly become expensive, so streams
sounds better.
I have a question to @serkandurusoy . Will we able to show a chat history if we use streams ? Or is it something like session so it doesn't store value in db, just streams for that session & values are lost as soon as window is closed.
you can use streams to bypass mongodb so that's the idea. But, you can also take a tiered approach where messages get delivered using streams, but the server saves a copy, where the chatroom can load "earlier" messages on demand, through a meteor method
cool, exactly what I wanted to know. thanks
or we could skip the server roundtrip alltogether, and implement some webrtc functionality for the chats. That would lay the foundation for video/audio interaction aswell
Specifications:
1) 1:1 real-time Chat , 1 User to another User 2) Chats saved to MongoDB for 14 Days 3) Button that can add photos, videos or smiley to a chat
Ideas:
1) Check what Rocket Chat uses
2) look up mongodb documentation for capped collections for "xy days". alternatively, you can use a background task (percolate studio has a package called synced-cron) to delete old messages.
3) Check what Rocket Chat uses and how to integrate this multimedia feature