K-12 Teaching and Learning From the UNC School of Education

LEARN NC was a program of the University of North Carolina at Chapel Hill School of Education from 1997 – 2013. It provided lesson plans, professional development, and innovative web resources to support teachers, build community, and improve K-12 education in North Carolina. Learn NC is no longer supported by the School of Education – this is a historical archive of their website.

This is an overview of the web application framework, called "Lighthouse", that was developed by LEARN as part of our website refresh initiative.

Getting Around

A good starting point is to think about Lighthouse as a video game console, and individual "apps" as games. Lighthouse allows apps to be played, one at a time, inside a common HTML frame. This is how you ask Lighthouse to play an app:

www.example.com/?app [try example]

When an app is requested as above, without any other qualification, it will appear in an initial mode called the default "state". A state is simply an application mode that the developer chooses to make accessible via URL. You can request a particular state as follows:

www.example.com/?app=state [try example]

Apps musth be capable of reporting defined states to the framework, allowing Lighthouse to create a sitemap file containing all possible URLs in a given installation:

www.example.com/?sitemap [try example] requires password - ask John

Request Lifecycle

To get an idea how this all works, suppose a user makes a typical request:

www.example.com/?app=state

First the app will create a simple view of the requested content, called a "snapshot". This snapshot is embedded in a HTML frame which is shared across all Lighthouse apps.

Now the server returns the framed snapshot to the client, which could be any flavor of browser or search engine bot. What happens next depends on what capabilities the client has or wants to employ. Lighthouse presents the client with two options: take the snapshot as it is, or execute javascript to enhance the view.

If the latter option is chosen, Lighthouse flushes the content and replaces it with the enhanced version. Furthermore, assuming the client supports HTML5 pushState, the Lighthouse lifecycle moves to be client-centric rather than server-centric for the remainder of the session. This means that when the user navigates to a new URL within the same Lighthouse instance, rather than being sent to the server, the request is intercepted by the client which performs its own update by loading javascript resources as they become needed.

Lighthouse Request Lifecycle
Test