How mohamedelareeg/domaindrivenerp works
This is a Clean Architecture ERP Web API. Its user workflow begins with an HTTP request, passes through presentation controllers into CQRS-style application use cases, and returns a standardized result; application handlers use domain repository abstractions for business data. Major capabilities include product and category management, customers, orders and invoices, accounting, and identity/roles. The tree and README support these subsystem boundaries, but most implementation wiring was not sampled, so uncertain runtime links are dashed and marked unverified.
Main entry points: Controllers HTTP controllers · Persistence/Repositories Repository contracts · Products Products and categories · DomainDrivenERP.Persistence/Repositories SQL repositories
Components 21
API and presentation
- HTTP controllers
src/DomainDrivenERP.Presentation/Controllers - Result formatting
src/DomainDrivenERP.Presentation/Base/AppControllerBase.cs - Exception handling
src/DomainDrivenERP.API/MiddleWares/GlobalExceptionHandlerMiddleWare.cs
ERP workflows
- Products and categories
src/DomainDrivenERP.Application/Features/Products - Customers
src/DomainDrivenERP.Application/Features/Customers - Orders
src/DomainDrivenERP.Application/Features/Orders - Invoices
src/DomainDrivenERP.Application/Features/Invoices - COA and journals
src/DomainDrivenERP.Application/Features/Coas - Journal queries
src/DomainDrivenERP.Application/Features/Journals - CQRS messaging
src/DomainDrivenERP.Application/Abstractions/Messaging
Domain and persistence
- Domain model
src/DomainDrivenERP.Domain/Entities - Repository contracts
src/DomainDrivenERP.Domain/Abstractions/Persistence/Repositories - SQL repositories
src/DomainDrivenERP.Persistence/Repositories - Distributed cache
src/DomainDrivenERP.Persistence/Caching/CacheService.cs
Identity and services
- Authentication and roles
src/DomainDrivenERP.Application/Features/Authentication - JWT identity service
src/DomainDrivenERP.Identity/Services/AuthService.cs - Identity database
src/DomainDrivenERP.Identity/Data/IdentityDbContext.cs - Email service
src/DomainDrivenERP.Infrastructure/Services/EmailService.cs
Other components
- API client
- SQL Server
- Redis
Connections 20
- API client → HTTP controllers: sends request
- HTTP controllers → CQRS messaging: sends request
src/DomainDrivenERP.Presentation/Controllers/ProductsController.cs - HTTP controllers → Result formatting: formats result
src/DomainDrivenERP.Presentation/Controllers/ProductsController.cs - HTTP controllers → Products and categories: dispatches use case
src/DomainDrivenERP.Presentation/Controllers/ProductsController.cs - HTTP controllers → Authentication and roles: dispatches use case
src/DomainDrivenERP.Presentation/Controllers/RolesController.cs - Products and categories → Repository contracts: uses contracts
src/DomainDrivenERP.Application/Features/Products/Queries/GetProductBySku/GetProductBySkuQueryHandler.cs - Customers → Repository contracts: uses contracts
src/DomainDrivenERP.Application/Features/Customers/Queries/RetriveCustomer/RetriveCustomerQueryHandler.cs - COA and journals → Repository contracts: uses contracts
src/DomainDrivenERP.Application/Features/Coas/Queries/GetCoaWithChildrens/GetCoaWithChildrensQueryHandler.cs - Journal queries → Repository contracts: uses contracts
src/DomainDrivenERP.Application/Features/Journals/Queries/GetJournalById/GetJournalByIdQueryHandler.cs - Repository contracts → SQL repositories: implemented by
src/DomainDrivenERP.Persistence/Repositories/Customers/CustomerSqlRepository.cs - SQL repositories → SQL Server: reads and writes
- SQL repositories → Distributed cache: may cache
- Distributed cache → Redis: stores cache
- Products and categories → Domain model: uses entities
src/DomainDrivenERP.Application/Features/Products/Queries/GetProductBySku/GetProductBySkuQueryHandler.cs - Customers → Domain model: uses entities
src/DomainDrivenERP.Application/Features/Customers/Queries/RetriveCustomer/RetriveCustomerQueryHandler.cs - Authentication and roles → JWT identity service: delegates identity
src/DomainDrivenERP.Identity/Services/AuthService.cs - JWT identity service → Identity database: uses identity store
src/DomainDrivenERP.Identity/Services/AuthService.cs - JWT identity service → Email service: sends reset email
src/DomainDrivenERP.Identity/Services/AuthService.cs - Identity database → SQL Server: persists identity
- Exception handling → HTTP controllers: handles request errors