Skip to content

Web Technology Reference

Doug Salvati edited this page Jul 26, 2017 · 5 revisions

Back-End

First and foremost, our backend is Ruby on Rails. You probably don't need to take a lesson on Ruby, but Rails for Zombies is a recommended tutorial as it will get you accustomed to the various folders in the rSENSE directory.

Front-End

The web page HTML go in the views folder. These are all .html.erb files. They are basically HTML files, but ERB means EmBedded Ruby and allows us to do some cool stuff in that isn't possible with plain HTML. For instance, hide some controls if the right conditions aren't met:

<% if @presentation || !controls %> style="display:none" <% end %>>]

These are "compiled" into regular HTML, however.

Handlebars (.hbs) files are HTML files which take arguments. They are used to create dynamic HTML content like controls for vises which aren't known ahead of time, such as a list of the groups.

The styles are stored in assets/stylesheets and are .css.scss or SASS style sheets. Essentially we treat it as regular CSS but it lets us define global variables if we want, among other features.

Scripts

The app/assets/javascripts contains most of the core code. Each Vis is stored in the visualizations/highvis directory and they all are classes deriving from baseVis. There are other scripts as well. They are written using CoffeeScript which is a simplified Javascript "compiled" into regular JS. It is worth checking out the documentation on their homepage, as it is pretty good.

The visualizations make use of a library called Highcharts. Get yourself familiar with it, but you can usually look up info in the documentation as it comes up in your work.

Tests

The tests/unit contains unit tests, these are done for all the rails models. Sometimes we test Javascript with integration tests. Those go in tests/integration, but with HighCharts it is limited what we can do programatically. For visualizations, manual testing is crucial and what we rely on. That is just the nature of the application.