1.8 KiB
1.8 KiB
name, description
| name | description |
|---|---|
| nexus-clean-architecture | Clean Architecture & CQRS implementation for .NET 10 with Blazor Hybrid |
Clean Architecture Standards
-
Project Structure (Layered):
NexusReader.Domain: Enterprise business rules (Entities, Value Objects, Domain Events).NexusReader.Application: Application business rules (Commands, Queries, DTOs, Mappings, Interfaces).NexusReader.Infrastructure: Data access, external services, and platform-specific implementations.NexusReader.UI.Shared: UI logic and Blazor components.NexusReader.Maui/NexusReader.Web: Platform host projects.
-
CQRS & Messaging:
- MediatR: Use standard
MediatRfor decoupling. - Queries: Read-only operations, return
Task<Result<T>>. - Commands: State-changing operations, return
Task<Result>orTask<Result<T>>. - Handlers: Located in
Applicationlayer, grouped by feature (e.g.,Queries/Reader/...).
- MediatR: Use standard
-
Functional Error Handling:
- Mandatory use of
FluentResults. - No exceptions for business logic flow. Handlers must return
Result.Ok()orResult.Fail().
- Mandatory use of
-
UI Architecture (Atomic Design):
- Components in
NexusReader.UI.Sharedmust follow Atomic Design:Atoms: Smallest functional units (Buttons, Inputs).Molecules: Groups of atoms (Search Bar, Form Field).Organisms: Complex UI sections (Navigation, Header).Pages: Composed organisms forming a full view.
- Components in
-
Object Mapping:
- Use
Mapsterfor all DTO/Entity mappings. - Centralize configuration in
NexusReader.Application/Mappings/MappingConfig.cs. - No
AutoMapperallowed.
- Use
-
Cross-Platform Strategy:
- Maximize code sharing in
NexusReader.UI.Shared. - Use
IPlatformService(or similar abstractions) for native features, implemented inInfrastructure.Mobileor Maui projects.
- Maximize code sharing in