{"id":23125153,"url":"https://github.com/statisticsnorway/klass","last_synced_at":"2026-02-16T13:18:14.051Z","repository":{"id":39988800,"uuid":"66553412","full_name":"statisticsnorway/klass","owner":"statisticsnorway","description":"A Spring Boot application that handles classifications for SSB. Klass provides a REST api that clients can use to read classifications, and a Vaadin frontend for maintaining classifications.","archived":false,"fork":false,"pushed_at":"2026-01-19T10:16:53.000Z","size":56865,"stargazers_count":7,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-19T17:38:11.936Z","etag":null,"topics":["backstage","classification","codelist","gsim","statistics"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/statisticsnorway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-08-25T11:49:23.000Z","updated_at":"2026-01-19T10:16:57.000Z","dependencies_parsed_at":"2025-07-07T12:32:06.440Z","dependency_job_id":"e690445e-18ab-4d53-b5ee-19bb7460cb84","html_url":"https://github.com/statisticsnorway/klass","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/statisticsnorway/klass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statisticsnorway%2Fklass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statisticsnorway%2Fklass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statisticsnorway%2Fklass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statisticsnorway%2Fklass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statisticsnorway","download_url":"https://codeload.github.com/statisticsnorway/klass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statisticsnorway%2Fklass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28603423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backstage","classification","codelist","gsim","statistics"],"created_at":"2024-12-17T08:12:44.093Z","updated_at":"2026-02-16T13:18:14.030Z","avatar_url":"https://github.com/statisticsnorway.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Klass\n\nKlass 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).\n\nThe 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:\n\n- API Guide: \u003chttps://data.ssb.no/api/klass/v1/api-guide.html\u003e\n- Swagger UI: \u003chttps://data.ssb.no/api/klass/swagger-ui/index.html\u003e\n- OpenAPI spec: \u003chttps://data.ssb.no/api/klass/v3/api-docs\u003e\n\n## Overview\n\nKlass consists of 4 maven modules\n\n- Klass API (Standalone application that provides the Klass API)\n- Klass Forvaltning (Internal tool for maintenance of classifications)\n- Klass Shared (Classes shared between API and Forvaltning. primary database and search components)\n- Klass Solr (Solr Core configuration and configuration for embedded solr for test/development)\n- Klass Index Job (Responsible for periodically updating the OpenSearch index)\n\n## Build\n\nRun `mvn install` to build the project.\n\n## Deploy\n\nKlass 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.\n\n## Database\n\nKlass uses PostgreSQL for its database.\n\nTests are run with the Zonky Postgres embedded database so that they use the PostgreSQL dialect and guarantee consistency with deployed environments.\n\nKlass is configured to use Flyway for database initialization and migration.\nYou can find the collection of SQL scripts in the Klass-shared module under `src/main/resources/db/migration`\n\n## Development\n\n### Requirements\n\n- Maven: \u003chttps://maven.apache.org/install.html\u003e\n- Sdkman: \u003chttps://sdkman.io/install\u003e\n- Java 17: `sdk install java 17.0.15-tem`\n- Java 8 (for Klass Forvaltning): `sdk install java 8.0.452-tem`\n\n### Code Quality configuration\n\nWe follow a multi-layered approach based on the \"shift-left\" philosophy where problems are addressed as early as possible, ideally while writing the code in the IDE. Checks are performed at three stages:\n\n- In the IDE through extensions\n- In CI/CD as a hard check on PRs\n\nDevelopers are encouraged to install the IDE plugins/extensions to avoid pain at the PR stage.\n\n#### Plugins/extensions\n\n##### IntelliJ\n\n- https://plugins.jetbrains.com/plugin/7973-sonarqube-for-ide\n- https://plugins.jetbrains.com/plugin/8527-google-java-format\n\n#### Lint\n\nWe use Sonarqube for linting. This runs a range of checks on code quality. It runs in CI/CD and it's a good idea to install the extension in your IDE to get feedback as you code.\n\n#### Formatting\n\nWe use google-java-format for code formatting. This avoids unproductive discussions about minutiae of bracket placement etc. Make sure the plugin is installed in your IDE (see [above](#pluginsextensions)).\n\nIt's worth running `mvn fmt:format` before opening a PR to avoid any chance of a CI check complaining at you.\n\n### Configuration\n\n#### GitHub Packages\n\nIn order to download dependencies from GitHub Packages we must authenticate Maven. See the documentation here: \u003chttps://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-with-a-personal-access-token\u003e\n\nThis may be done by generating a Personal Access Token (classic) on GitHub with the `write:packages` scope. Remember to configure SSO. The following configuration may then be placed in your `~/.m2/settings.xml` file.\n\n```xml\n\n\u003cservers\u003e\n    \u003cserver\u003e\n        \u003cid\u003egithub\u003c/id\u003e\n        \u003cusername\u003eUSERNAME\u003c/username\u003e\n        \u003cpassword\u003eTOKEN\u003c/password\u003e\n    \u003c/server\u003e\n\u003c/servers\u003e\n```\n\n#### Docker\n\n##### Colima on Mac\n\nColima should have at least 5G memory and the project folder must be mounted. Change this in `~/.colima/default/colima.yaml` e.g.\n\n```yaml\nmemory: 5\n...\nmounts:\n  - location: /Users/perolsen/Repository/github/klass\n    writable: false\n```\n\n### Introduction\n\nIt's recommended to build with maven before starting development as some classes are generated as part of the build process.\n\nEach app has an `.sdkmanrc` file which may be used to configure the Java version to use. This may be activated by entering the directory and running the `sdk env` command. A `Makefile` is also provided with relevant commands for building each app. See \u003chttps://sdkman.io/usage#env-command\u003e for more details\n\n### Klass API\n\n#### Build\n\nBuild the app: `make build-klass-api`\n\n#### Docker compose\n\nThe apps can be run in multiple different configurations with Docker Compose. See [klass-shared/docker-compose.yaml](klass-shared/docker-compose.yaml) for details.\n\nThere are tasks available in the Makefile as well.\n\n### Klass Forvaltning\n\n#### Build\n\n`make build-klass-forvaltning`\n\n#### Run\n\n`make run-klass-forvaltning-local`\n\nVisit \u003chttp://127.0.0.1:8081/klassui\u003e\n\n### Spring profiles\n\nKlass API and Klass Forvaltning utilize Spring boot and heavily rely on Spring Profiles to make development and debugging easier.\nbelow is a quick summary of the profiles available (see _application.properties_ for more details)\n\n```\n# Application profiles:\n#----------------------\n# Profiles for production\n#   production          = no test beans and only Active Directory login\n#\n# Profiles for development\n#   ad-offline          = will only use test/embeded AD (apacheDS) [Forvaltning only]\n#   small-import        = imports a small number of classifications from legacy system, useful during development\n#   mock-mailserver     = outgoing emails are only logged\n```\n\n### Build profiles\n\nThe profile named `documentation` will generate API documentation with AsciiDoc (default: enabled)\n\n### Run / Debug\n\nYou can start an application using maven with the following command\n\n```shell\nmvn spring-boot:run\n```\n\nStart the forvaltning app with\n\n```shell\nmake run-klass-forvaltning-local\n```\n\nOr from your IDE using the `KlassApiApplication` / `KlassForvaltningApplication` classes.\nIntelliJ is recommended, it makes it very easy to start spring boot applications and will make sure your run/debug configuration has all the necessary dependencies (will include maven dependencies with provided scope).\n\nFrontend may be accessed at:\n\n\u003chttp://localhost:8081/klassui\u003e\n\nREST api documentation may be accessed at\n\n\u003chttp://localhost:8081/api/klass/v1/api-guide.html\u003e\n\n[![IntelliJ](docs/troubleshoot_workdir_small.png)](./docs/troubleshoot_workdir.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatisticsnorway%2Fklass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatisticsnorway%2Fklass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatisticsnorway%2Fklass/lists"}