Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
I together with other four friends just launched our new site: smuvi.com (more info in the comments)
15 points by antirez on May 31, 2008 | hide | past | favorite | 5 comments
Hello, http://smuvi.com is the result of 3/4 weeks of work five people did in order to create a movies-based community here in Italy. We never worked together in the past but we are friends since we were childs. The average age is 30.6 (max age: 33, min age:26)

The site is written in Ruby using mod_ruby. We used our own framework. We tried at our best to make the site scalable from the start, the home page is generated (without caching) in 40 ms, the film detail with 50 comments in 50ms.

One of the most interesting things in the site is in our opinion the recommendation engine: you get user-tuned suggestions after you rate a few films. Another interesting thing is that if you search in smuvi you get results from film transcripts too.

I'm not sure if I can get feedbacks for a site in a language different than English but... I'm trying.

Thanks in advance for any kind of hint.



The site seems pretty cool to me, it looks like an anoobi for movies. Why did you do it in italian only? I would have tried to launch it in english also. It seems fast to me, but probably there is too little traffic right now to be able to judge its performances. Anyway, very slick execution. Congratulations.


Thanks ctbk, the idea to do it italian only for now is because we know very well the italian market so we can actually think to bring interested people, friends and other communities in smuvi. It will be very hard to do the same with an english site, especially if you consider that few italian people are comfortable using a site written in english so we somewhat will lost the users that are more available to us.


I dont't understand italian, but the site has a simple design, no more, no less, I like it.


So far so good. Can you provide more info in what you built in terms of framework and tech? Thanks.


Thanks, sure I'll try to provide more information.

wc -l tells me that the whole framework is 1095 lines of code. It is composed of this different modules:

the main module handles the page generation in a functional way, I pass a method implementing a given page of the site and this method will get a parameter that is an object that holds the whole state of the page, so I've methods like isloggedin?, username, isadmin? and so on.

The same module will handle HTML generation. We rewrote it from scratch using method_missing so there are no preset tags. We write things like

  H.div('id'=>'foobar') { ... content ... }
And there are virtual tags we can define that are tags with specific pre-set properties. Also there are DSL-ish ways to write SELECTs, HTML lists, and other elements that written as H.tag(..) { } are not very easy to write/read.

Then there is the DB module that is somewhat similar but much more light than Active State, but the idea is to encapsulate a query and the single rows in objects with methods like .each, .save, .delete and so on. Example:

    users = fetchall("SELECT * FROM user")
    users.each{|user|
        user['username'] += "x"
        user.save
    }
Will append 'x' to every username in the DB. We restricted all the functionalities in order to don't have any kind of "rebuild" stage, just the information passed in every query from the DB are enough. There is not one class per table and so on it is pretty basic.

Another module is KFS: this is a class that will create a database in the filesystem in a very simple to manage way. Every time we have data we don't want to store in the DB we store it in KFS: the KFS root is inside the webroot so for example storing an image there will have the effect to be directly accessible by the web server. KFS is designed to don't have race conditions and is atomic. So it acts as a base for a caching system.

Other things implemented in this 1095 line so fo code is a DSL able to generate forms for us with the ability to automatically check for missed fields, to auto-fill parts of the form with defaults coming from a DB query or from a Ruby hash object and so on.

The framework is also able to do automatic pagination of everything we like to paginate just passing an anonymous function for data access and a block for item->html rendering. Send emails, generate Google Charts with little code, and... that's it.

Our configuration is Apache + mod_ruby + ruby 1.8 + MySQL

All the code was written in less than 30 days including 50% of the framework (the other 50% was already written by me in a week of the last summer).

Thanks for your comment.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: