Overview

This document outlines the architectural decisions and structure implemented for the EG-Flow solution. The structure follows modern .NET development practices with clear separation of concerns and maintainability as core principles.

Technical Stack

  • Target Framework: .NET 9
  • API Documentation: Swagger/OpenAPI
  • Orchestration: .NET Aspire
  • Frontend: Blazor WebAssembly Standalone
  • Backend: NET Core Web API


Solution Structure

No

Project Name

Description

1

EGU.FLOW

Empty Solution - Root container for all projects

2

EGU.Flow.ApiServices

Web API - Backend APIs and endpoints

3

EGU.Flow.AppHost

Aspire AppHost - Application orchestrator

4

EGU.Flow.Domain

Class Library - Domain models with zero dependencies

5

EGU.Flow.Core

Class Library - Shared DTOs, interfaces, and enums

6

EGU.Flow.Web

Blazor WebAssembly - Frontend UI application

7

EGU.Flow.BusinessLogic

Class Library - Business logic, services, and mappers


Detailed Component Overview

1. EGU.FLOW (Solution)

Type: Empty Solution

The solution serves as the organizational unit that groups all related projects together, enabling unified build, deployment, and dependency management.

2. EGU.Flow.ApiServices (Backend)

Type: ASP.NET Core Web API

This project exposes RESTful endpoints and serves as the primary interface between the frontend and business logic layers. Swagger is configured for API documentation and testing.

Key Responsibilities:

  • HTTP endpoint definitions
  • Request/response handling
  • API versioning and routing
  • Authentication and authorization middleware

3. EGU.Flow.AppHost (Orchestra)

Type: .NET Aspire AppHost

The AppHost acts as the development orchestrator, coordinating multiple services. It manages service discovery, configuration, and inter-service communication during development and deployment.

Benefits:

  • Simplified local development setup
  • Centralized service configuration
  • Built-in observability and telemetry
  • Streamlined deployment patterns

4. EGU.Flow.Domain

Type: Class Library

This is an isolated layer containing pure domain models with zero external dependencies. It represents the core business entities and follows Domain-Driven Design principles.

Characteristics:

  • No dependencies on other projects
  • Contains entity classes
  • Represents the business domain
  • Framework-agnostic

5. EGU.Flow.Core

Type: Class Library

A centralized location for cross-cutting concerns and shared definitions used across multiple projects.

Contains:

  • Data Transfer Objects (DTOs)
  • Interface definitions
  • Enumerations
  • Common constants

6. EGU.Flow.Web

Type: Blazor WebAssembly Standalone

The user interface layer built with Blazor WebAssembly, providing a rich client-side experience that runs entirely in the browser.

Characteristics:

  • Client-side rendering
  • Direct API consumption
  • Component-based architecture
  • Standalone deployment capability

7. EGU.Flow.BusinessLogic

Type: Class Library

This layer encapsulates all business rules, validation logic, and data transformations. It serves as the intermediary between the API layer and the domain layer.

Contains:

  • Service implementations
  • Business rule validation
  • Object mappers (DTOs ↔ Domain models)
  • Transaction coordination


Design Decisions

Separation of Concerns

Each project has a single, well-defined responsibility. This modular approach enables independent testing and deployment, easier maintenance and debugging, team scalability, and reusability across different contexts.

Dependency Flow

The dependency direction ensures that business logic remains independent of presentation concerns, and domain models remain pure without infrastructure dependencies.

Web → ApiServices → BusinessLogic → Domain (with Core shared across layers)

.NET 9 Target

Choosing .NET 9 provides latest performance improvements, modern C# language features, enhanced security updates, and long-term support.


Configuration Management

Root-Level .gitignore

A comprehensive .gitignore file at the solution root handles Visual Studio artifacts, user-specific files, Copilot and IDE-generated files, and build outputs. This ensures a clean repository with only source code tracked.

Swagger Configuration

Swagger/OpenAPI is configured in the ApiServices project to provide interactive API documentation, built-in testing capabilities, client code generation support, and clear API contract definition.


Development Workflow

  1. AppHost orchestrates all services during development
  2. ApiServices receives HTTP requests
  3. BusinessLogic processes requests using domain models
  4. Domain contains the core business entities
  5. Core provides shared contracts across all layers
  6. Web consumes APIs and presents UI to users
  • No labels