2.4 KiB
2.4 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/...). - Client-Server Boundaries: DO NOT execute MediatR handlers directly from WASM/MAUI clients if the handler relies on server-only infrastructure (e.g.,
AppDbContext,IHubContext). Instead, the client must trigger an API or SignalR endpoint, and the server dispatches the MediatR command.
- 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
-
Code Validation (CRITICAL):
- Mandatory Build Verification: After any code change, the agent MUST run
dotnet buildon the solution. The agent must verify that the build completes withExit code: 0and without errors before concluding the task or requesting user feedback.
- Mandatory Build Verification: After any code change, the agent MUST run