@@ -58,7 +58,7 @@ Proof of Concept for a RESTful API built with .NET 8 (LTS) and ASP.NET Core. Man
5858
5959## Project Structure
6060
61- ```
61+ ``` text
6262src/Dotnet.Samples.AspNetCore.WebApi/
6363├── Program.cs # Entry point: DI setup, middleware pipeline
6464├── Controllers/ # HTTP handlers (request/response logic)
@@ -95,36 +95,90 @@ test/Dotnet.Samples.AspNetCore.WebApi.Tests/
9595
9696## Architecture
9797
98- Dependencies flow from data layer through repositories and services to controllers. External dependencies (AutoMapper, FluentValidation, Serilog) integrate at their respective layers.
98+ Dependencies flow from data layer through repositories and services to controllers. External dependencies (AutoMapper, FluentValidation, Serilog, Swashbuckle ) integrate at their respective layers.
9999
100100``` mermaid
101- %%{init: {'theme':'base'}}%%
102- graph TD
103- Data[Data]:::core --> Models[Models]:::core
104- Models --> Repositories[Repositories]:::core
105- Repositories --> Services[Services]:::core
106- Services --> Controllers[Controllers]:::core
107- Controllers --> Program[Program]:::core
108-
109- Validators[Validators]:::core --> Controllers
110- Mappings[Mappings]:::core --> Services
111-
112- AutoMapper[AutoMapper]:::external --> Mappings
113- FluentValidation[FluentValidation]:::external --> Validators
114- Serilog[Serilog]:::external --> Program
115-
116- Configurations[Configurations]:::infrastructure --> Program
117- SwaggerUI[SwaggerUI]:::infrastructure --> Controllers
118- MemoryCache[MemoryCache]:::infrastructure --> Services
119- Migrations[Migrations]:::infrastructure --> Repositories
120-
121- Controllers --> Tests[Tests]:::testing
122- Services --> Tests
123-
124- classDef core fill:#cfe4ff,stroke:#333333,stroke-width:2px,color:#000
125- classDef external fill:#ffd9d9,stroke:#333333,stroke-width:2px,color:#000
126- classDef infrastructure fill:#fcfcca,stroke:#333333,stroke-width:2px,color:#000
127- classDef testing fill:#c3f7c8,stroke:#333333,stroke-width:2px,color:#000
101+ %%{init: {
102+ "theme": "default",
103+ "themeVariables": {
104+ "fontFamily": "Fira Code, Consolas, monospace",
105+ "textColor": "#555",
106+ "lineColor": "#555",
107+ "clusterBkg": "#f5f5f5",
108+ "clusterBorder": "#ddd"
109+ }
110+ }}%%
111+ graph LR
112+ %% Layer 1: Data
113+ Data[Data]
114+
115+ %% Layer 2: Models
116+ Models[Models]
117+
118+ %% Layer 3: Repositories
119+ Repositories[Repositories]
120+
121+ %% Layer 4: Services
122+ subgraph Layer4[" "]
123+ Services[Services]
124+ Mappings[Mappings]
125+ AutoMapper[AutoMapper]
126+ MemoryCache[MemoryCache]
127+ end
128+
129+ %% Layer 5: Controllers
130+ subgraph Layer5[" "]
131+ Controllers[Controllers]
132+ Validators[Validators]
133+ FluentValidation[FluentValidation]
134+ Swashbuckle[Swashbuckle]
135+ end
136+
137+ %% Layer 6: Program
138+ subgraph Layer6[" "]
139+ Program[Program]
140+ Configurations[Configurations]
141+ Serilog[Serilog]
142+ end
143+
144+ %% Tests (separate)
145+ Tests[Tests]
146+
147+ %% Main Application Flow
148+ Data --> Models
149+ Models --> Repositories
150+ Repositories --> Services
151+ Services --> Controllers
152+ Controllers --> Program
153+
154+ %% Layer connections
155+ Validators --> Controllers
156+ Mappings --> Services
157+
158+ %% External Dependencies connections
159+ AutoMapper --> Mappings
160+ FluentValidation --> Validators
161+ Serilog --> Program
162+ Swashbuckle --> Controllers
163+
164+ %% Supporting Features connections
165+ Configurations --> Program
166+ MemoryCache --> Services
167+
168+ %% Tests connections
169+ Controllers -.-> Tests
170+ Services -.-> Tests
171+
172+ %% Node styling with stroke-width
173+ classDef core fill:#b3d9ff,stroke:#6db1ff,stroke-width:2px,color:#555,font-family:monospace;
174+ classDef deps fill:#ffcccc,stroke:#ff8f8f,stroke-width:2px,color:#555,font-family:monospace;
175+ classDef test fill:#ccffcc,stroke:#53c45e,stroke-width:2px,color:#555,font-family:monospace;
176+ classDef feat fill:#ffffcc,stroke:#fdce15,stroke-width:2px,color:#555,font-family:monospace;
177+
178+ class Data,Models,Repositories,Services,Controllers,Program,Validators,Mappings core;
179+ class AutoMapper,FluentValidation,Serilog,Swashbuckle deps;
180+ class Tests test;
181+ class Configurations,MemoryCache feat;
128182```
129183
130184* Layered architecture: Core application flow (blue), supporting features (yellow), external dependencies (red), and test coverage (green). Not all dependencies are shown.*
0 commit comments