Meteor chat app
github.com
github.com
Sample, in your console type:
Messages.remove({})
or
Users.remove({})
for(var i=0;i<20;i++) {Messages.insert({user: "testuser", text: "yo!", date: new Date()})};
Security stability and scalability are the hard parts.
Meteor.setInterval(function () { Users.remove({}); Messages.remove({}); }, 500);
Being able to send messages asynchronously has been a solved problem for a long while now.
However, judging from the ridiculous amount of xhr messages flying back and forth, perhaps even that isn't done very well yet.
See http://nowjs.com for another implementation of the idea.
If you have to implement a separate, server-side CRUD security check by hand, then I don't see why I would choose Meteor over say Rails or Express plus Backbone.
One of the unfortunate things about Meteor at the moment is there aren't many open projects to learn from. For others trying to gain insights to best practices through this projects, here are some suggestions I may offer:
Users.find({last_seen: {$lt: (now - 60 * 1000)}}).forEach(function (user) { Users.remove(user._id); });
-> Users.remove({ last_seen: { $lt: (now - 60 * 1000) } });
and
Messages.find({date: {$gt: new Date()}}).forEach(function (message) { Messages.update(message._id, {$set: {date: new Date()}}); });
-> Messages.update({date: {$gt: new Date()}}, { $set: {+new Date() }})
Excellent work otherwise though. I'd love to see more open source projects released with Meteor if anything for others to learn from!
source: https://github.com/spicytuna/InstaChat
you can create rooms like this: http://instachat.meteor.com/room/HackerNews
This is like back when Rails was new and everybody was showing off their poorly made CMS that had security issues baked in from the start.