Skip to content

Latest commit

 

History

History
81 lines (59 loc) · 2.47 KB

DESIGN.md

File metadata and controls

81 lines (59 loc) · 2.47 KB

Design

The Pain Reporting Portal consists of four major pieces.

  1. Dashboard
  2. API
  3. CLI
  4. Rules Engine

Dashboard

The dashboard is a website that allows medical researchers to manage clinical trials. Providing up-to-date information on patient participation.

The dashboard is organized using the MVC pattern. It leverages Sequelize to power the model, Hapi to provide controller services, and Handlebars to render the views.

Relevant Folders

controller
model
view

API

The API is a RESTful service that powers the application that patients use to complete surveys.

The API leverages the same model used by the dashboard, and sends survey information to the companion application in JSON format. The model is powered by Sequelize and the API is handled by Hapi.

Relevant Folders

api
view

CLI

The CLI is a collection of tools to help administrators and developers manage all the Pain Reporting Portal components.

The CLI leverages NPM for running tasks, JSDoc for documentation, Bower to manage UI libraries, and PM2 for production server management.

The CLI also handles testing and code smell detection for the code base. It uses AVA for testing, Proxyquire for mock dependency injection, Sinon for function mocking and stubbing, ESLint for Javascript lint checking, JSONlint for configuration validation, Remark Lint for markdown documentation lint checking, and Stylelint for Cascading Style Sheet lint checking.

Relevant Files and Folder

package.json
.eslintrc.yml
.remarkrc
.stylelintrc.yml
task

Rules Engine

The rules engine responds to events, then looks at patient and trial information and determines when surveys should be offered to a patient. It implements a small expert system in Javascript.

Relevant Folder

rule