Skip to content

Informatievlaanderen/base-registries

Repository files navigation

Basisregister site

Base Registries Build Status

Prerequisites

NVM: (Windows, unix, macOS, windows WSL)

Node: v18.15.0 (do this with nvm)

NPM: v9.5.0 (nvm handles this too)

nvm install 18.15.0 

For windows users that use git bash instead wsl

# Update npm shell 
# Git bash (32 bit installation)
npm config set script-shell "C:\\Program Files (x86)\\git\\bin\\bash.exe"

# Git bash (64 bit installation)
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"

# In case you want to revert this. You can execute 
npm config delete script-shell

Common mistakes and solutions

npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 

When seeing this output than it means you're not using the correct node version. package-lock.json file will version bump itself ("lockfileVersion": ...). Instead of that what we is to do these steps.

  1. Delete node_modules directory.
  2. Revert package-lock.json changes.
  3. Exec nvm use
  4. Exec npm i

Project setup

Before executing below commands, replace the variable ${NPM_TOKEN} in #YOUR_PROJECT_PATH/base-registries/site/.npmrc with the NPM auth token necessary to install all NPM packages.

cd #YOUR_PROJECT_PATH/base-registries/site
nvm use
npm i

Compiles and hot-reloads for development

# env dev
npm run serve

# OR

# env test
npm run serve-tst

# OR

# env staging
npm run serve-stg

# OR

# env production
npm run serve-prd

Compiles and minifies for production

# env production
npm run build

If it fails with javascript heap out of memory try with

NODE_OPTIONS=--max_old_space_size=4096 npm run build

Lints and fixes files

npm run lint

Project Configurations

Environment Variable Description
API_VERSION Basisregistry public-api version
SITE_VERSION Version of this base-registry site
API_ENDPOINT Basisregistry public-api endpoint
BRANCH_CONTENT Git branch name of markdown content [main, tst, stg, prd]
Build args Description
NPM_TOKEN Only required when using ./Dockerfile

Page contents

If a view's options are marked with hasMarkdown to true, then its contents are determined by the Markdown files in https://github.com/Informatievlaanderen/base-registries-content.

Docker Compose

    #run all env at once
    docker-compose up --build --remove-orphans

    #port 8081 -> dev
    #port 8082 -> tst
    #port 8083 -> stg
    #port 8084 -> prd

OR create own docker compose file

version: '3.9'
services:
  dev:
    build:
      context: .
      dockerfile: ./Dockerfile
      args:
        NPM_TOKEN: #NPM_TOKEN
    environment:
      API_VERSION: 9.9.9-dev
      SITE_VERSION: 0.0.0-dev
      API_ENDPOINT: https://api.basisregisters.vlaanderen.be
      REPLACE_ALIAS_ZONE_NAME: basisregisters.vlaanderen.be
      REPLACE_ALIAS_BRANCH_CONTENT: main
    ports:
      - "8081:80"

OR

# build without compose
docker build -t test:0.0.1-dev --build-arg NPM_TOKEN=$NPM_TOKEN -f ./Dockerfile ./
docker run test:0.0.1-dev -p 8080:80 -e API_VERSION='9.9.9-dev' -e SITE_VERSION='0.0.0-dev' -e API_ENDPOINT='https://api.basisregisters.vlaanderen.be' -e REPLACE_ALIAS_ZONE_NAME='basisregisters.vlaanderen.be' -e REPLACE_ALIAS_BRANCH_CONTENT='main'

License

European Union Public Licence (EUPL)

The new version 1.2 of the European Union Public Licence (EUPL) is published in the 23 EU languages in the EU Official Journal: Commission Implementing Decision (EU) 2017/863 of 18 May 2017 updating the open source software licence EUPL to further facilitate the sharing and reuse of software developed by public administrations (OJ 19/05/2017 L128 p. 59–64).

Credits

Languages & Frameworks

  • .NET Core - MIT
  • .NET Core Runtime - CoreCLR is the runtime for .NET Core. It includes the garbage collector, JIT compiler, primitive data types and low-level classes. - MIT
  • .NET Core APIs - CoreFX is the foundational class libraries for .NET Core. It includes types for collections, file systems, console, JSON, XML, async and many others. - MIT
  • .NET Core SDK - Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI. - MIT
  • .NET Core Docker - Base Docker images for working with .NET Core and the .NET Core Tools. - MIT
  • .NET Standard definition - The principles and definition of the .NET Standard. - MIT
  • Roslyn and C# - The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs. - Apache License 2.0
  • F# - The F# Compiler, Core Library & Tools - MIT
  • F# and .NET Core - F# and .NET Core SDK working together. - MIT
  • Vue.js - Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web. - MIT

Libraries

  • Paket - A dependency manager for .NET with support for NuGet packages and Git repositories. - MIT
  • FAKE - "FAKE - F# Make" is a cross platform build automation system. - MIT

Tooling

Flemish Government Libraries