Skip to content

Application Overview

Fullchee Zhang edited this page Dec 27, 2018 · 4 revisions

Courseography is comprised of a web service, we use Happstack, and a web browser frontend, for which we use React & Flux. The responsibilities of both Happstack and Flux can be found below.

Happstack web service

The Happstack web service is responsible for four main tasks:

Serving HTTP Requests

Serving an HTTP request is done via routing HTTP requests, which are routed according to routes specified in routes.hs. This can result in one of the following types of responses: a redirect, HTML document, static file, or CSS file.

Redirect

Some routes are redirected to other routes, hence the name redirect. This is done via a 303 redirect.

E.g. "/" or nullDir.

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