Building a social network on Rails 7

Posted by Augusto Guido on February 09, 2009

Tog logo So you want to build your own social network site on rails? As you probably know, there are many plugins around to add social functionality to your site, and there are also some open source platforms that provide you with complete social network functionality. Some of them are Lovd by Less, comunity engine, tog, etc. These platforms, as rails premises, are based in the idea of not reinventing the wheel. In this post we’ll be referring about tog our experience installing it and trying it out.

Why are we using tog? Actually we are not using it, we are just doing a proof of concept trying out the different platforms and getting to know each of them. The idea behind this is to have enough knowledge to, according to our clients requirements, select the best solution for them and for us in order to save our clients some money by reducing our development time.

What is tog? Tog is a non-intrusive, extensible open source platform that helps you to add social network features to your Ruby on Rails apps. We aim to convert the tedious and long process of creating a community site on a straightforward process that will give your site social capabilities in minutes. (from www.toghq.com/)

Installing tog may not be a simple procedure for a Rails beginner, but the install process is very well explained in their wiki. After following the procedure you will have installed a very complete and expandable social network. It is composed by many plugins developed by tog and some by 3rd parties. After installing the basic plugins you can install more plugins that will easily adapt to the default site.

Tog is today in version 0.4, which means you will probably find some bugs and things to fix. Here are some we ran into:

  1. After running the togify command the following error may appear: “error  There has been a problem trying to unpack the tog_core tarball downloaded from github. Remove the changes made on your app by togify and try again. Sorry for the inconveniences. We found the solution in the project assembla here
  2. In the migration create_posts from plugin tog_conversation the line t.datetime :published_at is missing

Another thing you shouldn’t forget is to set up your email conf, since some plugins may depend on the user activation like the message ones (I tried to manually activate some users, and then had to manually fix some things than an observer was supposed to do after activation)

The greatest thing about tog is the ease of extending it. You can read about it here. Basically you can override any behavior you want just by creating models, controllers or views like you would normally do in your apps. On the cons side, it may be a bit complex finding out what functionality is where, to override with your own. The idea is to not touch the plugins and use new controllers, models, etc to extend. This will allow plugins to be updated when they need to, without affecting your site’s working functionality.

In conclusion, I think tog is a very promising platform that may be a great solution for building social networks on the go, allowing us to extend them to meet our needs. This may be a good solution for a user who just wants his site running. If you want to customize too much about it, you should consider other platform or starting from scratch.

We are right now working on adding Facebook Connect to a demo site we are building with tog, please come back to know how that went ;)

Trackbacks

Use this link to trackback from your own site.

  • http://www.moove-it.com Ariel Ludueña

    good post! … but, do you think that this plugins are flexible enought? ;)
    you know what I mean

  • Augusto

    Yeah, I know what you mean :) . Plugins are flexible, in fact using desert you can do whatever you want to them. Thing is that they are strongly attached between them, that’s why I recommend using tog if you just want a site running and modify little things.

  • http://www.linkingpaths.com Aitor García Rey

    Thanks for using tog Augusto. Really … thanks.

    As commented here, there is a balance to maintain between modularity and the “work-out-box” experience and this can do sometimes the dependencies between plugins stronger o weaker.

    We’ve try as much as possible to put this balance in the developers shoulders, allowing them to modify the behavior in the fashion they prefers…

    Taking this in to account, and even if I accept that could still be some weird dependencies in tog, I think it’s still easier to install/remove/overwrite small pieces of code like plugins (or even develop the one you need) that take the “everything-inc.” approach other platform take and get the useless parts out.

    This is shaped by our vision of the social networks as different communities with different needs and the lack of a magic potion with “all the features ever needed by a social network”.

  • http://rituonrails.wordpress.com Ritu

    So how was your experience with Tog? Which Social Networking Framework/plugin you have decided to use finally? I am looking for the same answers.

  • Augusto Guido

    Thanks for commenting, I get what you mean.

    From my point of view I think an average advanced developer will prefer to develop the site himself installing the plugins he wants, using the authentification he wants, and so on.

    For a begginer develper it may be kind of hard to modify plugins that are dependant whithin each other. What I’m trying to say is that I think tog should be oriented to begginer developers developing a social network.

    Anyway, I think it’s a really awesome project

  • Augusto Guido

    Hi Ritu, thanks for commenting.

    After doing the research with finally decided to use facebook connect in the specific project we were doing the research for. You can read my other posts about it.

    Each project is independant and has it’s own particular solution I think. Using facebook connect has been really great so far, and a very important thing is that normal users are begging to use it. For implementing a complete social network so far we never used a complete framework, we just install the plugins we need and develop (or reuse code we already have) what’s needed.

  • http://blog.timothyfisher.com Timothy Fisher

    Readers who are interested in building a social networking site in Rails may also be interested in the recently released EngineY framework. EngineY is a framework that makes it easy to build and deploy a social networking site. EngineY is an open source project implemented in Ruby/Rails. You can read more about it and download it at:
    http://www.enginey.com

    You can find a live instance of the framework running on the Michigan Ruby Community site at:
    http://www.rubymi.org