A custom "dotnet new"-template for creating backend services that make use of event sourcing.
- Clone the repository or download as ZIP-file
- Install the template:
dotnet new --install /path/to/downloaded/repo/Template
- Create a new solution using the template:
dotnet new hipapi [--MakeSdk --NpmPackageName MyNewService] -o MyNewService
Switches:
--MakeSdk
(optional): Including it enables automatic REST client generation via NSwag.--NpmPackageName
(optional): Provides the name for the generated NPM package. This switch should be used together with the--MakeSdk
switch.
✔ Like DataStore: Creates a service with a structure similar to HiP-DataStore and other services!
✔ Includes Auth-stuff: Authentication and authorization work right out of the box!
✔ Ready to Run: The generated service is immediately executable with no further configuration (*1)!
✔ Sample Code: Includes a sample resource type Foo with all the event classes, DTO classes and controller methods
✔ Swagger: Sets up Swagger and Swagger UI
✔ Auto-Generated SDK: Sets up NSwag for auto-generation of REST client code (*2)
✔ Integration Tests: Scaffolds an xUnit test project to verify the correctness of the service
✔ Ready for Docker: Includes a Dockerfile so the generated service can be easily deployed to our Docker cloud
✔ Ready for Git: Includes gitignore-file and gitattributes-file
(*1) Note: Before running the generated service, make sure MongoDB and EventStore are running.
(*2) Note: This is optional.
The following topics are recommended to understand the .NET template engine: