Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Informatievlaanderen/templates

Repository files navigation

Informatie Vlaanderen .NET Core templates

Goal

Provide dotnet new templates to increase development speed.

Getting started

Install Be.Vlaanderen.Basisregisters.Templates and have a look at the be-registry template:

$ dotnet new -i Be.Vlaanderen.Basisregisters.Templates
> Installing Be.Vlaanderen.Basisregisters.Templates 1.3.2.

$ dotnet new be-registry -h
> Basisregisters Vlaanderen Registry (C#)
> Author: Basisregisters Vlaanderen
> Description: A professional .NET Core project setup including build scripts, documentation and unit tests for an event-sourced project.

In case you want to verify if the correct version is installed, you can run:

$ ls ~/.templateengine/dotnetcli/v*/packages/be.vlaanderen.basisregisters.templates.*.nupkg
> /home/cumpsd/.templateengine/dotnetcli/v2.2.203/packages/be.vlaanderen.basisregisters.templates.1.3.2.nupkg

To create a new registry, in this case a registry containing public services, run:

$ dotnet new be-registry \
       -n PublicServiceRegistry \
       -aggregate PublicService \
       -desc "Authentic base registry containing public services of Flanders." \
       -company "agentschap Informatie Vlaanderen" \
       -email informatie.vlaanderen@vlaanderen.be \
       -site https://vlaanderen.be/informatie-vlaanderen
> The template "Basisregisters Vlaanderen Registry" was created successfully.

This can also be used to bootstrap any event-sourced applications accessible via an API:

$ dotnet new be-registry \
       -n SandwichStore \
       -aggregate Sandwich \
       -desc "Backend for the exira.com sandwich store." \
       -company exira.com \
       -email info@exira.com \
       -site https://exira.com \
       -gh-org exira
> The template "Basisregisters Vlaanderen Registry" was created successfully.

Afterwards, you can run build.sh to compile everything and have a ready to go project. It is possible you will have to make build.sh executable first.

$ chmod +x build.sh
$ ./build.sh
> Paket version 5.198.0
>
> ... a lot of build output ...
>
> ---------------------------------------------------------------------
> Build Time Report
> ---------------------------------------------------------------------
> Target             Duration
> ------             --------
> NpmInstall         00:00:22.1432580
> DotNetCli          00:00:00.3928220
> Clean              00:00:00.0154320
> Restore_Solution   00:00:15.3776050
> Build_Solution     00:00:23.8466700
> Build              00:00:00.0001190
> Test_Solution      00:00:12.4589250
> Test               00:00:00.0002850
> Total:             00:01:14.3630510
> ---------------------------------------------------------------------
> Status:            Ok
> ---------------------------------------------------------------------

To remove everything, run:

$ dotnet new -u Be.Vlaanderen.Basisregisters.Templates

Features

Our Base Registry template provides quite a bit out of the box:

  • FAKE build script + Semantic versioning
  • Command Handling (SQL Stream Store, Aggregate Source)
  • Event Handling (Projac, Projector)
  • Pagination, Sorting, Filtering
  • Validation (Fluent Validation, Problem Details)
  • Localization
  • API Versioning
  • Logging (Serilog)
  • Health Checks (Alive, Database)
  • CORS configuration
  • Response Compression (GZip, Brotli)
  • xUnit Tests (Domain, API, Projections)
  • Swagger/OpenAPI documentation
  • ReDoc API documentation
  • Structurizr documentation
  • Docker deployment

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 SDK - Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI. - MIT
  • .NET Standard definition - The principles and definition of the .NET Standard. - MIT
  • F# - The F# Compiler, Core Library & Tools - MIT
  • F# and .NET Core - F# and .NET Core SDK working together. - 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