italia / developers-italia-onboarding

Onboarding web portal for the Developers Italia website
https://onboarding.developers.italia.it
BSD 3-Clause "New" or "Revised" License
10 stars 8 forks source link
community developers-italia government italy website

Overview

https://onboarding.developers.italia.it

Issues License

The onboarding tool is a hapi web application that allows Italian Public Administrations to register their code repositories in Developers Italia.

The repositories are scanned by the crawler that feeds the reuse catalog.

Application flow

A single Public Administration can register multiple code repositories.

The private folder and the whitelist.db.json file

The application uses of a directory named private/data, which should contain:

For security reasons, that directory:

whitelist.db.json file format

The format of whitelist.db.json is:

{
  "registrati": [
    {
      "referente": "John Smith",
      "ipa": "c_a123",
      "url": "https://github.com/undefined",
      "pec": "protocollo.comunemaramao@pec.it"
    },
    {
      "referente": "Mario Rossi",
      "ipa": "c_a123",
      "url": "https://gitlab.com/undefined",
      "pec": "protocollo.comunemaramao@pec.it"
    }
  ]
}

An example file is available here.

Get the list of Public Administrations registered through APIs

GET https://onboarding.developers.italia.it/repo-list returns the list of currently registered Public Administrations, in YAML form:

---

registrati:
  -
    timestamp: "2019-05-27T09:45:00.770Z"
    ipa: "c_a123"
    url: "https://github.com/undefined"
    pec: "protocollo.comunemaramao@pec.it"
  -
    timestamp: "2019-05-28T09:45:00.770Z"
    ipa: "c_a123"
    url: "https://gitlab.com/undefined"
    pec: "protocollo.comunemaramao@pec.it"

Development

Run the application directly on the developer machine

  1. mkdir private/data

  2. npm install

  3. npm run dev

The server will listen to http://localhost:3000.

Run the application using Docker

  1. Copy the .env.example file into .env and edit the environment variables as it suits you.

    cp .env.example .env
  2. Build the container:

    docker-compose up

Once the container is up, the content will be served at http://localhost:3000

License

The project is distributed under BSD-3 license (SPDX code: BSD-3-Clause). For more information, have a look at the LICENSE file.