biolab-unige / xtens-app

A digital repository for biomedical data based on a flexible JSON data model ( The project has been moved to a new address https://github.com/xtens-suite/xtens-app.git )
http://www.xtens.org
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link
biomedical-informatics data-management heterogeneous-data medical-information metadata

XTENS 2

Build Status Coverage Status

XTENS 2 is an open source web-based digital repository for heterogeneous data in life science.

It is designed with the following features:

Getting Started

System Prerequisites:

The following software packages are required to be installed on your system:

Installation (ubuntu server):

Database Configuration:

Now configure PostgreSQL:

Then create a file named local.js in the config/ directory. This config file should include any settings specific of your local system/setup (db passwords, operators etc.).

In the minimal setup it should contain the following information, including two default users with two user groups (admin and general user).

       module.exports = {

        port: process.env.PORT || #port,

        environment: process.env.NODE_ENV || 'development',

        connections: {

            'default': 'postgresql',            //your default database connection

            postgresql: {                       //your database connection

                adapter: 'sails-postgresql',    //sails adapter
                host: '127.0.0.1',              //ip host
                port: '5432',                   //db port (postgresql default port 5432)
                user: 'user',                   //db user
                password: 'password',           //db user password
                database: 'xtensdatabase',      //db name
                schema: true
            },
        },

        defaultGroups: [                        //array of default groups
            {
                name: "admin",
                privilegeLevel: "wheel",
                canAccessPersonalData: true,
                canAccessSensitiveData: true
            }, {
                name: "public",
                privilegeLevel: "standard",
                canAccessPersonalData: false,
                canAccessSensitiveData: false
            }
        ],

        defaultOperators: [                      //array of default users
            {
                firstName: 'default administrator',
                lastName: 'sysadmin',
                birthDate: '1970-01-01',
                sex: 'N.A.',
                email: 'email@domain.com',
                login: 'defaultAdmin',
                password: 'password',
                groups: [1]                      //operator "defaultAdmin" is associated with group "admin"
            }, {
                firstName: 'default user',
                lastName: 'demo user',
                birthDate: '1970-01-01',
                sex: 'N.A.',
                email: 'email@domain.com',
                login: 'demouser',
                password: 'password',
                groups: [2]                     //operator "demouser" is associated with group "public"
            }
        ]
};

Last set your connection in config/models.js file

module.exports.models = {

    migrate: 'safe',      
    connection: 'postgresql'  // your db connection name

};

FileSystem Configuration:

You can choose among two options to store raw/bulk data files:

First choice:

Local FileSystem

This solution uses the file system of the local (server) machine. It is raccomended if it is not necessary share data with different centers or distribuite them across machines

e.g:

module.exports = {

    port: ..,
    environment: ..,
    connections: {
        'default': 'dbconnection',
        dbconnection: { ... }
    },

    fileSystemConnections: {

        'default': 'localConnection',

        localConnection: {
            type: 'local',             
            path: '/filesystem/home/path/',   // your fs home path
            repoDirectory: 'xtens-repo',   // default Directory name
            landingDirectory: 'landing',   // landing directory name
        }
    },

    defaultOperators: [{    ...    }]
};

Second choice:

Irods FileSystem

This is the supported solution for distribuited data grid scenarios, using iRODS (https://irods.org/) Irods File System Prerequisities:

Irods

Install and configure irods following the official guide at: https://docs.irods.org/4.1.10/

Tomcat

Before install tomcat, must be install Java environment

Java

Now can install Tomcat Server (7th version): follow any installation guide like this.

Irods Rest Api

For any problem read the documentation at: https://github.com/DICE-UNC/irods-rest/blob/master/docs/iRODS_REST_API_Documentation.pdf

e.g:

module.exports = {

    port: ..,
    environment: ..,
    connections: {
        'default': 'dbconnection',
        dbconnection: { ... }
    },

    fileSystemConnections: {

        'default': 'irodRestConn',

        irodRestConn: {
            type: 'irods-rest',            
             restURL: {                     // irods-rest url
                protocol:'http:',               // protocol
                hostname: 'host',               // tomcat ip host
                port: 8080,                     // tomcat port
                path: '/irods-rest/rest'        // path
            },
            irodsHome: '/nameZone/home/rods',   // irods home path
            repoCollection: 'xtens-repo',   // irods default Collection name
            landingCollection: 'landing',   // irods landing directory name
            username: 'user',               // irods user
            password: 'password'            // irods user password
        }
    },

defaultOperators: [{    ...    }]

};

Starting Application:

You need to be in xtens-app directory:

    cd path/xtens-app

To start sails (and the application) in production mode:

    sails lift --prod

or:

    node app.js --prod

To ensure that XTENS 2 will be executed without interrupts, install a simple CLI tool like ForeverJS:

    $ [sudo] npm install forever -g

and now you can start your XTENS 2 Platform:

    NODE_ENV=production forever start app.js

Now you can go to the application page http://host:port/#/. (the host is the ip address that you set in local.js and port is the "port: process.env.PORT || #port;" that you set in local.js).

To discover XTENS 2 RESTful API follow the link: RESTful API

To migrate from XTENS 2.0 to 2.1 follow the link: guide

XTENS 2 is published under the BSD 3-clause License.