Skip to content

Dev Getting started

Stig Norland edited this page Oct 2, 2018 · 8 revisions

On this page, you will find a list of programming resources on various topics.

Introduction

QDDT client is the front end of QDDT (Questionnaire Design and Documentation Tool). The QDDT client is implemented with angular6. The QDDT API is a bridge between QDDT client and QDDT backend. The backend is a spring-based Java server.

Prerequirement

git
node.js instal instructions
npm
gradle ( 4.4 used in project)
openjdk (1.8.0.151-1 used in project)

Installation (spring-backend)

Backend and datastore

Installation (web-client)

# Clone or download the QDDT client into a folder.
git clone https://github.com/DASISH/qddt-client.git
# install the project's dependencies
npm install

#install angular/cli globally
npm install -g @angular/cli

# watches your files and uses livereload by default
ng serve
# build stage
ng build --c=stage
# build production
ng build --prod

The two arguments of commandline is api and base. Argument api is used to specify the address of the QDDT backend link. Argument base is used to add a base path before the Angular router. For example,

npm run build.prod -- --base=/qddt-client/ --api=https://qddt-test.nsd.no/api/

Code style

The code completely follows the requirement of Angular style. It's reached by tslint.

Application Structure

QDDT client uses the angular-cli project setup.

Components

The core components of QDDT client is in Directory src/. The components include
├───app
│ ├───category
│ ├───category-missing
│ ├───construct-question
│ ├───construct-sequence
│ ├───controlconstruct
│ ├───core --> hold components for login, errors interceptors and guards.
│ ├───home
│ │ ├───concept
│ │ ├───copysource
│ │ ├───study
│ │ ├───survey
│ │ └───topic
│ ├───instrument
│ ├───menu
│ ├───preview --> has lots of components for displaying DDI elements, they are used all over.
│ ├───publication
│ ├───question
│ ├───responsedomain
│ ├───selectors
│ ├───selectors-dialog
│ ├───shared --> is used if a component is referenced by many modules.
│ ├───template --> components that are used to simplify list details views used in the left side menu.
│ └───user
├───assets
└───environments

Selectors and Selectors-dialog are componentes made to search and select different elements and revisions.

Each component has a modules which pack all functionality of one component together.

Running unit tests

ng test

Tests will execute after a build is executed via Karma, and it will automatically watch your files for changes. You can run tests a single time via --watch=false or --single-run. Running end-to-end tests

ng e2e

Before running the tests make sure you are serving the app via ng serve. End-to-end tests are run via Protractor.

Clone this wiki locally