Pryv.io is Pryv's software (middleware) for management of personal and health data, see. pryv.com
While Pryv.io is designed to store and manage data per-individual / per-consent, it might be usefull to aggregate the data of multiple individual in a single place. As an example, when a process requires the data from a cohort of patients.
- Holds a set of pryvApiEndpoints
https://{token}@{individial storage path}/
which contains the necessary credentials to access a single account. - When a new individual's apiEndPoint is registered on the aggregator, the aggregator
- Fetches the current streams structure and events
- Creates and register one Webhook per individual on Pryv.io to be advertised of changes.
- Then the aggregator listen for triggers from the webhooks and advertises changes on the account.
- States (list of pryvApiEndpoints & synchronization statuses ) can be stored locally on the server or remotely in a dedicated Pryv.io account.
- The aggregator offers a framework to design custom state storages.
- Individual's Data can be stored locally in an sqlite database
- The aggregator offers a framework to design custom data storages.
- Node.js 12+
- NPM
- An option SSL reverse-proxy (exemple nginx) to secure trigger notices.
- run
npm setup
- edit
config.json
- server: Server configuration
- port: the port to listen
- host: the interface to use. for all:
0.0.0.0
, for localhost only:127.0.0.1
- service: Url to reach the aggregator service, if no SSL termination: http://{hostname}:{port}/
- state-storage: Choose one stage storage to use, see stage storage bellow
- data-change-listeners: Array of data listeners to use, more informations bellow
- server: Server configuration
A State storage holds the list of web hooks and their status, currently supported stage storage is SQLITE.
"state-storage": {
"module": "StateStorageSqlite",
"params": {
"dbfile": "./db-states.sqlite",
"log": false
}
}
To implement your own State Storage, look at src/state-storage
A Data Listener, register to data change and take actions, for example DataListenerConsole
prints outs changes and DataListenerSQLite
keeps streams and events data in a local database.
"data-change-listeners": [
{
"module": "DataListenerConsole",
"params": {}
},
{
"module": "DataListenerSQLite",
"params": {
"dbfile": "./db-data.sqlite",
"log": false
}
}
]
To implement your own Data Listener, look at src/data-change-listeners
npm run start
POST /hook
Content:
{
"pryvApiEndpoint": "https://{token}@{pryvApiEndPoint}"
}
Result:
{
"result": "OK"
}
npm run test
Contributions are welcome. The architecture has been made modular to facilitate extension.