Packages/strategies for building a basic friends system


#1

I am building out a very basic friends system for an app that I am working on with just features like add/remove/request/cancel. Are there any existing packages that would make this a bit easier? I found the socialize:friendships package, but haven’t seen it in action. Does anyone have any experience with it or have some general suggestions on building the system?

Thanks


#2

Hi Rubenpa, I am also interested in this topic and would like to know if you have tried the socialize packages or built something yourself. Can you share your findings?


#3

I ended up building it myself. I just made three array fields in mongo for sent, friends, received and removed/added ids from the arrays. I didn’t need anything complicated so it worked just fine.


#4

Hey guys, I’m the author of the packages in the socialize namespace so if you have any questions feel free to ask.


#5

Hi Copleykj, thanks for getting in touch! When I was checking your packages I was looking for a demo app that demonstrates all packages combined, a very light social network as an orientation. Does it exist? If not I’d recommend it. People (certainly I) would better understand how your packages work and how to implement them in their own projects. Anyway I will have a look again and appreciate you offering your help!


#6

@m165437 The only demo that currently exists is the messaging demo which can be found at https://github.com/copleykj/socialize-messaging-demo

Unfortunately it was a quick and dirty throw together and my intent is to expand on it as soon as I can get a couple other packages put together to complete the set.


#7

Hi Kelly, Thanks for the wonderful work that you are doing.
I am trying to use socialize-message-demo. When I create user account, I land up on a blank screen. This is because, there are no conversations in the database yet. I tried creating a function to pre-populate the db with some values but there is no API for creating conversations. Could you please add a function which pre-populates with few users, conversations and message or tell me how to do that? Other problem is that as I don’t get any text area (blank page) I don’t have any way to start a conversation. Am I missing something here?


#8

@maitray I’m very sorry about the short comings of the demo. As I stated above it was a quick and dirty throw together that really needs a lot of work… The main purpose at the time was to diagnose an issue another dev was having with rendering. My intent is to combine packages from the socialize namespace into to a function social networking type application as a demo. I don’t know if there is anyone out there that wants to help with this, but if so I’d be more than happy to move forward. My biggest need would be a designer as I’m slightly aesthetically challenged.

In the meantime I’ll see about putting a bit more into the messaging demo so that it’s a bit more functional.


#9

Hi Kelly, I am aesthetically challenged as well :smile: . And, I am trying to do the same - add social networking functionality to site I am working on. You, by developing these modules, have made it very simple. When I see your code, it looks very elegant.
As I am new to meteor in general and schema2 in particular, it becomes difficult to figure-out how different pieces will fit, especially with the UI (which I am also using autoform).
For example, I think, to add functionality of “like” to a content, I need to extend likableModel and add my own schema for the content to it. Similarly for commentable content. But, if I want to make an entity both likeable and commentable, how do I go about it?


#10

@copleykj Nice work, I would add just 1 thing - let us specify what is published, cause I am not sure if username is the right choice :smiley:
Now just add socialize-webrtc :smiley:


#11

Currently I am thinking of moving the publications into their own packages. That way they are available if needed but if not they will not add unnecessary code to an application.


#12

As for webrtc, I’ve not worked with it much but it would be a nice addition to the package set.


#13

well, 2nd thought, if you have friends working already, it would be just UI with some call to other webrtc package, as seems there are already few.
but some UI for all these socialize parts would be nice.
I am in the “aesthetically challenged” group too :smiley:


#14

Yes… I think webrtc might go nicely with messaging… I’d have to think on it a bit.

As far as aesthetically challenged goes… I’m all about the markup and styling but my design sense is that of a 5 year old. @nikhildaga has kindly volunteered some of his design sense and we’ve started work on a project that will illustrate usage of the socialize packages.

If anyone else wants to jump in and help out the repository is at https://github.com/SpaceColony/SpaceColony

If there’s interest maybe we can continue on a different thread.


#15

For creating a model that is both likeable and commentable you would end up having to use the extend() or extendAndSetupCollection() method for one (either likeable or commentable) and then extend the prototype of the model with the prototype of the other.

Example

var Post = LikeableModel.extendAndSetupCollection("posts");
    
_.extend(Post.prototype, CommentableModel.prototype);

Then you can use them like so

{{#each posts}}
    {{>post}}
{{/each}}
Template.post.events({
    'click .like': function() {
        this.like()
    },
    'submit .commentForm': function(event, template) {
        event.preventDefault();
    
        var commentbody = template.$("textarea").val();
        this.addComment(commentBody);
    }
});

#16


#17

@copleykj, great idea. I’m open to help out. What do you plan to include? Let’s start a new thread. Makes sense.


#18

Would love to help aswell :wink:


#19

I’d suggest not putting together a huge application but something as light as possible that still has all the basic functionality. What do you think? @copleykj, it’s on you to start a new thread … :sunglasses:


#20

couldn’t find it… SpaceColony, has it moved somewhere else under some other name ?