The Thunder client is a single page application written entirely in javascript. The source files are located in the /client
folder of the repository.
The application is packaged with Browserify using gulp. In order to make changes to the client, gulp needs to be running. Gulp will automatically re-bundle the application when changes are made.
from the root directory to install necessary dependencies, and then
will keep gulp running and watching the files for changes.
The entry point of the application is /client/js/index.js
. It creates and appends Main
Bit of a mess. Main is in charge of:
A much bigger mess. Router is a singleton who's main function .route()
receives a string and passes a card to Main for display.
/client/js/cards
edit user zeus
passes "zeus"
to the editUser.js
cardAlmost all functionality in thunder is presented to the user in a card.
Unfortunately there is a lot of boilerplate for cards. An example card looks like this:
.div
is set, otherwise nothing will be added to the screenRemote
is used to communicate with the APIViewHelper.help
will automatically add functionality to the X close buttonViewHelper.style
gives everything the default style, and exposes values in the s
style variableNotification
is a singleton for showing notifications at the top of the screenDiver
is for DOM expression.Any js file in the /client/js/cards
folder will be automatically included in the application bundle and can be accessed by require('cards/cardName')
. It's important that a card is named in camelCase so that the in-application router registers it correctly. newCard.js
will be available at the new card
address when using the ~
console.
Forms exist as json objects served by the backend. They can be accessed and displayed with:
/forms
/forms/forms.json
A simple form might look like this:
Forms get complicated when they become nested (a form can exist as a component of another form).