{"id":25880181,"url":"https://github.com/danielmackay/test.cleanarchitecture","last_synced_at":"2025-10-13T10:19:30.425Z","repository":{"id":185439789,"uuid":"640890559","full_name":"danielmackay/Test.CleanArchitecture","owner":"danielmackay","description":"DELETE ME","archived":false,"fork":false,"pushed_at":"2023-05-15T10:46:03.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T10:19:29.927Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielmackay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2023-05-15T10:46:00.000Z","updated_at":"2023-05-15T10:46:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"794568cc-1944-449a-89d2-a495c3a02c87","html_url":"https://github.com/danielmackay/Test.CleanArchitecture","commit_stats":null,"previous_names":["danielmackay/test.cleanarchitecture"],"tags_count":0,"template":false,"template_full_name":"SSWConsulting/SSW.CleanArchitecture","purl":"pkg:github/danielmackay/Test.CleanArchitecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielmackay%2FTest.CleanArchitecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielmackay%2FTest.CleanArchitecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielmackay%2FTest.CleanArchitecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielmackay%2FTest.CleanArchitecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielmackay","download_url":"https://codeload.github.com/danielmackay/Test.CleanArchitecture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielmackay%2FTest.CleanArchitecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014684,"owners_count":26085554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-02T13:31:03.871Z","updated_at":"2025-10-13T10:19:30.385Z","avatar_url":"https://github.com/danielmackay.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSW.CleanArchitectureV2\n\n## Pains with Clean Architecture v1\n\n- No default coding standards included\n- Controllers can still get filled up with countless actions - hard to group / split actions out\n- OpenAPI Spec Documentation is hard work to maintain and often wrong or incomplete\n  - Wrong response types\n  - Incomplete Input / Output schemas\n- Not utilizing Domain Events enough\n  - No good reference example or real-world examples for utilizing Domain Events\n- Unit tests and Integration tests are difficult to implement\n  - Mocking Entity Framework's `DbSet` is risky as we make a lot of assumptions about how it works\n- Single primary key data type for all entities in the database\n  - e.g. `int` for everything or `guid` for everything\n  - Difficult to change between types or to add secondary keys with different types\n- Hard to get started on a Client Project using the template\n  - need to remove a lot of demo code\n  - need to remove Default Identity Server for Auth\n  - need to remove the Angular application - when we only need a WebAPI or host the UI app separately\n\n## Features\n\n### General\n\n- **EditorConfig**\n  - Using [SSW.EditorConfig](https://github.com/SSWConsulting/SSW.EditorConfig)\n  - Maintain consistent coding styles for individual developers or teams of developers working on the same project using different IDEs\n- **Directory.build.props**\n  - Consistent build configuration across all projects in the solution\n    - e.g. Treating Warnings as Errors for Release builds\n  - Custom per project\n    - e.g. for all test projects we can ensure that the exact same versions of common packages are referenced\n    - e.g. `XUnit` and `NSubstitute` packages for all test projects\n- Dotnet CLI templates that can let us choose Auth and UI projects to generate with the base Clean Architecture template\n\n### Web API\n\n- NSwag / SwaggerUI\n  - To produce the OpenAPI `specification.json` file that can be used to generate TypeScript or C# clients\n  - Serve as API Documentation for API Integration development\n- **Minimal APIs**\n  - Lightweight and more performant than MVC Controllers\n  - Easier to group related endpoints (or easier to separate non-related endpoints)\n- **Consistent REST API status codes and response types**\n  - Using best practice HTTP Status Codes for each HTTP Verb (`GET`, `POST`, `PUT`, `DELETE`)\n- No default auth provider\n  - Authentication provider examples will be in separate GitHub repositories on [awesome-clean-architecture](https://github.com/SSWConsulting/awesome-clean-architecture)\n- No default UI framework\n  - UI framework reference examples will be in separate GitHub repositories on [awesome-clean-architecture](https://github.com/SSWConsulting/awesome-clean-architecture)\n\n### Application\n\n- **Specifications**\n  - Using [Ardalis.Specification](https://github.com/ardalis/Specification)\n  - Removes the need for Entity Framework dependency in the Application Layer\n  - Makes Unit Testing easier - no more assumptions about how Entity Framework works when mocking out the `DbSet` functionality\n  - Specifications can (and should) have their own Integration Tests.\n  - Specifications can be tested directly and not via a Command or Query that uses them\n  - Reuse common queries throughout the application\n- **CQRS compliance**\n  - Using Read-write repositories for Commands\n  - Using Read-only repositories for Queries (no accidental side-effects against thee data)\n- Fluent Validation\n- AutoMapper\n\n### Domain\n\n- **Strongly Typed IDs**\n  - To combat [Primitive Obsession](https://blog.ndepend.com/code-smell-primitive-obsession-and-refactoring-recipes/) (pass `CustomerId` type into methods instead of `int`, or `Guid`)\n  - Entity Framework can automatically convert the `int`, `Guid`, `nvarchar(..)` to strongly typed ID.\n    - e.g. `13` -\u003e `new CustomerId(13)`\n  - Can be configured per entity!\n\n### Infrastructure\n\n- Entity Framework Core\n  - **Transient Fault Handling**\n- Migrations\n- Data Seeding\n- Model Configuration\n\n### Testing\n\n- Simpler Unit Tests for Application\n  - **No Entity Framework mocking required** thanks to **Specifications**\n- Better Integration Tests\n  - Using [Respawn](https://github.com/jbogard/Respawn) and [TestContainers](https://dotnet.testcontainers.org/)\n  - Integration Tests at Unit Test speed\n  - Test Commands and Queries against a Real database\n  - No Entity Framework mocking required\n  - No need for In-memory database provider\n  - Using [Wire-Mock](https://wiremock.org/) to mock out external services for controlled Integration Tests\n    - e.g. grab real request and responses from external system and then replaying them in the tests\n- Architecture Tests\n  - Using [NetArchTest](https://github.com/BenMorris/NetArchTest)\n  - Know that the team is following the same Clean Architecture fundamentals\n  - The tests are automated so discovering the defects is fast\n- Mutation Testing\n  - Test our tests!\n  - Helps discover the false-positives in our tests\n    - you will know when your tests pass when they should have failed\n  - Inserts bugs into the production code to make sure our tests are effective and testing the right behavior\n  - Using [Stryker Mutator](https://stryker-mutator.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmackay%2Ftest.cleanarchitecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielmackay%2Ftest.cleanarchitecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielmackay%2Ftest.cleanarchitecture/lists"}