Skip to content

Commit

Permalink
#226 Switch named to hikit
Browse files Browse the repository at this point in the history
  • Loading branch information
loreV committed Aug 30, 2022
1 parent 19c1977 commit a620c0a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# S&C - Sentieri e Cartografia
S&C is a collaborative service that manages high level geo and meta data related to trails.
It is intended to provide trail support teams (like the [CAI](https://www.cai.it/) ones) with a rich set of features to update and maintain a trail library, while making this data available to users.
# Hikit Service
Hikit service manages high level geo and meta-data related to trails.
It is intended to provide organizations (like the [CAI](https://www.cai.it/) ones) with a rich set of features to update and maintain a trail rich format library, while making this data available to users.

Currently, the library supports accessibility-notifications, user reports, maintenance planning, generic/specific POIs and other features all linked with trails.
Currently, it supports a wide set of features like accessibility-notifications, user trail accidents reports, maintenance planning, generic/specific POIs and other features all linked with trails.

## Build
### Prerequisites
Expand All @@ -13,17 +13,17 @@ Currently, the library supports accessibility-notifications, user reports, maint
After cloning the repo, simply run `mvn install -f root/pom.xml`.

### Deployment Build
To incude all dependencies in a portable uber-jar, run `mvn install -P package`.
To include all dependencies in a portable uber-jar, run `mvn install -P package`.

### Test
There are two main types of tests written to address the S&C QA: unit test and integration test.
The latter requires the [dependencies](#Dependencies) to be up and running as it tests application operations connecting to them.
Once the dependencies are made available, to run the integration tests, simply execute `mvn install -P it`.
### Testing
There are two main types of tests written to address the Hikit QA: unit and integration tests.
The latter requires the [dependencies](#Dependencies) to be up and running as it runs application operations connecting to them.
Once the dependencies are made available, simply execute `mvn install -P it`.

## Run

### Dependencies
S&C requires the following services up and running in order to fully operate:
Hikit requires the following services up and running in order to fully operate:
- [MongoDB 4.x](https://www.mongodb.com)
- [OpenElevation](https://open-elevation.com/)

Expand All @@ -36,15 +36,15 @@ docker-compose up
Mind that the above set-up is for *test/dev only* as all services are exposed in the network and they do not
use authentication.

### S&C on Docker
In case you want to test run S&C in combination with all its dependencies:
### Hikit on Docker
In case you want to test run Hikit in combination with all its dependencies:
- Run a deployment build (see [Deployment build](#Deployment-build))
- Run `sh docker/build.sh`
- Run `docker-compose -f ./docker/docker-compose.yml -f ./docker/docker-compose.cluster.yml up`
The service will be available at `http://localhost:8990/api/v<N>` (where `<N>` stands for the version number)

### Production
As for production, S&C takes advantage of a Keycloak instance, as it does not implement user and roles natively.
As for production, Hikit takes advantage of a Keycloak instance, as it does not implement user and roles natively.
In order to configure a Keycloak instance, see the Keycloak official documentation.

### Properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.sc.adapter

import com.fasterxml.jackson.databind.ObjectMapper
import org.sc.configuration.AppProperties
import org.sc.configuration.AppProperties.LOCAL_IP_ADDRESS
import org.sc.adapter.response.AltitudeApiRequestPoint
import org.sc.adapter.response.AltitudeApiResponse
import org.sc.adapter.response.AltitudeServiceRequest
import org.sc.configuration.AppProperties
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import java.io.BufferedReader
Expand Down Expand Up @@ -34,7 +33,8 @@ class AltitudeServiceAdapter @Autowired constructor(appProperties: AppProperties
val apiGetEndpoint = "http://$pathToServiceApi?locations=$latitude,$longitude"
return try {
val getCall = URL(apiGetEndpoint).readText()
val gsonBuilder: AltitudeApiResponse = objectMapper.readValue(getCall, AltitudeApiResponse::class.java)
val gsonBuilder: AltitudeApiResponse =
objectMapper.readValue(getCall, AltitudeApiResponse::class.java)
listOf(gsonBuilder.results.first().elevation)
} catch (e: Exception) {
logger.severe("Could not connect to altitude service or read its response")
Expand Down
4 changes: 4 additions & 0 deletions backend/src/main/java/org/sc/adapter/WeatherServiceAdapter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.sc.adapter

class WeatherServiceAdapter {
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AccessibilityReportMailAdapter @Autowired constructor(private val mailAdap
private val logger = Logger.getLogger(AccessibilityReportMailAdapter::class.java.name)

companion object {
const val subject = "[S&C] Attivazione segnalazione"
const val subject = "[Hikit] Attivazione segnalazione"
const val message = "Il %s, hai inviato una segnalazione " +
"tramite S&C al '%s' per il sentiero '%s' (ID da sistema: '%s'). </br> " +
"Descrizione: '%s'.<br/>Per attivare la segnalazione, clicca <a href=\"%s\" target='_blank'>qui</a>, " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class AppProperties {

public static final String APP_NAME = "Sentieri&Cartografia";
public static final String DISPLAYED_VERSION = "1.4.0";
public static final String DISPLAYED_VERSION = "1.5.0-SNAPSHOT";
public static final String LOCAL_IP_ADDRESS = "127.0.0.1";

private final String port;
Expand Down

0 comments on commit a620c0a

Please sign in to comment.