##Savant
Savant aka HipHopSavant is a text annotation platform, inspired by the awesome Genius aka RapGenius. It allows users to upload the texts of songs, articles, poems, instruction manuals, or any other kind of textual material and collaboratively annotate them. When you view a text, all you have to do to create a new annotation (presuming you're signed in) is highlight a piece of the text with your mouse, and the new annotation form will pop up. The live site can be viewed here: http://www.hiphopsavant.com.
Savant is a single-page app built on a Ruby on Rails backend and a frontend structured with Backbone.js. It also leverages the following gems, libraries and APIs for particular functionalities:
- arunagw's omniauth-twitter gem for one-click signup/signin through Twitter's Oauth Api
- Thoughtbot's paperclip gem for user uploaded images and aws-sdk to store those images in an Amazon S3 container
- Twitter's Typeahead.js library for dynamic typeahead, autocomplete and match highlighting in some search fields
- Casecommons' PgSearch gem for efficient database level multi-table/multi-field full text searches
- halostatue's diff-lcs gem for diffing changes to lyrics across edit's, allowing annotations to be correctly re-positioned or deleted
- The JavaScript Web API, particularly window.getSelection() and document.createTextNode(), to correctly parse and manipulate the heterogenous mix of plain text and anchor tags (for preexisting annotations) when creating a new annotation
Some interesting code to check out can be found in the following locations: