Skip to content

Architecture ​

Clean Architecture .NET 9 ​

RIVORA Framework suit une architecture en couches stricte avec 47 projets organises :

Presentation (API)           Controllers, Minimal APIs, gRPC, SignalR, GraphQL
       |
Application (CQRS)          Commands, Queries, Validators, DTOs (MediatR)
       |
Domain (Metier)              Entities, Value Objects, Domain Events, Specifications
       |
Infrastructure (Data)       EF Core 9, Repositories, Services externes

Regle fondamentale : les dependances pointent toujours vers le centre. Domain ne depend de rien. Infrastructure depend de Domain et Application, jamais l'inverse.

Structure des projets ​

CoucheProjetsRole
CoreCore, DomainAbstractions, entites, events, specifications
ApplicationApplicationCQRS (MediatR), services, validators, DTOs
InfrastructureInfrastructure, Data.* (4 providers)EF Core, repositories, services externes
PresentationApi, GraphQL, Admin, RealTimeREST, GraphQL, Blazor, SignalR
SecuritySecurity, Identity.ProJWT, BCrypt, 2FA, Rate Limiting, Audit
Multi-TenancyMultiTenancy, SaaSIsolation tenant, billing
Cross-CuttingCaching, Jobs.*, HealthChecks, Notifications, Storage, Features, FeatureManagement, Localization.Dynamic, ApiVersioningModules transversaux
IAAI, NaturalQueryRAG, vector store, NL Query Builder
IntegrationExport, Webhooks, ClientPDF/Excel/CSV, webhooks SaaS, client API
DevOpsAppHost, ServiceDefaults.NET Aspire orchestration
OutilsRVR.CLI, RVR.StudioCLI scaffolding + AI, IDE visuel

Arborescence ​

src/
  RVR.Framework.Core/              # Abstractions de base
  RVR.Framework.Domain/            # Entites, Value Objects, Events
  RVR.Framework.Application/       # CQRS, Services, DTOs
  RVR.Framework.Infrastructure/    # EF Core, Repositories
  RVR.Framework.Api/               # REST API + Swagger
  RVR.Framework.Security/          # JWT, BCrypt, 2FA
  RVR.Framework.MultiTenancy/      # Isolation multi-tenant
  RVR.Framework.Caching/           # Cache L1 (Memory) + L2 (Redis)
  RVR.Framework.Export/            # PDF, Excel, CSV
  RVR.Framework.Webhooks/          # Publish/Subscribe HMAC
  RVR.Framework.GraphQL/           # HotChocolate Gateway
  RVR.Framework.AI/                # RAG, LLM integration
  RVR.Framework.NaturalQuery/      # Langage naturel -> LINQ
  RVR.Framework.Billing/           # Facturation SaaS
  RVR.Framework.Data.SqlServer/    # Provider SQL Server
  RVR.Framework.Data.PostgreSQL/   # Provider PostgreSQL
  RVR.Framework.Data.MySQL/        # Provider MySQL
  RVR.Framework.Data.SQLite/       # Provider SQLite
  ...
tests/
  RVR.Framework.Core.Tests/
  RVR.Framework.Application.Tests/
  RVR.Framework.Domain.Tests/
  RVR.Framework.Api.IntegrationTests/
  ...
tools/
  RVR.CLI/                         # CLI scaffolding + AI review
  RVR.Studio/                      # IDE visuel

Modularite ​

Chaque module implemente IRvrModule pour un enregistrement standardise :

csharp
public class CachingModule : IRvrModule
{
    public string Name => "Caching";
    public string Version => "3.0.0";

    public void ConfigureServices(IServiceCollection services, IConfiguration config)
    {
        services.AddRvrCaching(config);
    }
}

Enregistrement dans Program.cs :

csharp
builder.Services.AddRvrModule<CachingModule>(builder.Configuration);
builder.Services.AddRvrModule<SecurityModule>(builder.Configuration);
builder.Services.AddRvrModule<MultiTenancyModule>(builder.Configuration);

Cette approche permet de passer d'un monolithe modulaire a des microservices sans refactoring majeur.

Released under the MIT License.