|
1 | | -[](https://codeclimate.com/github/statisticsnorway/klass/maintainability) |
2 | | -[](https://github.com/statisticsnorway/klass/actions/workflows/codeql-analysis.yml) |
| 1 | +# Klass |
3 | 2 |
|
4 | | -# KLASS |
| 3 | +Klass is Statistics Norway's system for classifications and code lists. The data model is based on the structure and principles described by [GSIM](https://statswiki.unece.org/spaces/gsim/pages/97356506/1_Introduction). |
5 | 4 |
|
6 | | -Spring Boot applications that handles classifications for SSB. |
7 | | -Klass provides a REST api that clients can use to read classifications, and a Vaadin frontend for maintaining classifications. |
| 5 | +The information in Klass is exposed through a REST API, available to all, free of charge under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.no) license. The API documentation is available in multiple flavours: |
| 6 | + |
| 7 | +- API Guide: <https://data.ssb.no/api/klass/v1/api-guide.html> |
| 8 | +- Swagger UI: <https://data.ssb.no/api/klass/swagger-ui/index.html> |
| 9 | +- OpenAPI spec: <https://data.ssb.no/api/klass/v3/api-docs> |
8 | 10 |
|
9 | 11 | ## Overview |
10 | 12 |
|
11 | 13 | Klass consists of 4 maven modules |
12 | 14 |
|
13 | 15 | - Klass API (Standalone application that provides the Klass API) |
14 | | -- Klass Forvaltning (Frontend for classification maintaining) |
| 16 | +- Klass Forvaltning (Internal tool for maintenance of classifications) |
15 | 17 | - Klass Shared (Classes shared between API and Forvaltning. primary database and search components) |
16 | 18 | - Klass Solr (Solr Core configuration and configuration for embedded solr for test/development) |
| 19 | +- Klass Index Job (Responsible for periodically updating the OpenSearch index) |
17 | 20 |
|
18 | | -## Build and Deploy |
| 21 | +## Build |
19 | 22 |
|
20 | | -Building the project will output war files for **Klass API** & **Klass Forvaltning** and a zip file (WiP) for **Klass Solr**. |
| 23 | +Run `mvn install` to build the project. |
21 | 24 |
|
22 | | -You can find these in each maven modules target folder. |
| 25 | +## Deploy |
23 | 26 |
|
24 | | -``` |
25 | | -klass-api/target/klass-api-{Version}.war |
26 | | -klass-forvaltning/target/klass-forvaltning-{Version}.war |
27 | | -klass-solr/klass-solr-{Version}.zip (WiP) |
28 | | -``` |
| 27 | +Klass is hosted on the Nais application platform. Deploy configuration may be found in the [.nais](.nais) directory. Deploy workflows may be found in the [.github/workflows](.github/workflows) directory. |
29 | 28 |
|
30 | 29 | ## Database |
31 | 30 |
|
32 | | -Klass is configured to use Flyway for database initialising and migration. |
33 | | -You can find the collection of SQL scripts in the Klass-shared module under `src/main/resources/db/migration` |
| 31 | +Klass uses PostgreSQL for its database. |
34 | 32 |
|
35 | | -If the classification tables are empty Klass will by default attempt to import data from its predecessor. |
36 | | -This process can take quite some time as there is a lot of data and its also sent to Solr to populate the search index. |
| 33 | +Tests are run with the Zonky Postgres embedded database so that they use the PostgreSQL dialect and guarantee consistency with deployed environments. |
37 | 34 |
|
38 | | -Tips: If you are only setting up Klass for testing/development purposes you can use the `small-import` spring profile to reduce the amount of data being imported. |
| 35 | +Klass is configured to use Flyway for database initialization and migration. |
| 36 | +You can find the collection of SQL scripts in the Klass-shared module under `src/main/resources/db/migration` |
39 | 37 |
|
40 | 38 | ## Development |
41 | 39 |
|
@@ -119,7 +117,9 @@ Build the app: `make build-klass-api` |
119 | 117 |
|
120 | 118 | #### Docker compose |
121 | 119 |
|
122 | | -TODO |
| 120 | +The apps can be run in multiple different configurations with Docker Compose. See [klass-shared/docker-compose.yaml](klass-shared/docker-compose.yaml) for details. |
| 121 | + |
| 122 | +There are tasks available in the Makefile as well. |
123 | 123 |
|
124 | 124 | ### Klass Forvaltning |
125 | 125 |
|
|
0 commit comments