This project is split into the following Node.js modules:
- qne-api in the "api" folder
- Contains Swagger API definitions for the REST API and Typescript models. This is referenced by all the projects below.
- qne-core in the "core" folder
- Contains database scripts and endpoints to JSON API validation, but is server agnostic.
- qne-respondent in the "respondent" folder
- Contains lightweight Angular 2 sources compatible with a large number of browsers that implement the respondent's UI
- qne-admin in the "admin" folder
- Contains questionnaire admin UI Angular 2 sources, primarily for latest browsers.
- qne in the "server" folder
- This contains a standalone implementation of the questionnaire service, using Koa 2 as server and Angular Universal hosting for the qne-respondent module and static hosting for the qne-admin module.
The reason for splitting the project into five separate modules is to make it possible to easily attach qne to your existing server, and to make development of the frontend and backend independent.
See the API documentation for in depth information about the qne API.
Run
npm start
to build everything and start the server listening at port 3000. Run
npm run dev
to begin listening to changes and running unit and integration tests.
To make changes to the qne.io API, follow these steps:
- Edit the
api/api.swagger.yaml
file. - Copy/paste the file contents to the online Swagger Editor and fix errors.
- Export the
Typescript Angular2
client and unzip the result to a temporary directory. - Copy Typescript sources in the
model
directory toapi/src
. - Copy relevant parts of the
api
directory to the qne-respondent and qne-admin projects.
We recommend installing these extensions for Visual Studio Code: