Program flow

When you first load, an html file is loaded that fetches all the javascript and then tells the server what interface to use and asks for the first page or a login page if the user isn't logged in yet. This html file will stay in memory and only the parts that changes will be fetched from the server and inserted.