Skip to content

DSP Application Directory View

Gaetano Perrone edited this page Dec 14, 2019 · 1 revision

DSP is a node application that uses npm as package manager. The complete directory view is showed in this image:

public directory contains all client-side source code, while app directory contains all server-side source code. index.js is the main application file: it initializes all components, starts the server and contains all http “routes”, so all http requests are managed from index.js and dispatched to handler components, as explained below.

Configuration files

In config directory are present several configuration files:

  • config_user.json: this is the user configuration file; user can edit it from configuration.html view; the structure is the following:

It contains the user name (that is equal to repository directory name), the mainDir directory that is the root DSP directory where repositories are saved, and githubURL that is the github url of user (when the user changes the github url from configuration.html view the current user repository is deleted, the remote repository is cloned and it’s synchronized with DSP application).

  • test_user.json: it’s the configuration file used by DSP when test mode is enabled; test mode is setted by local.config.json file before that DSP is running. All edit operations on configuration view changes test_user.json if test mode is enabled, config_user.json otherwise. This is a simple way to switch to a testing directory tree and do testing without to altering the official DSP directory tree;

  • local.config.json: this is a static configuration file that cannot be modified when DSP is running. This file contains various informations such as the static client resource directory location (public is the default dir) and if the DSP is running in testing mode or not. Most important information is repos that contains the list of imported repository when DSP is installed. It contains official DSP_Projects repository with all default DSP labs installed.

Script directory

Script directory contains a list of useful scripts that are used to enable testing mode or to upload docker images repositories; npm command is used to execute them:

npm start $SCRIPT_NAME

  • disable_test_mode.js turns off test mode (by changing test to false in local.config.json);

  • enable_test_mode.js turn on test mode (by changing test to true in local.config.json);

  • install_deps_ubuntu.sh it’s a script for Ubuntu OS that installs all DSP dependencies: node, docker, docker-compose;

  • pull_images.sh downloads / updates all docker images used by DSP_Projects repository;

  • uninstall.js deletes mainDir and config.user.json