How brumasebastian/blazor-furniture-app works
Project Type and Purpose
• This is a full-stack web application (“Blazor Furniture App”) for managing furniture, built with .NET 10 and Blazor (Server + WebAssembly).
• It follows Clean Architecture: a layered monolith with clear separation of Core (Domain, Application, Shared, Templates), Infrastructure (external clients, persistence), Presentation (Server + API, WASM client, shared UI).
File Structure Analysis
• Top-level “Aspire” folder: .NET Aspire orchestration (AppHost spins up Keycloak, PostgreSQL, Maildev).
• src/Core:
• Domain (entities, enums)
• Application (CQRS handlers, requests/commands/queries)
• Shared (common configs, error mappers)
• Templates (email & UI templates)
• src/Infrastructure:
• Infrastructure (Keycloak HTTP clients, external-service abstractions)
• Persistence (EF Core DbContext, migrations)
• src/Presentation:
• BlazorFurniture (Server app + FastEndpoints API, middleware, controllers)
• BlazorFurniture.Client (WASM client app, components, services)
• BlazorFurniture.Shared (reusable UI components, model definitions, localization, authorization handlers)
• tests: Unit and integration tests for controllers, application handlers, infrastructure implementations.
Key Insights from README
• Clean Architecture with explicit layers.
• Authentication & authorization via Keycloak (OIDC/OAuth2), JWT for API.
• FastEndpoints for API, MudBlazor for UI, Serilog for logging.
• Orchestration by .NET Aspire starts Identity (Keycloak), DB (PostgreSQL), Maildev.
a. Main Components
1. Aspire Orchestration
– AppHost (.NET Aspire)
– ServiceDefaults
– Deployed containers: Keycloak, PostgreSQL, Maildev
2. Presentation Layer
– Blazor Server + FastEndpoints API
– Blazor WASM Client
– Shared UI component library
3. Application Layer
– CQRS (Commands, Queries, Decorators)
– MediatR-style dispatcher
4. Domain Layer
– Business entities, enums, behaviors
5. Infrastructure Layer
– External clients (Keycloak management, UMA Authz)
– Persistence (ApplicationDbContext, EF Core)
b. Relationships & Interactions
• Browser → WASM client (hosted or direct) → API endpoints (FastEndpoints)
• WASM/Server UI → Application layer (CQRS dispatcher) → Domain logic
• Application layer → Infrastructure
• To Keycloak (management, tokens, UMA PDP)
• To PostgreSQL via DbContext
• Infrastructure returns data/authorization decisions → Application → Presentation
• Logging via Serilog sinks throughout layers
• Aspire orchestrator manages lifecycles of Keycloak, DB, Maildev, and AppHost
c. Architectural Patterns
• Clean Architecture (Onion/Hexagonal): dependency rule from UI inward
• CQRS / Mediator for command/query segregation
• Dependency Injection for all services
• Externalized auth via Keycloak with OIDC/OAuth2 flows
• Containerized orchestration (.NET Aspire)
d. Key Technologies & Frameworks
• .NET 10, C#
• Blazor Server + WebAssembly, MudBlazor
• FastEndpoints for HTTP APIs
• Keycloak as identity provider (JWT bearer, UMA PDP)
• PostgreSQL (EF Core)
• Serilog for structured logging
• .NET Aspire for container orchestration
• Swagger/Scalar for API docs
Elements
• Clear labels for each layer/component (e.g., “ApplicationDbContext”, “Keycloak Client”)
• Green for orchestration (Aspire)