Skip to content

noi-techpark/davinci-innovation-scoreboard-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Innovation Scoreboard

REUSE Compliance

The innovation scoreboard is a project that aims to visualize the innovation data form South Tyrol and other Italien regions in a user friendly way.

This repository contains the source code for the innovation scoreboard frontend.

Table of contents

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

To build the project, the following prerequisites must be met:

If you don't want to install all prerequisites directly on your machine and instead use a Docker environment with all prerequisites already installed and configured, you can check out the Docker environment section.

How to setup NOI Authentication Server locally?

Skip this section if you connect to the NOI authentication test server.

  • Here you can find how to run the server locally
  • Create a new realm following these steps

How to register this application in your local authentication server?

  1. Open the previously created realm
  2. Create a new client (Clients -> Create)
Property Value
ClientID davinci-innovation-scoreboard-web
  1. Client Settings
Property Value
Access Type public
Standard Flow Enabled Off
Implicit Flow Enabled On
Direct Access Grants Enabled Off
Valid Redirect URIs http://localhost:3000/callback
Web origins http://localhost:3000
  1. Navigate to Scope
Property Value
Full Scope Allowed Off
Client Roles -> davinci-innovation-scoreboard-api -> Assigned Roles Move available roles to assigned roles

How to create a user or assign a user the necessary roles for this application?

  1. Go to users
  2. Create user or select user (View users)
  3. Assign roles: Role Mappings -> Client Roles -> davinci-innovation-scoreboard-api

Source code

Get a copy of the repository:

git clone https://github.com/noi-techpark/davinci-innovation-scoreboard-web.git

Change directory:

cd davinci-innovation-scoreboard-web

Configure

Set the following environment variables to configure the project:

  • API: the URL of the API server

The defaults are already configured, that the you can use the Docker environment right away without any setup.

Dependencies

Install all dependencies by executing the following command:

npm install

Development

To start a local webserver that compiles and serves the project, simply run the following command:

npm run dev

The website will be available at http://localhost:3000. It also recompiles automatically if you make any change to the source code.

Running tests

The unit tests can be executed with the following command:

npm run test

Deployment

To deploy the website, simply run the command npm run generate from the root folder of the project. The final version of the website will then be generate inside the dist folder.

Docker environment

For the project a Docker environment is already prepared and ready to use with all necessary prerequisites.

These Docker containers are the same as used by the continuous integration servers.

Installation

Install Docker (with Docker Compose) locally on your machine.

Start and stop the containers

Before start working you have to start the Docker containers:

docker-compose up --build --detach

The website will be available at http://127.0.0.1:3000. It also recompiles automatically if you make any change to the source code.

After finished working you can stop the Docker containers:

docker-compose stop

Running commands inside the container

When the containers are running, you can execute any command inside the environment. Just replace the dots ... in the following example with the command you wish to execute:

docker-compose exec java /bin/sh -c "..."

Some examples are:

docker-compose exec java /bin/sh -c "npm install"

# or

docker-compose exec java /bin/sh -c "npm run test"

Information

Support

ToDo: For support, please contact [email protected].

Contributing

If you'd like to contribute, please follow the following instructions:

  • Fork the repository.

  • Checkout a topic branch from the master branch.

  • Make sure the tests are passing.

  • Create a pull request against the master branch.

Documentation

More documentation can be found at https://opendatahub.readthedocs.io/en/latest/index.html.

License

The code in this project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 license. See the LICENSE.md file for more information.

REUSE

This project is REUSE compliant, more information about the usage of REUSE in NOI Techpark repositories can be found here.

Since the CI for this project checks for REUSE compliance you might find it useful to use a pre-commit hook checking for REUSE compliance locally. The pre-commit-config file in the repository root is already configured to check for REUSE compliance with help of the pre-commit tool.

Install the tool by running:

pip install pre-commit

Then install the pre-commit hook via the config file by running:

pre-commit install