Skip to content

Directory structure

Mark Overmeer edited this page Feb 13, 2019 · 2 revisions

Contents

Taranis uses the following technologies:

  • Perl (5) for the server core, using mod_perl
  • Javascript in the browser, with jQuery
  • CSS3 in the browser (very little)
  • (Perl's) Template Toolkit to template web pages
  • PostgreSQL database
  • Ajax JSON, browser uses Javascript, server in Perl
  • Maintenance script 'taranis'

Perl as the core

The core is written in Perl, using mod_perl inside Apache2. At the moment, that's not the preferred choice: it's much easier and faster to implement a website in Perl using an fcgi interface to a separate daemon. For instance, Mojolicious or Dancer behave better.

The server implementation can be found in "pm/" (should have been "lib/"). Modules in "pm/Taranis/Command*" implement the 'taranis' maintenance script. Modules in "pm/Taranis/Install/" support the installation process.

Javascript

Templates and responses to Ajax calls may order the browser to load Javascript modules, which can be found in "webinterface/include/js/".

It's a shame that this directory mixes external javascript components with Taranis specific components. Also, at least 90% of all Javascript code is used for Ajax calls to fetch page fragments. There is too little abstraction, so far too much code to maintain.

Ajax

The process looks like this:

  • Some browser event gets triggered, for instance a click on a button which should open a popup.
  • The browser creates a popup to later display the information in
  • Javascript creates an Ajax call for "/load/analyze/assess2analyze/displayAssessAnalysis"
    • server-side "scripts/index.pl" detects this is an Ajax call ("/load") and compiles on demand the file "mod_analyze/assess2analyze.pl"
    • then it calls function "displayAssessAnalysis()" in that script file.
    • the function returns html fragments, values, and a list of javascript libs which support the created html
  • The browser's javascript loads the javascript libs and
  • Then it connects the HTML fragments to the dom
  • Finally, it connects some events to the loaded html

Clone this wiki locally