Simple project showing casing Clean Architecture and Domain-Driven Design projects.
Repos that inspired this one
- https://github.com/jasontaylordev/CleanArchitecture
- https://github.com/ardalis/CleanArchitecture
- https://github.com/thombergs/buckpal
If you like or are using this project to learn or start your solution, please give it a star. Thanks!
The master branch is using .NET 5.
The aim of the repo is to provide with a simple but complete set of features that show case the main concepts behind clean architecture and Domain-Driven design.
From The Clean Architecture Blog Post
- Core folder (Entities, Use Cases)
- Domain project contains the Entities, Aggregates and other elements of the domain
- Application.Services project contains the Use cases of the application
- Infrastructure folder (Controllers, Gateways, Presenters)
- Persistence project contains the persistence and retrieval mechanisms for our entities, aggregates and Read models
- WebApi project contains the Http Controllers that expose the use cases of the application
- The App project is the only project that knows about all projects in the solution. It composes all the dependencies and runs the application.
As the rule of Clean Architecture indicates layers point inwards in the diagram. This means that:
- Domain project does not know about any other projects
- Application.Services only knows about the Domain
- WebApi knows about the Application.Services
- Persistence knows about the Application.Services
The following secrets have to be configured per project. If you are not familiar with the concept of user secrets find more information here
In production DB users for DBUP and MSSQL should be different with different permissions
{
"DBUP_USERID": "SA", // ID of the user for DBUP
"DBUP_PASSWD": "TodoList@Demo", // password for DBUP
"MSSQL_USERID": "SA", // ID of the user for MSSQL
"MSSQL_PASSWD": "TodoList@Demo", // password for MSSQL
"AUTH_ISSUER": "https://[YOUR_AUTH0_DOMAIN].auth0.com/", // replace with your auth0 domain
"AUTH_AUDIENCE": "XXX", // replace with your audience example: https://todo-list-api
"AUTH0_CLIENT_ID": "XXX", // replace with your auth0 client id
"AUTH0_CLIENT_SECRET" : "XXX" // replace with your auth0 client secret
}
{
"DBUP_USERID": "SA",
"DBUP_PASSWD": "TodoList@Demo",
"MSSQL_USERID": "SA",
"MSSQL_PASSWD": "TodoList@Demo"
}
{
"AUTH_ISSUER": "https://[YOUR_AUTH0_DOMAIN].auth0.com/",
"AUTH_AUDIENCE": "XXX",
"AUTH0_CLIENT_ID": "XXX",
"AUTH0_CLIENT_SECRET" : "XXX",
"AUTH0_TEST_EMAIL_ADDRESS" : "XXX" // replace with an email adddress of a user that must exist on auth0
}