SubReview

SubReview is Web 2.0 site and used some leading edge technology at the time such as Ruby on Rails v2, Adobe Flex and OpenID. Currently needs an overhaul to remove Adobe Flex and YUI dependencies.

The site runs on a virtual Linux server (Slicehost) and uses Subversion/Capistrano to store and deploy the site.

The site is built using REST principles. The interface between the flex applications and rails using the REST approach is XML.

A few different caching schemes have been used to speed up the site. If the site needs to scale up then memcached would be looked in to.

The site layout and controls are done using Yahoo's YUI library.

Model View Controller

Using REST principles the site has a number of resources: users, assets (films), ratings, reviews etc. Below is some of the code for reviews. Note that the resource can be rendered in HTML,XML and RSS.

XML view of an asset resource

Below is a screen shot of an Asset resource being rendered as XML. The controller knows to render xml instead of html due to the .xml extension.

Flex action script 3 applications

This is a flex application for creating/editing assets on the site. All the data transfer is done in XML.

This time in Admin View

This is the control panel for creating reviews, comments, and looking at all the reviews of a particular film (or from a particular user) without having to reload the page. Once again the data transfer take places using XML. The rating control, is a custom Flex control so that it can be re-used in other places.

Rich text is allowed for the review.

Custom Adobe Flex component (6-axis rating control)

The custom component displays a 6-axis graph and has the ability to get and put a rating value. The code below shows how easy it is to get Flex to update/create a new rating for an asset(film) on the server using XML. You can see why Adobe describes the combination of Flex + Rails + Ruby as Rich Internet Application Nirvana.

SubReview User Model

The user model stores encrypted passwords and supports OpenID (via the OpenIdAuthentication gem).