Skip to content

interreg-simile/api

Repository files navigation

SIMILE

SIMILE API

Coverage Status Inline docs License javascript style guide

RESTFul API developed the manage the citizen generated data of interreg project SIMILE.

The project aims to improve the actual insubric lakes monitoring system and to create a shared policy for water management through an advanced informative system and citizen participation. The project is funded under the Interreg Italy-Switzerland Cooperation Program in order to develop strategies for the protection of lakes.

Table of Contents

Usage

Please refer to the official documentation.

Local development

To develop the service locally you need:

  • Node 12+
  • MongoDB up and running

To set up Node, please if possible try to use nvm, so you can manage multiple versions easily. Once you have installed nvm, you can go inside the directory of the project and simply run nvm install and the .nvmrc file will install and select the correct version of Node if you don’t already have it.

Once you have all the dependencies in place, you can launch:

npm i

This command will install the dependencies. Now you can create your local copy of the env variables needed for launching the application.

cp ./example.env ./.env

Once you have all your dependency in place, you can launch:

npm run dev

and you will have the service exposed on your machine on the port 8000.

Running the tests

The project contains unit and e2e tests. To run the e2e test you will need a docker container with MongoDB up and running. To do that, run:

docker run -d --name simile-mongo -p 27888:27017 mongo

Now you can run

npm run unit

This command will run all the tests and generate a coverage report that you can view as an HTML page in coverage/lcov-report/index.html.

Building the docs

The API documentation follows the OpenAPI Specification.

For development purposes you can run

npm run dev:docs

to spin up a live server that allows you to visualize the changes in real time.

To build the final version of the documentation, run

npm run build:docs

Contributions

Developed by Edoardo Pessina - GitHub

A special thanks to the project partners:

  • Politecnico di Milano
  • Scuola universitaria professionale della Svizzera italiana
  • Regione Lombardia
  • CNR IRSA
  • Fondazione Politecnico di Milano
  • Cantone Ticino

License

Apache License 2.0 © SIMILE Project