Skip to content

Read Me First

Check out the Numera Backend Guide for additional information.

Triggering Document Creation

graph TD;
%% Nodes
    U("User")
    A(Numera Admin)
    N["Numera UI"]
    C["statistic-service"]
    O["office-documents-service"]
    q{{queue}}
    b[(s3 bucket)]
    S[statista.com/statistics/download]

%% Edges
    A -- re-send all published statistics --> C
    U -- publishes statistic --> N --> C-- message:statistic data --> q --> O -- generates documents --> b <--> S

Prerequisites

Basically, you need to prepare the following:

  • Create GitHub token
  • Configure settings

The details of these steps are explained in the following sections.

Create a GitHub token

Create an access token in Github. After creating the token, copy and paste it to a safe place. Once you leave that view, the token will not be visible to you anymore.

Make sure to configure SSO for this token, authorizing PIT-Numera and PIT-User-Tools.

Create a .settings.xml file

Copy the following settings to a file called settings.xml, located in ${HOME}/.m2:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <activeProfiles>
        <activeProfile>github</activeProfile>
    </activeProfiles>

    <profiles>
        <profile>
            <id>github</id>
            <repositories>
                <repository>
                    <id>github</id>
                    <url>https://maven.pkg.github.com/PIT-Numera/maven-packages/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <servers>
        <server>
            <id>github</id>
            <username>your-github-user-name</username>
            <password>your-github-token</password>
        </server>
    </servers>
</settings>

where your-github-user-name is your GitHub username (something like firstname-lastname_statista) and your-github-token is the token (some string starting with ghp_) you created in the previous step.

Run the service

Get the source code

Open another terminal window and get the latest version of the service by calling

git clone git@github.com:PIT-Numera/office-documents-service.git
cd office-documents-service

Building via maven

Test the service installation by calling

mvn clean package

(If mvn is installed on your machine, you can of course also call that instead of ./mvnw.)

Run service locally

run https://github.com/PIT-Numera/local-dev-setup to have a local db running and so on, then

cd office-documents-rest
mvn spring-boot:run -Dspring-boot.run.profiles=local -DskipTests
open http://localhost:8086/swagger-ui/index.html