Skip to content

Authentic base registry containing all public organisations in Flanders

License

Notifications You must be signed in to change notification settings

Informatievlaanderen/organisation-registry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Organisation Registry

Nightly Build CI/CD

Goal

Authentic organisation registry containing public organisations in Flanders.

Please see our contributing guidelines before contributing.

Required tools

  • dotnet sdk (see global.json for exact version)
  • nvm
  • docker compose

Useful commands

To run the UI in live reload mode:

Make sure you have the following lines in your hosts file

127.0.0.1	organisatie.dev-vlaanderen.local
127.0.0.1	api.organisatie.dev-vlaanderen.local

Run the following commands:

nvm use
sudo setcap 'cap_net_bind_service=+ep' `which node` #only if experiencing permissions issues with port
npm install
npm run start:hmr
# browse to https://organisatie.dev-vlaanderen.local

To run external dependencies

Organisation Registry integrates with a number of external systems:

  • Microsoft Sql Server
  • OpenSearch
  • ACM/IDM (Identity Server for development purposes)

To facilitate development, these systems can be run on your environment with Docker Compose:

docker compose up --build

To set up identity server settings

After the initial database setup, run the sql in scripts/development/setup_auth/remove_oidc_auth.sql.

To add a migration:

cd src/OrganisationRegistry.SqlServer/
dotnet ef migrations add <Name of Migration> --context OrganisationRegistryContext --startup-project ../OrganisationRegistry.Api/

To apply a migration:

cd src/OrganisationRegistry.SqlServer/
dotnet ef database update --context OrganisationRegistryContext

To copy events from staging to local db:

bcp OrganisationRegistry.Events out ./events-staging.bcp -S<staging-ip>,<staging-port> -U <username> -d organisation-registry -n -E
bcp OrganisationRegistry.OrganisationRegistry.Events in ./events-staging.bcp -S 127.0.0.1,21433 -U sa -P E@syP@ssw0rd -n -E

Tasks

General Info

Authorization: "Bearer <token here>"
Content-Type: "application/json"

Rebuild Projection

{
  "type": "rebuildProjection",
  "params": [
    "OrganisationRegistry.SqlServer.Organisation.ActiveOrganisationFormalFrameworkListView"
  ]
}

Compensating Action

{
  "type": "compensatingAction",
  "params": [
    "2017-05-18-fix-bodies"
  ]
}

Day Has Passed

{
  "type": "checkIfDayHasPassed"
}

Generating documentation

We use Structurizr to generate our documentation and populate our architecture decisions. All of this can be found in the Structurizr console application.

To run it, make sure you have an appsettings.json with a structurizr.com WorkspaceId, ApiKey and ApiSecret. If you have moved your adr's to another location, don't forget to update AdrPath.

This is how the generated documentation looks: https://structurizr.com/share/37794

Possible build targets

Our build.sh script knows a few tricks. By default it runs with the Test target.

The buildserver passes in CI_BUILD_NUMBER as an integer to version the results and BUILD_DOCKER_REGISTRY to point to a Docker registry to push the resulting Docker images.

NpmInstall

Run an npm install to setup Commitizen and Semantic Release.

DotNetCli

Checks if the requested .NET Core SDK and runtime version defined in global.json are available. We are pedantic about these being the exact versions to have identical builds everywhere.

Clean

Make sure we have a clean build directory to start with.

Restore

Restore dependencies for debian.8-x64 and win10-x64 using dotnet restore and Paket.

Build

Builds the solution in Release mode with the .NET Core SDK and runtime specified in global.json It builds it platform-neutral, debian.8-x64 and win10-x64 version.

Test

Runs dotnet test against the test projects.

Publish

Runs a dotnet publish for the debian.8-x64 and win10-x64 version as a self-contained application. It does this using the Release configuration.

Pack

Packs the solution using Paket in Release mode and places the result in the dist folder. This is usually used to build documentation NuGet packages.

Containerize

Executes a docker build to package the application as a docker image. It does not use a Docker cache. The result is tagged as latest and with the current version number.

DockerLogin

Executes ci-docker-login.sh, which does an aws ecr login to login to Amazon Elastic Container Registry. This uses the local aws settings, make sure they are working!

Push

Executes docker push to push the built images to the registry.

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
  • Entity Framework Core - Entity Framework Core is a lightweight and extensible version of the popular Entity Framework data access technology. - Apache License 2.0
  • 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
  • ASP.NET Core framework - ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux. - Apache License 2.0

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
  • Structurizr - Visualise, document and explore your software architecture. - Apache License 2.0
  • xUnit - xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. - Apache License 2.0
  • Autofac - An addictive .NET IoC container. - MIT
  • AutoFixture - AutoFixture is an open source library for .NET designed to minimize the 'Arrange' phase of your unit tests in order to maximize maintainability. - MIT
  • FluentAssertions - Fluent API for asserting the results of unit tests. - Apache License 2.0
  • Serilog - Simple .NET logging with fully-structured events. - Apache License 2.0

Tooling

Flemish Government Frameworks

Flemish Government Libraries