Skip to content

Architecture

jacquesd edited this page Dec 11, 2012 · 18 revisions

Architecture of the ASQ app

The ASQ app utilizes websockets to transfer events between connected clients and the server. The basic entitities of the app are:

In the following sections we present the architecture of the basic entities of ASQ

Database Schema

Entities

User

Slideshow

Question

Session

Stats

Implementation Details

WebSockets

Websockets connect immediately once the page is loaded. Admin sockets should be authenticated.

Events

  • viewer : Emitted by a viewer when he first joins the folo namespace.
  • admin : Emitted by an admin when he first joins the ctrl namespace.
  • impress:start : Emitted by an admin when he hides the welcome popup and starts the presentation. Sent to all namespaces.
  • goto : Emitted by an admin when he moves to a slide. Re-transmitted to all namespaces.
    If there is a question, a question event is transmitted instead.
  • question : Emitted from the ctrl namespace when a question needs to be displayed.
  • show:answer Emitted to ctrl namespace when then answer needs to be displayed.
    If a answer can be displayed, a answer event is transmitted to all namespaces.
  • answer Emited from ctrl to all namespaces. Indicates a popup answer must be displayed.

Routes

  • /live/:user : Verb: GET Follow a live presentation from user :user.
  • /admin : Verb: GET Control your live presentation.
  • /upload : Verb: POST Upload a presentation archive. (The archive must be located at req.files.upload)

Use absolute path to serve files from the public folder. For example to serve the file style.css in the css folder in public,
the path should be /css/style.css and not css/style.css.

Reserved internal routes

The following routes are reserved and used for the websocket traffic.

  • /ctrl : Used to control the presentation, (ie. To emit goto events and such.) require authentification
  • /folo : Used to follow a presentation, receive goto events and submit answers to questions and such.
Clone this wiki locally