-
Notifications
You must be signed in to change notification settings - Fork 69
Application Overview
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:
The Happstack web service is responsible for four main tasks:
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:
Some routes (e.g. "/"
, aka. nullDir
) are redirected to other routes, via a 303 redirect.
Most routes (e.g. "/graph"
, "/grid"
) respond with an HTML document generated by blaze-html. See GridResponse.hs
for an example.
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
.
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.
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.
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.
The JavaScript browser frontend is responsible for: