The backend application is written in Perl, object-oriented where possible. It consists of three major sections: a collection of libraries to access the database, cgi scripts to query data and render it for the website, and some command-line utilities to do maintanence and load new calendars. For each of the major data types, manuscript, calendar, calendar entry, and saint there is both a single class, e.g. Saint, and a class to handle mutiples, e.g. Saints. These are nested, so a Manuscript contains a Calendar, and a Calendar contains Calendar Entries.
Perl Modules
- Database Connection
- DBI
- DBD::mysql
- DBIx::Connector
- Text::Markdown
- Template::Toolkit
- Switch
- JSON
- CGI
- URI::Escape
- Moose
- Text::CSV
The entire database is handled in MySQL. The data is roughly organized in parallel with the main application classes: Manuscript/Calendar metadata, Calendar Entries, and Saints. Each of these tables is normalized, for example elements like color and rank are external to the calendar_entries table with a linking table calendar_color_entries. Several tables hold shared normalized data, for example location is shared by 3 columns from manuscript and one from calendar.
Key: Red is Manuscript/Calendar metadata, Blue is saints and Green is calendar entries.
From these tables are several complex views which are the usual way of accessing data. The views partially denormalize the tables into something more closely matching the classes of the app. Of the various views the most useful are calendar_manuscript and calendar_color_entries, which itself is built from the calendar_colors_extended. The calendar_manuscript table combines the relevant metadata from both the manuscript and calendar tables and de-normalizes the various geographic location fields (manuscript.use, calendar.use, manuscript.source, and manuscript.location) and the url.
The cgi scipts use Template::Toolkit as a basis for rendering data into HTML for the website. Each page has a unique master template, and calls out to some of shared templates, including one which creates the top menubar and footer text.
The pages use Zurb's Foundation, currently v5.x, to handle master layout. It also provides organizational UI functions, including the tabs and accordions, such as seen on this page, and the modal dialog for Saint information. Complex tables, principally the main manuscript list, are handed off to the DataTables plugin. At the lowest level, jQuery is used to handle loading remote data and basic manipulations, including the actual instantiation of Foundation. We use the jQuery LoadingOverlay plugin to handle the "loading" screens.
Google projects provide some of the aesthetic elements. The fonts used are all provided by Google's Font API; the charts, such as on the stats page, come from Google Charts. Finally Google Analytics is used to track user behavior.
For the manual entry of Calendar Entries, the current system is to enter them in an Excel spreadsheet, based on a custom template, and then use the loader.pl script to insert them into the table. When data needs to be manually edited, Sequel Pro is the GUI of choice.