The innovation scoreboard is a project that aims to visualize the innovation data from South Tyrol and other Italien regions in a user friendly way.
This repository contains the source code for the innovation scoreboard backend.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To build the project, the following prerequisites must be met:
- Java JDK 1.8 or higher (e.g. OpenJDK)
- Maven 3.x
- Postgres Database 11
- Elasticsearch 7.2
- AWS account with S3 access
- Kibana (optional)
- Authentication server
If you want to run the application using Docker, the environment is already set up with all dependencies for you. You only have to install Docker and Docker Compose and follow the instruction in the dedicated section.
However, the authentication server is not part of the Docker environment and needs to be started separately.
- Open the previously created realm
- Create a new client (Clients -> Create)
Property | Value |
---|---|
ClientID | davinci-innovation-scoreboard-api |
- Client Settings
Property | Value |
---|---|
Access Type | bearer-only |
- Navigate to Roles
Add following roles: project_manager
- Go to users
- Create user or select user (View users)
- Assign roles: Role Mappings -> Client Roles -> davinci-innovation-scoreboard-api
- Open the previously created realm
- Create a new client (Clients -> Create)
Property | Value |
---|---|
ClientID | davinci-innovation-scoreboard-api-client |
- Client Settings
Property | Value |
---|---|
Access Type | public |
Standard Flow Enabled | Off |
Implicit Flow Enabled | Off |
Direct Access Grants Enabled | On |
- Navigate to Scope
Property | Value |
---|---|
Full Scope Allowed | Off |
Client Roles -> odh-mobility-v2 -> Assigned Roles | Move available roles to assigned roles |
- Generate a new token
curl --location --request POST 'http://localhost:8080/auth/realms/NOI/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username={USERNAME}' \
--data-urlencode 'password={PASSWORD}' \
--data-urlencode 'client_id=davinci-innovation-scoreboard-api-client'
Get a copy of the repository:
git clone https://github.com/noi-techpark/davinci-innovation-scoreboard-api.git
Change directory:
cd davinci-innovation-scoreboard-api/
Copy the file src/main/resources/application.properties
to src/main/resources/application-local.properties
and adjust the variables that get their values from environment variables. You can take a look at the .env.example
for some help.
Build the project:
mvn -Dspring.profiles.active=local clean install
Run the project:
mvn -Dspring.profiles.active=local spring-boot:run
The service will be available at localhost and your specified server port.
To execute the test you can run the following command:
mvn clean test
Copy the file .env.example
to .env
and adjust the configuration parameters.
Then you can start the application using the following command:
docker-compose up
The service will be available at localhost and your specified server port.
To execute the test you can run the following command:
docker-compose run --rm app mvn clean test
If you want to run the application from an IDE and don't use the Docker container for it, then you still have the possibility to start all dependencies using Docker.
-
Copy the file
src/main/resources/application.properties
tosrc/main/resources/application-local.properties
and adjust the settings if needed. -
Startup external dependencies
docker-compose -f docker-compose.dependencies.yml up
- Run application in your prefered IDE as a maven project
mvn:spring-boot run -Dspring-boot.run.profiles=local
User management is handled by the NOI Authentication server. This application offers 1 role, that is used to protect CSV upload endpoints.
- project_manager
For support, please contact [email protected].
If you'd like to contribute, please follow the following instructions:
-
Fork the repository.
-
Checkout a topic branch from the
development
branch. -
Make sure the tests are passing.
-
Create a pull request against the
development
branch.
More documentation can be found at https://opendatahub.readthedocs.io/en/latest/index.html.
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.
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