Skip to content
Espen H edited this page Jan 26, 2016 · 6 revisions

How the app works

The layout of the app

This is the app. Don't freak out quite yet, it's really quite easy.

The entire app is an angular.js webapp in a privileged context (this means we can get around Same Origin policy and the likes). All the code is in the data folder, and from now on, I will refer everything relative from that folder.

It is bootstrapped from a <script> tag in rested.html called js/app.js. After this, it cascades down the scopes, beginning with js/controllers/root.js. After this, we are in angular territory.

RootCtl is the master of a view called views/main.html. In this view you can see the logic forks in three, and these three are:

This is the basic structure of the app. See, pretty basic!

There are also some other things in there like services and filters, which you should know pretty well if you know angular. If not, there is plenty of guides online with how to use filters and services.

Database

The collections, options and url parameters are stored in IndexedDB, and thus persisted to the browser's storage. I've tried to make it a bit simpler than the raw IndexedDB API, look at js/services/db.js. It has three collections, collections, variables and options, and they all have get, add, set and delete.

For an example of IndexedDB, see js/services/collection.js.

Clone this wiki locally