Reputation: 36940
This is a question for those who are very familiar with Meteor's architecture.
I am trying to design a smart package that can transparently run several "copies" of a Meteor app. That is, given an existing Meteor app, and several predefined groups of users, the package can semi-automagically "segregate" the app - run it in a way that for each group of users, it appears that only those users are using the app.
I understand that this functionality could be custom designed for any application. However, I'm looking for the most straightforward way for a smart package to provide this functionality on top of any existing app, taking into account the use of Meteor's Collection
s and all. Hence, it should more or less satisfy the following:
Here are some approaches and corresponding drawbacks I've thought about for this problem:
Meteor.Collection
(or implement an identical interface) in a way that makes it aware of these different groups, and from the client perspective it behaves as if the current user's group is the entire app.I'm looking for good ideas here from someone who really knows Meteor's system. How can I design this functionality in a way that the vast majority of Meteor apps can be easily converted to work with it (i.e. avoid crazy hacks that are very brittle) yet is straightforward and efficient to implement on top of Meteor?
(If you are a Meteor guru in the NYC area, I would be happy to take you out to dinner to discuss this!)
Upvotes: 6
Views: 783
Reputation: 36940
I've taken my work on this problem and pulled it out into a Meteor smart package. It satisfies all the requirements I noted in my question. For more details, see the documentation and instructions.
Because I've been using this in practice already, the code is pretty stable and has a good set of tests. Comments and contributions are welcome.
An example of a package that uses this is the following:
Upvotes: 6