// The Production-Grade Monolith

Enterprise ERP Architecture
Without The Fluff.

This is not a demo. It's a hardened, modular monolith built on .NET 9, Clean Architecture, and Domain-Driven Design. Designed for scale, observability, and AI integration.

Backend.NET 9 / FastEndpoints
FrontendBlazor WASM / MAUI
DataEF Core / Dapper / Redis
MessagingRabbitMQ / SignalR
SearchElasticsearch / Mongo
JobsHangfire / Quartz

System Topology

The solution is explicitly multi-project, aligned with Clean Architecture boundaries. It prevents domain leakage and ensures testability.

Presentation

Blazor WASM & .NET MAUI clients.

  • MudBlazor Components
  • Reactive Orchestrators
  • Smart Caching

Client.Services

Shared HTTP Typed Clients.

  • Refit / Flurl
  • Resilience Policies
  • Shared DTOs

GenesisCore.Api

The entry point. ASP.NET Core 9.

  • FastEndpoints (REPR)
  • SignalR Hubs
  • Auth & Identity

GenesisCore.Domain

The heart. Pure Business Logic.

  • Rich Aggregates
  • Domain Events
  • Guards & Rules

Infrastructure

Implementation details & I/O.

  • EF Core / SQL
  • Mongo / GridFS
  • RabbitMQ Bus

Background Workers

Async processing & scheduling.

  • Hangfire Server
  • Quartz Schedulers

01 // THE DOMAIN MODEL

Rich Aggregates,
Not Anemic Data Bags.

We reject the "Anemic Domain Model" anti-pattern. Our entities encapsulate behavior, enforce invariants via Guards, and raise Domain Events to trigger side effects.

Encapsulation Private setters. Modification only via business methods (e.g. ApproveInvoice).
Domain Events Decouples side effects. InvoiceApproved triggers emails & inventory updates.
InvoiceAggregate.cs C#
1public class Invoice : AggregateRoot 2{ 3 public void Approve(User approver) 4 { 5 Guard.Against.InvalidState(this.Status, InvoiceStatus.Draft); 6 7 this.Status = InvoiceStatus.Approved; 8 this.ApprovedBy = approver.Id; 9 10 // Side effects happen via events, not here. 11 this.AddDomainEvent(new InvoiceApprovedEvent(this)); 12 } 13}
CustomerGraphSpec.cs C#
1public class CustomerAdvancedGraphSpec : Specification<Customer> 2{ 3 public CustomerAdvancedGraphSpec(Guid id) 4 { 5 Query.Where(c => c.Id == id); 6 7 // Prevent Cartesian Explosion 8 Query.AsSplitQuery(); 9 10 // Server-Side Projection (Runs in SQL) 11 Query.Select(c => new CustomerDto { 12 TotalRevenue = c.Invoices.Sum(i => i.Total), 13 ActiveContracts = c.Contracts.Count(x => x.IsActive) 14 }); 15 } 16}

02 // HIGH-PERFORMANCE DATA

CQRS & Advanced
Specifications.

We separate Reads from Writes. Writes go through the rich domain model. Reads use highly optimized **EF Core Specifications** with projections.

Split Queries Automatically breaks massive joins into separate SQL queries to avoid performance cliffs.
Hybrid Caching Multi-level caching strategy using In-Memory L1 + Redis L2 + Mongo L3.

03 // THE INFRASTRUCTURE

Polyglot Persistence &
Distributed Systems.

One database does not fit all. We use the right tool for the job, orchestrated via Autofac and Docker.

SQL Server Transactional integrity for core business data.
MongoDB GridFS Storage for large artifacts (PDFs, Videos, X-Rays).
Elasticsearch Full-text search and complex analytics indices.
RabbitMQ Asynchronous messaging for Sagas and integration.
InfrastructureModule.cs C#
1// Polyglot Registration Strategy 2builder.RegisterGeneric(typeof(EfRepository<>)) 3 .As(typeof(IRepository<>)) 4 .InstancePerLifetimeScope(); 5 6builder.RegisterType<GridFsBlobStorageService>() 7 .As<IBlobStorage>(); 8 9builder.RegisterType<RabbitMqPublisher>() 10 .As<IMessagePublisher>() 11 .SingleInstance();