# Containerized Multi-Criteria Decision Analysis Web Service

## 1. Description
This project contains the code to implement a containerized micro web service providing Multi-Criteria Decision Analysis (MCDA, or Multi Criteria Analsys - MCA).

This work has been developed within the activities of the RiskGONE project.

## 2. Installation
### Requirements
* Docker
* A web browser, if there is need to access the service through notebooks

### Download
To download the container from NILU's registry, just pull it:
```bash
docker pull docker.nilu.no/ribo/mca_service
```
### Execution
To run the container as a service on the local machine use (please note that it maps 2 ports to publish both the service and the pluto notebook):
```bash
docker run -p 8080:8080 -p 1234:1234 -t docker.nilu.no/ribo/mca_service
```

## 3. Usage
Detailed instructions on how to use and extend the service are available both for the [web service](web_service/README.md) and for the [docker container](docker/README.md) that makes available the container. 

A good starting point is the included example notebook that can be reached at http://IP_ADDRESS:1234/open?path=%2Fnotebook%2FMCA_calculator.jl when the container image is running.

### Inputs and Outputs
The [service](web_service/README.md) instructions include also a detailed description of inputs and outputs and references to the API documentation, which is also available as PDFs [here](docs).

### Technical Design
Technically, the code is split in two main directories.

The [docker](docker) directory contains code to prepare the container. It requires to copy there and including the most up to date jar of the micro service.

The [web_service](web_service) directory contains the Maven project in Java implementing a micro web service based on [SpringBoot](https://spring.io/projects/spring-boot).


## 4. References
* Docker https://www.docker.com/
* RiskGONE project https://riskgone.wp.nilu.no/
* Spring https://spring.io

## 5. Citation
https://doi.org/10.5281/zenodo.7467912

## 6. License
[![GPLv3 Logo](https://www.gnu.org/graphics/gplv3-127x51.png)](https://www.gnu.org/licenses/gpl-3.0.en.html)

## 7. Funding
This work has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 814425.