Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ COPY --from=builder /app/publish/ .

# Copy metadata docs for container registries (e.g.: GitHub Container Registry)
COPY --chmod=444 README.md ./
COPY --chmod=555 assets/ ./assets/

# https://rules.sonarsource.com/docker/RSPEC-6504/

Expand Down
112 changes: 83 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Proof of Concept for a RESTful API built with .NET 8 (LTS) and ASP.NET Core. Man

## Project Structure

```
```text
src/Dotnet.Samples.AspNetCore.WebApi/
├── Program.cs # Entry point: DI setup, middleware pipeline
├── Controllers/ # HTTP handlers (request/response logic)
Expand Down Expand Up @@ -95,36 +95,90 @@ test/Dotnet.Samples.AspNetCore.WebApi.Tests/

## Architecture

Dependencies flow from data layer through repositories and services to controllers. External dependencies (AutoMapper, FluentValidation, Serilog) integrate at their respective layers.
Dependencies flow from data layer through repositories and services to controllers. External dependencies (AutoMapper, FluentValidation, Serilog, Swashbuckle) integrate at their respective layers.

```mermaid
%%{init: {'theme':'base'}}%%
graph TD
Data[Data]:::core --> Models[Models]:::core
Models --> Repositories[Repositories]:::core
Repositories --> Services[Services]:::core
Services --> Controllers[Controllers]:::core
Controllers --> Program[Program]:::core

Validators[Validators]:::core --> Controllers
Mappings[Mappings]:::core --> Services

AutoMapper[AutoMapper]:::external --> Mappings
FluentValidation[FluentValidation]:::external --> Validators
Serilog[Serilog]:::external --> Program

Configurations[Configurations]:::infrastructure --> Program
SwaggerUI[SwaggerUI]:::infrastructure --> Controllers
MemoryCache[MemoryCache]:::infrastructure --> Services
Migrations[Migrations]:::infrastructure --> Repositories

Controllers --> Tests[Tests]:::testing
Services --> Tests

classDef core fill:#cfe4ff,stroke:#333333,stroke-width:2px,color:#000
classDef external fill:#ffd9d9,stroke:#333333,stroke-width:2px,color:#000
classDef infrastructure fill:#fcfcca,stroke:#333333,stroke-width:2px,color:#000
classDef testing fill:#c3f7c8,stroke:#333333,stroke-width:2px,color:#000
%%{init: {
"theme": "default",
"themeVariables": {
"fontFamily": "Fira Code, Consolas, monospace",
"textColor": "#555",
"lineColor": "#555",
"clusterBkg": "#f5f5f5",
"clusterBorder": "#ddd"
}
}}%%
graph LR
%% Layer 1: Data
Data[Data]

%% Layer 2: Models
Models[Models]

%% Layer 3: Repositories
Repositories[Repositories]

%% Layer 4: Services
subgraph Layer4[" "]
Services[Services]
Mappings[Mappings]
AutoMapper[AutoMapper]
MemoryCache[MemoryCache]
end

%% Layer 5: Controllers
subgraph Layer5[" "]
Controllers[Controllers]
Validators[Validators]
FluentValidation[FluentValidation]
Swashbuckle[Swashbuckle]
end

%% Layer 6: Program
subgraph Layer6[" "]
Program[Program]
Configurations[Configurations]
Serilog[Serilog]
end

%% Tests (separate)
Tests[Tests]

%% Main Application Flow
Data --> Models
Models --> Repositories
Repositories --> Services
Services --> Controllers
Controllers --> Program

%% Layer connections
Validators --> Controllers
Mappings --> Services

%% External Dependencies connections
AutoMapper --> Mappings
FluentValidation --> Validators
Serilog --> Program
Swashbuckle --> Controllers

%% Supporting Features connections
Configurations --> Program
MemoryCache --> Services

%% Tests connections
Controllers -.-> Tests
Services -.-> Tests

%% Node styling with stroke-width
classDef core fill:#b3d9ff,stroke:#6db1ff,stroke-width:2px,color:#555,font-family:monospace;
classDef deps fill:#ffcccc,stroke:#ff8f8f,stroke-width:2px,color:#555,font-family:monospace;
classDef test fill:#ccffcc,stroke:#53c45e,stroke-width:2px,color:#555,font-family:monospace;
classDef feat fill:#ffffcc,stroke:#fdce15,stroke-width:2px,color:#555,font-family:monospace;

class Data,Models,Repositories,Services,Controllers,Program,Validators,Mappings core;
class AutoMapper,FluentValidation,Serilog,Swashbuckle deps;
class Tests test;
class Configurations,MemoryCache feat;
```

*Layered architecture: Core application flow (blue), supporting features (yellow), external dependencies (red), and test coverage (green). Not all dependencies are shown.*
Expand Down
1 change: 0 additions & 1 deletion assets/images/Structure.svg

This file was deleted.

Binary file removed assets/images/Swagger.png
Binary file not shown.