Skip to content

ghdoergeloh/pia-system

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIA-System

logo

code style: prettier DOI

Prospective Monitoring and Management - App (PIA).

PIA facilitates the data acquisition in health studies and takes into account the wishes of the participants, the study center and the research institution and thereby also supports the long-term motivation of the participants.

PIA consists of a web application as well as mobile apps for Android and iOS that enables the participants to conduct health studies and study management, as well it can be used as a symptom diary for contact tracing. The main goals of this project are:

  • Simplify the data collection process
  • (Long-term) motivation of users through persuasive technology
  • Focus on usability and user centered design
  • Focus on data protection and security

Build with

In the backend PIA is composed of Node.js microservices that are using PostgreSQL as a database. The microservices are containerized using Docker. As frontends an Angular web app and a Ionic powered iOS and Android mobile app are provided.

Getting started

To get a local copy up and running follow these simple steps.

Prerequisites

Docker, Docker-Compose and Node.js should be installed.

Startup

To run PIA locally move to pia-ansible/local and run start.sh.

cd pia-ansible/local
./start.sh

Use docker ps to check and wait until all services are healthy. After that PIA can be accessed using localhost.

Add the first user

To add the first admin user, you can use the following command:

docker exec authservice node src/scripts/useradd.js --user=TestAdmin --password=TestPassword

Usage

How to add a service

A dockerized node service can be added by creating a new directory and placing the corresponding sources, Dockerfile and package.json into it.

psa.utils.repo-tool generate will automatically adjust the gitlab pipelines. It will also include unit-/integration-tests and linting if specified in the package.json.

For the deployment the new service has to be added to docker-compose.yml.j2.

If the service requires a certificate generate-secrets must be updated to create a certificate for that service.

For the service to be reachable from the outside, the routes to that service have to be configured inside the apigateway.

Local dependencies

A service can use a library that is included in this monorepo. To utilize that functionality you can install the library using relative paths.

psa.service.code-sharing-example$ npm install --save ../psa.lib.code-sharing-example/

Inside the Dockerfile of psa.service.code-sharing-example the dependent lib has to be copied before the npm ci call:

WORKDIR /usr/src/node-app/

ARG DIR=

COPY $DIR/package.json package.json
COPY $DIR/package-lock.json package-lock.json

#copy dependencies
COPY psa.lib.code-sharing-example/ ../psa.lib.code-sharing-example

RUN npm ci --production

After that psa.utils.repo-tool generate has to be executed to update the generated dockerfiles.

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Make sure your Changes are formatted using prettier (npx prettier --write .)
  4. Commit your Changes (git commit -m 'Add some AmazingFeature')
  5. Push to the Branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request

Licence

Distributed under the AGPL-3.0 license. See LICENSE for more information.

Contact

[email protected]

HZI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 67.2%
  • JavaScript 16.6%
  • HTML 9.0%
  • PLpgSQL 2.6%
  • SCSS 1.5%
  • Dockerfile 0.9%
  • Other 2.2%