The Node App

dennis-learningpool edited this page Sep 17, 2014 · 4 revisions
Clone this wiki locally

How we built the backend

The server side part of the tool is a NodeJS based application that uses the express web framework. The main entry point for the application is in server.js which loads and runs the application defined in lib/application.js.

Directory structure and code layout


The main entry point for the app. When you run node server, this is the file that is invoked. In fact, the entire file is just three lines:

var builder = require('./lib/application');
var app = builder();;


Contains configuration files that are required for running the tool. The primary file in this directory is config.json, which defines the initial database connection details, and some environment options for the tool (such as whether ffmpeg is available in the deployment environment).


This is where the code for the BackboneJS is located. For a detailed description, click here!


Contains application module and the main sub-modules for the authoring tool. For more details on these modules go here.


All the different plugin types for the tool itself (authentication, file storage, output, and content plugins) are located here.

If you want to implement a plugin for the tool, say an Amazon S3 file storage plugin (yes please!), your plugin will be installed here (e.g. to plugins/filestorage/my-s3-plugin).


Routes that are not related to the REST api are defined in this directory. The structure is similar to the layout suggested by the authors of the ExpressJS framework in this video. The idea is that routes defined in this directory can be browsed to directly.

test/ test_frontend/

Contain unit tests for the NodeJS modules in the first instance and for the Backbone app in the second instance. The Nodejs tests use the Mocha framework, while the frontend uses CasperJS.

Next: The Frontend