Skip to content

Application Overview

Spencer Elliott edited this page May 1, 2015 · 4 revisions

Courseography is comprised of a web service (Happstack) and web browser frontend (work-in-progress on the react-graph branch: React & Flux), whose responsibilities are outlined below:

Happstack web service

The Happstack web service is responsible for four main tasks:

Serving HTTP requests

An incoming HTTP request (usually from a web browser) is routed according to the routes specified in server.hs, and one of the following types of responses is returned:

Redirect

Some routes (e.g. "/", aka. nullDir) are redirected to other routes, via a 303 redirect.

HTML

Most routes (e.g. "/graph", "/grid") respond with an HTML document generated by blaze-html. See GridResponse.hs for an example.

Static files

Requests for "/static/*" are routed to the corresponding file in /public/*. e.g. a request for "/static/res/ico/about.png" will respond with the file /public/res/ico/about.png.

Generating CSS

Upon launching the server, CSS files are generated for each stylesheet in styleFiles in CssGen.hs and written to /public/style/. The server must be restarted for new CSS to be generated.

Parsing & storing U of T course data

Running runhaskell Database/database.hs will create a SQLite database Database/database2015.sqlite3, fetch and parse U of T course data (from http://www.artsandscience.utoronto.ca/ofr/calendar/), and store it in the database.

Generating graph SVGs from the U of T course data

Running runhaskell SvgParsing/parser.hs will parse the manually-created (Inkscape) SVGs csc2015.svg and sta2015.svg and store SVG paths, shapes, and text in the database.

Browser frontend

The JavaScript browser frontend is responsible for:

Fetching & rendering graph SVGs to the DOM

Fetching & storing course data from the web service

Handling user interactions

Clone this wiki locally