CraftersCloud.ReferenceArchitecture.ProjectTemplates 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet new install CraftersCloud.ReferenceArchitecture.ProjectTemplates::1.1.0                
This package contains a .NET Template Package you can call from the shell/command line.

Crafters Cloud Reference Architecture

Overview

This project provides a reference for building scalable and maintainable applications using C# and SQL (Sql Server). It also includes project templates which can be used to create new solutions (crafters-starter project template), and to add new features (crafters-feature project template).

The architecture leverages several modern technologies and best practices to ensure high performance, maintainability, and ease of development. It is based on the principles of Domain-Driven Design (DDD), CQRS, extreme programming (XP) and Vertical Slice Architecture. It is primarily designed to be flexible and extensible, allowing developers to quickly add new features covered by the integration tests (scaffolding of features is supported). The architecture does not give preference to either Onion Architecture or the Clean Architecture. It can support both, but only if and when needed, by applying the necessary project refactorings.

Domain (and entities)

Testing Strategy

Following the idea of XP and YAGNI (You Ain't Gonna Need It), the focus is to first add integration tests that are covering happy flow paths. These tests require minimum needed code, maintenance and setup. The tests follow principles of black box testing of API endpoints. The black box testing has added benefit of allowing implementation (and architecture) of the system to evolve without need to change the tests. White box testing (using faking and mocking) is still possible, but it considered a code smell. White box testing makes changing the code and evolving the architecture harder since both implementation and tests need to be changed in parallel, making architecture evolution harder. For verifying the results in the tests the two libraries VerifyTests and Shouldly are used, since they provide a more readable way of verifying the results.

Key Technologies

  • Minimal API: A lightweight framework for building HTTP APIs with minimal overhead, allowing for quick and efficient development of RESTful services.
  • Autofac A popular IoC container for .NET that provides a simple and flexible way to manage dependencies in your application.
  • Entity Framework: An object-relational mapper (ORM) that enables .NET developers to work with a database using .NET objects, eliminating the need for most of the data-access code.
  • MediatR: A simple, unambitious mediator implementation in .NET, used to decouple the sending of requests from handling them, promoting a clean architecture.
  • Mapperly: A high-performance object-to-object mapper that helps in transforming objects between different layers of the application.
  • FluentValidation: A popular .NET library for building strongly-typed validation rules, ensuring that your data models are validated consistently and efficiently.
  • NUnit: A popular unit testing framework for .NET that provides a simple and flexible way to write and run tests.

This combination of technologies provides a robust foundation for developing modern, high-quality applications.

Usage

Prerequisites

  • .NET SDK 9
  • SQL Server
  • Docker

Getting Started

Install the template from NuGet.org

dotnet new install CraftersCloud.ReferenceArchitecture.ProjectTemplates

Create a new solution based on the template

dotnet new crafters-starter --projectName Client.Project --friendlyName "Client Project" --allow-scripts yes

Open the new solution in Visual Studio or Rider

Build the solution and run the integration tests to ensure everything is working correctly.

Scaffold new feature in the new solution

Either execute the scripts\new-feature.ps1 script

or run the following command from command line (position yourself in the root folder of the solution): dotnet new crafters-feature --projectName Client.Project --featureName Order --featureNamePlural Orders --allow-scripts yes

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0-preview.1 33 1/22/2025
2.1.0-preview.0 35 1/22/2025
2.0.3 20 2/6/2025
2.0.2 72 1/22/2025
2.0.1 65 1/22/2025
2.0.0 70 1/21/2025
2.0.0-preview.6.2 30 1/21/2025
2.0.0-preview.6.1 32 1/21/2025
2.0.0-preview.5 30 1/17/2025
2.0.0-preview.0 27 1/17/2025
1.2.0 76 1/17/2025
1.1.1 73 1/15/2025
1.1.0 69 1/15/2025
0.3.1 63 1/14/2025
0.3.0 57 1/14/2025