-
Notifications
You must be signed in to change notification settings - Fork 67
Application Overview
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.
The Happstack web service is responsible for four main tasks:
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.
Some routes are redirected to other routes, hence the name redirect. This is done via a 303 redirect.
E.g. "/"
or nullDir
.
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: