The Architectural
Blueprint
A comprehensive deconstruction of the enterprise architecture powering our applications. From the "Smart Orchestrator" frontend to the In-Database AI vector engine.
1. The "Smart Orchestrator" Pattern
We strictly decouple UI (`.razor`) from Logic using the Orchestrator Pattern. The view is intentionally "dumb"—it only handles layout and binding.
The GenericListOrchestrator is a reusable powerhouse that handles:
- Reactive Search (Debounced via System.Reactive)
- State Management (Busy, Error, Data)
- Real-time SignalR integration
2. Master-Detail Composition
Complex forms use a Centralized State Orchestrator. It holds the primary entity and all child collections as a single source of truth.
We use a Data Down, Events Up communication pattern. Child components (`ChildTab.razor`) manage their own UI logic but notify the parent Orchestrator via `EventCallback` to synchronize the global state.
3. The Analytics Pipeline
Dashboards are not just data dumpers. The code-behind acts as a pipeline orchestrator:
- Ingest: Parallel fetch of raw datasets.
- Analyze: Pass data to specialized C# Analyzers (`RiskAnalyzer`, `PredictionEngine`).
- Visualize: Map insights to `MudChart` and `MudDataGrid`.
4. FastEndpoints & REPR
We reject "Fat Controllers" in favor of the REPR Pattern (Request-Endpoint-Response).
Each endpoint is a single class with a single responsibility. It delegates business logic to a Service layer and handles HTTP concerns (Routing, Auth, Serialization).
Functional Safety: We use `Either
5. Data Access Strategy
We employ a Cache-Aside Strategy built on the Repository Pattern.
- Read: Request hits `RedisReadRepository`. On miss, it falls back to `EfRepository` (SQL), then populates Redis.
- Write: Writes go to SQL. Cache invalidation logic immediately clears relevant Redis keys.
Writes invalidate specific cache keys intelligently.
8. Advanced Specifications
We don't write LINQ in services. We use Ardalis Specifications to encapsulate query logic.
The V7 Graph Spec is an "In-Database BI Engine." It uses projection (`.Select()`) to translate complex C# calculations into optimized SQL, returning a flattened, pre-computed DTO.
9. Metadata-Driven Saga Engine
We don't hardcode workflows. Sagas are defined as JSON Recipes.
The engine uses a Finite State Machine (Stateless) and a Compensation Stack. If step 5 fails, the engine automatically rolls back steps 4, 3, 2, and 1.
12. Oracle 23ai Vector Integration
We leverage In-Database AI. No external vector DBs. No ETL pipelines.
The architecture allows for Hybrid Search: Combining precise SQL filters (WHERE Category = 'Tech') with fuzzy Semantic Search (VECTOR_DISTANCE) in a single, atomic query.
14. Performance as Code (NBomber)
We don't guess performance; we assert it. The solution includes a generated .PerformanceTests project.
- Bogus: Generates realistic fake data payloads.
- Scenarios: Simulates full CRUD lifecycles and complex parent-child creation loops.
- Diagnostic Endpoints: Tests trigger internal benchmarks to compare query strategies (V4 vs V7) under load.