Home - mkiyer/mitranscriptome GitHub Wiki

Overview of Code

Code Files

Server

  • wsgi.py - used by HTTP server (Apache, mod_wsgi) at server start up. No need to change.
  • dbapi.py - rudimentary "database" interface to load transcript metadata during server initialization and access individual transcripts. Will be eventually replaced a formal database (e.g. Mongo).
  • app.py - main Flask module with server code, including AJAX requests for transcript tables.

Client

  • static/scripts/app.js - Main module for client site
  • static/scripts/main.js - performs initialization of javascript libraries. No need to change.
  • static/scripts/custom.js - ignore, will be removed in future version
  • static/scripts/models - subdirectory containing BackboneJS Models
  • static/scripts/collections - subdirectory containing Backbone JS Collections
  • static/scripts/views - subdirectory containing Backbone JS Views

The client code follows the BackboneJS software paradigm. In Backbone we define 1) Models, 2) Collections, and 3) Views.

  • A Model is an object with attributes. For example, the Transcript model (static/models/transcript.js) contains the metadata fields for a single transcript.
  • A Collection is simply an ordered list of Models. For example, the TranscriptCollection collection (static/collections/transcripts.js) stores a list of Transcript models. The collection also has code to request and populate a list of transcript models via AJAX requests to the server.
  • A View renders models and/or collections to HTML for the user. For example, the TranscriptTableView (static/views/transcript_table.js) renders a TranscriptCollection to HTML.