# harsha-global/aspnetcore-harsha architecture

> Architecture diagram of the GitHub repository harsha-global/aspnetcore-harsha, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harsha-global/aspnetcore-harsha
- Repository: https://github.com/harsha-global/aspnetcore-harsha

## Overview

This repository is a chapter-by-chapter collection of ASP.NET Core teaching examples, not one deployable application. Its representative web workflow is an HTTP request handled through middleware and routing, then an endpoint/controller produces a response or rendered view. The tree also documents substantial lessons on model binding and validation, Razor composition, dependency injection, logging, filters, and identity/authorization. Most application source was not sampled, and the README only identifies the repository as source code, so workflow links below are dashed and unverified rather than asserted as observed calls.

Main entry points: [`02. HTTP/03. HTTP Request/MyFirstApp/Program.cs`](https://github.com/harsha-global/aspnetcore-harsha/blob/main/02.%20HTTP/03.%20HTTP%20Request/MyFirstApp/Program.cs) (HTTP basics), [`03. Middleware/03. Custom Middleware Class/MiddlewareExample/Program.cs`](https://github.com/harsha-global/aspnetcore-harsha/blob/main/03.%20Middleware/03.%20Custom%20Middleware%20Class/MiddlewareExample/Program.cs) (Middleware), [`04. Routing/02. Map, MapGet, MapPost/RoutingExample/Program.cs`](https://github.com/harsha-global/aspnetcore-harsha/blob/main/04.%20Routing/02.%20Map%2C%20MapGet%2C%20MapPost/RoutingExample/Program.cs) (Endpoint routing), [`05. Controllers & IActionResult/01. Creating Controllers/ControllersExample/Controllers/HomeController.cs`](https://github.com/harsha-global/aspnetcore-harsha/blob/main/05.%20Controllers%20%26%20IActionResult/01.%20Creating%20Controllers/ControllersExample/Controllers/HomeController.cs) (MVC controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web fundamentals"]
  node_http["HTTP basics<br/>[Program.cs]"]
  node_middleware["Middleware<br/>[Program.cs]"]
  node_routing["Endpoint routing<br/>[Program.cs]"]
  node_staticfiles["Static files<br/>[Program.cs]"]
end

subgraph group_mvc["MVC and views"]
  node_controllers["MVC controllers<br/>[HomeController.cs]"]
  node_results["Action results<br/>[HomeController.cs]"]
  node_binding["Model binding"]
  node_validation["Model validation"]
  node_razor["Razor views<br/>[HomeController.cs]"]
  node_layouts["View layouts<br/>[HomeController.cs]"]
  node_partials["Partial views<br/>[HomeController.cs]"]
end

subgraph group_platform["Application services"]
  node_di["Dependency injection<br/>[Program.cs]"]
  node_logging["Logging"]
  node_filters["MVC filters"]
end

subgraph group_security["Identity and security"]
  node_identity["Identity and roles"]
  node_authorization["Authorization policies"]
  node_csrf["XSRF protection"]
end

node_visitor(("HTTP client"))

node_visitor -.->|"sends request"| node_http
node_http -.->|"enters pipeline"| node_middleware
node_middleware -.->|"reaches endpoints"| node_routing
node_routing -.->|"selects endpoint"| node_controllers
node_controllers -.->|"returns result"| node_results
node_results -.->|"sends response"| node_visitor

click node_http "https://github.com/harsha-global/aspnetcore-harsha/blob/main/02.%20HTTP/03.%20HTTP%20Request/MyFirstApp/Program.cs"
click node_middleware "https://github.com/harsha-global/aspnetcore-harsha/blob/main/03.%20Middleware/03.%20Custom%20Middleware%20Class/MiddlewareExample/Program.cs"
click node_routing "https://github.com/harsha-global/aspnetcore-harsha/blob/main/04.%20Routing/02.%20Map%2C%20MapGet%2C%20MapPost/RoutingExample/Program.cs"
click node_staticfiles "https://github.com/harsha-global/aspnetcore-harsha/blob/main/04.%20Routing/11.%20WebRoot%20and%20UseStaticFiles/RoutingExample/Program.cs"
click node_controllers "https://github.com/harsha-global/aspnetcore-harsha/blob/main/05.%20Controllers%20%26%20IActionResult/01.%20Creating%20Controllers/ControllersExample/Controllers/HomeController.cs"
click node_results "https://github.com/harsha-global/aspnetcore-harsha/blob/main/05.%20Controllers%20%26%20IActionResult/05.%20IActionResult/IActionResultExample/Controllers/HomeController.cs"
click node_binding "https://github.com/harsha-global/aspnetcore-harsha/blob/main/06.%20Model%20Binding%20and%20Validations/14.%20Custom%20Model%20Binders/ModelValidationsExample/CustomModelBinders/PersonModelBinder.cs"
click node_validation "https://github.com/harsha-global/aspnetcore-harsha/blob/main/06.%20Model%20Binding%20and%20Validations/09.%20Custom%20Validation%20with%20Multiple%20Properties/ModelValidationsExample/CustomValidators/DateRangeValidatorAttribute.cs"
click node_razor "https://github.com/harsha-global/aspnetcore-harsha/blob/main/07.%20Razor%20Views/12.%20Strongly%20Typed%20Views/ViewsExample/Controllers/HomeController.cs"
click node_layouts "https://github.com/harsha-global/aspnetcore-harsha/blob/main/08.%20Layout%20Views/01.%20Creating%20Layout%20Views/LayoutViewsExample/Controllers/HomeController.cs"
click node_partials "https://github.com/harsha-global/aspnetcore-harsha/blob/main/09.%20Partial%20Views/01.%20Creating%20Partial%20Views/PartialViewsExample/Controllers/HomeController.cs"
click node_di "https://github.com/harsha-global/aspnetcore-harsha/blob/main/11.%20Dependency%20Injection/01.%20Services/DIExample/Program.cs"
click node_logging "https://github.com/harsha-global/aspnetcore-harsha/blob/main/19.%20Logging/01.%20ILogger/CRUDTests/PersonsControllerTest.cs"
click node_filters "https://github.com/harsha-global/aspnetcore-harsha/blob/main/20.%20Filters/01.%20Action%20Filter/CRUDTests/PersonsControllerTest.cs"
click node_identity "https://github.com/harsha-global/aspnetcore-harsha/blob/main/24.%20Identity%20and%20Authorization/14.%20User%20Roles/ContactsManager.ControllerTests/PersonsControllerTest.cs"
click node_authorization "https://github.com/harsha-global/aspnetcore-harsha/blob/main/24.%20Identity%20and%20Authorization/17.%20Custom%20Authorization%20Policies/ContactsManager.ControllerTests/PersonsControllerTest.cs"
click node_csrf "https://github.com/harsha-global/aspnetcore-harsha/blob/main/24.%20Identity%20and%20Authorization/19.%20XSRF/ContactsManager.ControllerTests/PersonsControllerTest.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_http,node_middleware,node_routing,node_staticfiles,node_visitor toneBlue
class node_controllers,node_results,node_binding,node_validation,node_razor,node_layouts,node_partials toneAmber
class node_di,node_logging,node_filters toneMint
class node_identity,node_authorization,node_csrf toneRose
```

## Components

### Web fundamentals

- [HTTP basics](https://github.com/harsha-global/aspnetcore-harsha/blob/main/02.%20HTTP/03.%20HTTP%20Request/MyFirstApp/Program.cs): `02. HTTP/03. HTTP Request/MyFirstApp/Program.cs`
- [Middleware](https://github.com/harsha-global/aspnetcore-harsha/blob/main/03.%20Middleware/03.%20Custom%20Middleware%20Class/MiddlewareExample/Program.cs): `03. Middleware/03. Custom Middleware Class/MiddlewareExample/Program.cs`
- [Endpoint routing](https://github.com/harsha-global/aspnetcore-harsha/blob/main/04.%20Routing/02.%20Map%2C%20MapGet%2C%20MapPost/RoutingExample/Program.cs): `04. Routing/02. Map, MapGet, MapPost/RoutingExample/Program.cs`
- [Static files](https://github.com/harsha-global/aspnetcore-harsha/blob/main/04.%20Routing/11.%20WebRoot%20and%20UseStaticFiles/RoutingExample/Program.cs): `04. Routing/11. WebRoot and UseStaticFiles/RoutingExample/Program.cs`

### MVC and views

- [MVC controllers](https://github.com/harsha-global/aspnetcore-harsha/blob/main/05.%20Controllers%20%26%20IActionResult/01.%20Creating%20Controllers/ControllersExample/Controllers/HomeController.cs): `05. Controllers & IActionResult/01. Creating Controllers/ControllersExample/Controllers/HomeController.cs`
- [Action results](https://github.com/harsha-global/aspnetcore-harsha/blob/main/05.%20Controllers%20%26%20IActionResult/05.%20IActionResult/IActionResultExample/Controllers/HomeController.cs): `05. Controllers & IActionResult/05. IActionResult/IActionResultExample/Controllers/HomeController.cs`
- [Model binding](https://github.com/harsha-global/aspnetcore-harsha/blob/main/06.%20Model%20Binding%20and%20Validations/14.%20Custom%20Model%20Binders/ModelValidationsExample/CustomModelBinders/PersonModelBinder.cs): `06. Model Binding and Validations/14. Custom Model Binders/ModelValidationsExample/CustomModelBinders/PersonModelBinder.cs`
- [Model validation](https://github.com/harsha-global/aspnetcore-harsha/blob/main/06.%20Model%20Binding%20and%20Validations/09.%20Custom%20Validation%20with%20Multiple%20Properties/ModelValidationsExample/CustomValidators/DateRangeValidatorAttribute.cs): `06. Model Binding and Validations/09. Custom Validation with Multiple Properties/ModelValidationsExample/CustomValidators/DateRangeValidatorAttribute.cs`
- [Razor views](https://github.com/harsha-global/aspnetcore-harsha/blob/main/07.%20Razor%20Views/12.%20Strongly%20Typed%20Views/ViewsExample/Controllers/HomeController.cs): `07. Razor Views/12. Strongly Typed Views/ViewsExample/Controllers/HomeController.cs`
- [View layouts](https://github.com/harsha-global/aspnetcore-harsha/blob/main/08.%20Layout%20Views/01.%20Creating%20Layout%20Views/LayoutViewsExample/Controllers/HomeController.cs): `08. Layout Views/01. Creating Layout Views/LayoutViewsExample/Controllers/HomeController.cs`
- [Partial views](https://github.com/harsha-global/aspnetcore-harsha/blob/main/09.%20Partial%20Views/01.%20Creating%20Partial%20Views/PartialViewsExample/Controllers/HomeController.cs): `09. Partial Views/01. Creating Partial Views/PartialViewsExample/Controllers/HomeController.cs`

### Application services

- [Dependency injection](https://github.com/harsha-global/aspnetcore-harsha/blob/main/11.%20Dependency%20Injection/01.%20Services/DIExample/Program.cs): `11. Dependency Injection/01. Services/DIExample/Program.cs`
- [Logging](https://github.com/harsha-global/aspnetcore-harsha/blob/main/19.%20Logging/01.%20ILogger/CRUDTests/PersonsControllerTest.cs): `19. Logging/01. ILogger/CRUDTests/PersonsControllerTest.cs`
- [MVC filters](https://github.com/harsha-global/aspnetcore-harsha/blob/main/20.%20Filters/01.%20Action%20Filter/CRUDTests/PersonsControllerTest.cs): `20. Filters/01. Action Filter/CRUDTests/PersonsControllerTest.cs`

### Identity and security

- [Identity and roles](https://github.com/harsha-global/aspnetcore-harsha/blob/main/24.%20Identity%20and%20Authorization/14.%20User%20Roles/ContactsManager.ControllerTests/PersonsControllerTest.cs): `24. Identity and Authorization/14. User Roles/ContactsManager.ControllerTests/PersonsControllerTest.cs`
- [Authorization policies](https://github.com/harsha-global/aspnetcore-harsha/blob/main/24.%20Identity%20and%20Authorization/17.%20Custom%20Authorization%20Policies/ContactsManager.ControllerTests/PersonsControllerTest.cs): `24. Identity and Authorization/17. Custom Authorization Policies/ContactsManager.ControllerTests/PersonsControllerTest.cs`
- [XSRF protection](https://github.com/harsha-global/aspnetcore-harsha/blob/main/24.%20Identity%20and%20Authorization/19.%20XSRF/ContactsManager.ControllerTests/PersonsControllerTest.cs): `24. Identity and Authorization/19. XSRF/ContactsManager.ControllerTests/PersonsControllerTest.cs`

### Other components

- **HTTP client**

## Connections

- HTTP client → HTTP basics: sends request
- HTTP basics → Middleware: enters pipeline
- Middleware → Endpoint routing: reaches endpoints
- Endpoint routing → MVC controllers: selects endpoint
- MVC controllers → Action results: returns result
- Action results → HTTP client: sends response
