# fcakiroglu16/aspnetcore-mvc-course architecture

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

- Interactive diagram: https://gitdiagram.com/fcakiroglu16/aspnetcore-mvc-course
- Repository: https://github.com/fcakiroglu16/aspnetcore-mvc-course

## Overview

This repository contains two ASP.NET Core MVC teaching applications. The main app’s core workflow is an HTTP request routed to a controller, which validates/maps product or visitor input, reads or writes through EF Core, and returns a view or redirect; filters add cross-cutting behavior. The second app isolates IP-whitelist middleware. The README documents additional category, cookie, AJAX, configuration, session, and Razor capabilities, but their detailed wiring is not established by the sampled source. Dashed links mark those documentation-level or unverified integrations.

Main entry points: [`MyAspNetCoreApp.Web/Program.cs`](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Program.cs) (MVC request pipeline), [`MyAspNetCoreApp.Web/Models/AppDbContext.cs`](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/AppDbContext.cs) (EF context), [`MyAspNetCoreApp.Web/Controllers/ProductsController.cs`](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/ProductsController.cs) (Product actions), [`MyAspNetCoreApp.Web/Controllers/HomeController.cs`](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/HomeController.cs) (Home actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_main["Main MVC app"]
  node_mainruntime["MVC request pipeline<br/>[Program.cs]"]
  node_home["Home actions<br/>[HomeController.cs]"]
  node_visitors["Visitor AJAX"]
  node_cookies["Cookie actions"]
  node_settings["App settings"]
end

subgraph group_catalog["Catalog and data"]
  node_products["Product actions"]
  node_categories["Category actions"]
  node_dbcontext["EF context<br/>[AppDbContext.cs]"]
  node_sql[("SQL Server")]
  node_product["Product entity<br/>[Product.cs]"]
  node_category["Category entity<br/>[Category.cs]"]
  node_visitor["Visitor entity<br/>[Visitor.cs]"]
  node_productvm["Product view models"]
  node_updatevm["Product update model"]
  node_visitorvm["Visitor view model"]
  node_mapping["View-model mapping"]
  node_categorycap["Category management"]
end

subgraph group_crosscut["Filters and services"]
  node_notfound["Missing-item filter<br/>[NotFoundFilter.cs]"]
  node_filters["MVC filters<br/>[Filters]"]
  node_helper["Helper service<br/>[Helper.cs]"]
end

subgraph group_middleware["Middleware sample"]
  node_middlewareprogram["Middleware pipeline<br/>[Program.cs]"]
  node_whitelist["IP whitelist"]
  node_middlewarehome["Sample home actions<br/>[HomeController.cs]"]
end

node_browser(("HTTP user"))
node_middlewareuser(("HTTP client"))

node_browser -->|"sends request"| node_mainruntime
node_mainruntime -.->|"routes to"| node_home
node_mainruntime -.->|"routes to"| node_products
node_mainruntime -.->|"routes to"| node_categories
node_mainruntime -.->|"routes to"| node_cookies
node_mainruntime -.->|"routes to"| node_settings
node_home -->|"queries"| node_dbcontext
node_home -->|"creates"| node_visitor
node_home -->|"maps input"| node_visitorvm
node_home -->|"uses filters"| node_filters
node_products -->|"reads and writes"| node_dbcontext
node_products -->|"binds and returns"| node_productvm
node_products -->|"binds and returns"| node_updatevm
node_products -->|"maps entities"| node_mapping
node_products -->|"applies filter"| node_notfound
node_categories -->|"reads and writes"| node_dbcontext
node_visitors -->|"reads and writes"| node_dbcontext
node_visitors -->|"uses model"| node_visitorvm
node_dbcontext -->|"stores"| node_product
node_dbcontext -->|"stores"| node_category
node_dbcontext -->|"stores"| node_visitor
node_dbcontext -.->|"persists via EF"| node_sql
node_mainruntime -->|"configures"| node_dbcontext
node_mainruntime -->|"registers service"| node_helper
node_mainruntime -->|"registers filter"| node_notfound
node_browser -->|"sends request"| node_middlewareprogram
node_middlewareprogram -->|"registers middleware"| node_whitelist
node_middlewareprogram -.->|"routes to"| node_middlewarehome
node_middlewareuser -->|"sends request"| node_middlewareprogram

click node_mainruntime "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Program.cs"
click node_home "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/HomeController.cs"
click node_products "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/ProductsController.cs"
click node_categories "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/CategoriesController.cs"
click node_visitors "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/VisitorAjaxController.cs"
click node_cookies "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/CookieController.cs"
click node_settings "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/AppSettingController.cs"
click node_dbcontext "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/AppDbContext.cs"
click node_product "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/Product.cs"
click node_category "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/Category.cs"
click node_visitor "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/Visitor.cs"
click node_productvm "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/ViewModels/ProductViewModel.cs"
click node_updatevm "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/ViewModels/ProductUpdateViewModel.cs"
click node_visitorvm "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/ViewModels/VisitorViewModel.cs"
click node_mapping "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Mapping/ViewModelMapping.cs"
click node_notfound "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Filters/NotFoundFilter.cs"
click node_filters "https://github.com/fcakiroglu16/aspnetcore-mvc-course/tree/master/MyAspNetCoreApp.Web/Filters"
click node_helper "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Helpers/Helper.cs"
click node_categorycap "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/CategoriesController.cs"
click node_middlewareprogram "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MiddlewareExample.Web/Program.cs"
click node_whitelist "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MiddlewareExample.Web/Middlewares/WhiteIpAddressControlMiddleware.cs"
click node_middlewarehome "https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MiddlewareExample.Web/Controllers/HomeController.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_mainruntime,node_home,node_visitors,node_cookies,node_settings,node_browser,node_middlewareuser toneBlue
class node_products,node_categories,node_dbcontext,node_sql,node_product,node_category,node_visitor,node_productvm,node_updatevm,node_visitorvm,node_mapping,node_categorycap toneAmber
class node_notfound,node_filters,node_helper toneMint
class node_middlewareprogram,node_whitelist,node_middlewarehome toneRose
```

## Components

### Main MVC app

- [MVC request pipeline](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Program.cs): `MyAspNetCoreApp.Web/Program.cs`
- [Home actions](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/HomeController.cs): `MyAspNetCoreApp.Web/Controllers/HomeController.cs`
- [Visitor AJAX](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/VisitorAjaxController.cs): `MyAspNetCoreApp.Web/Controllers/VisitorAjaxController.cs`
- [Cookie actions](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/CookieController.cs): `MyAspNetCoreApp.Web/Controllers/CookieController.cs`
- [App settings](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/AppSettingController.cs): `MyAspNetCoreApp.Web/Controllers/AppSettingController.cs`

### Catalog and data

- [Product actions](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/ProductsController.cs): `MyAspNetCoreApp.Web/Controllers/ProductsController.cs`
- [Category actions](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/CategoriesController.cs): `MyAspNetCoreApp.Web/Controllers/CategoriesController.cs`
- [EF context](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/AppDbContext.cs): `MyAspNetCoreApp.Web/Models/AppDbContext.cs`
- **SQL Server**
- [Product entity](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/Product.cs): `MyAspNetCoreApp.Web/Models/Product.cs`
- [Category entity](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/Category.cs): `MyAspNetCoreApp.Web/Models/Category.cs`
- [Visitor entity](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Models/Visitor.cs): `MyAspNetCoreApp.Web/Models/Visitor.cs`
- [Product view models](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/ViewModels/ProductViewModel.cs): `MyAspNetCoreApp.Web/ViewModels/ProductViewModel.cs`
- [Product update model](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/ViewModels/ProductUpdateViewModel.cs): `MyAspNetCoreApp.Web/ViewModels/ProductUpdateViewModel.cs`
- [Visitor view model](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/ViewModels/VisitorViewModel.cs): `MyAspNetCoreApp.Web/ViewModels/VisitorViewModel.cs`
- [View-model mapping](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Mapping/ViewModelMapping.cs): `MyAspNetCoreApp.Web/Mapping/ViewModelMapping.cs`
- [Category management](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Controllers/CategoriesController.cs): `MyAspNetCoreApp.Web/Controllers/CategoriesController.cs`

### Filters and services

- [Missing-item filter](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Filters/NotFoundFilter.cs): `MyAspNetCoreApp.Web/Filters/NotFoundFilter.cs`
- [MVC filters](https://github.com/fcakiroglu16/aspnetcore-mvc-course/tree/master/MyAspNetCoreApp.Web/Filters): `MyAspNetCoreApp.Web/Filters`
- [Helper service](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MyAspNetCoreApp.Web/Helpers/Helper.cs): `MyAspNetCoreApp.Web/Helpers/Helper.cs`

### Middleware sample

- [Middleware pipeline](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MiddlewareExample.Web/Program.cs): `MiddlewareExample.Web/Program.cs`
- [IP whitelist](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MiddlewareExample.Web/Middlewares/WhiteIpAddressControlMiddleware.cs): `MiddlewareExample.Web/Middlewares/WhiteIpAddressControlMiddleware.cs`
- [Sample home actions](https://github.com/fcakiroglu16/aspnetcore-mvc-course/blob/master/MiddlewareExample.Web/Controllers/HomeController.cs): `MiddlewareExample.Web/Controllers/HomeController.cs`

### Other components

- **HTTP user**
- **HTTP client**

## Connections

- HTTP user → MVC request pipeline: sends request (evidence: `MyAspNetCoreApp.Web/Program.cs`)
- MVC request pipeline → Home actions: routes to (evidence: `MyAspNetCoreApp.Web/Program.cs`)
- MVC request pipeline → Product actions: routes to (evidence: `MyAspNetCoreApp.Web/Program.cs`)
- MVC request pipeline → Category actions: routes to (evidence: `README.md`)
- MVC request pipeline → Cookie actions: routes to (evidence: `README.md`)
- MVC request pipeline → App settings: routes to (evidence: `README.md`)
- Home actions → EF context: queries (evidence: `MyAspNetCoreApp.Web/Controllers/HomeController.cs`)
- Home actions → Visitor entity: creates (evidence: `MyAspNetCoreApp.Web/Controllers/HomeController.cs`)
- Home actions → Visitor view model: maps input (evidence: `MyAspNetCoreApp.Web/Controllers/HomeController.cs`)
- Home actions → MVC filters: uses filters (evidence: `MyAspNetCoreApp.Web/Controllers/HomeController.cs`)
- Product actions → EF context: reads and writes (evidence: `MyAspNetCoreApp.Web/Controllers/ProductsController.cs`)
- Product actions → Product view models: binds and returns (evidence: `MyAspNetCoreApp.Web/Controllers/ProductsController.cs`)
- Product actions → Product update model: binds and returns (evidence: `MyAspNetCoreApp.Web/Controllers/ProductsController.cs`)
- Product actions → View-model mapping: maps entities (evidence: `MyAspNetCoreApp.Web/Controllers/ProductsController.cs`)
- Product actions → Missing-item filter: applies filter (evidence: `MyAspNetCoreApp.Web/Controllers/ProductsController.cs`)
- Category actions → EF context: reads and writes (evidence: `MyAspNetCoreApp.Web/Controllers/CategoriesController.cs`)
- Visitor AJAX → EF context: reads and writes (evidence: `MyAspNetCoreApp.Web/Controllers/VisitorAjaxController.cs`)
- Visitor AJAX → Visitor view model: uses model (evidence: `MyAspNetCoreApp.Web/Controllers/VisitorAjaxController.cs`)
- EF context → Product entity: stores (evidence: `MyAspNetCoreApp.Web/Models/AppDbContext.cs`)
- EF context → Category entity: stores (evidence: `MyAspNetCoreApp.Web/Models/AppDbContext.cs`)
- EF context → Visitor entity: stores (evidence: `MyAspNetCoreApp.Web/Models/AppDbContext.cs`)
- EF context → SQL Server: persists via EF
- MVC request pipeline → EF context: configures (evidence: `MyAspNetCoreApp.Web/Program.cs`)
- MVC request pipeline → Helper service: registers service (evidence: `MyAspNetCoreApp.Web/Program.cs`)
- MVC request pipeline → Missing-item filter: registers filter (evidence: `MyAspNetCoreApp.Web/Program.cs`)
- HTTP user → Middleware pipeline: sends request (evidence: `MiddlewareExample.Web/Program.cs`)
- Middleware pipeline → IP whitelist: registers middleware (evidence: `MiddlewareExample.Web/Program.cs`)
- Middleware pipeline → Sample home actions: routes to (evidence: `README.md`)
- HTTP client → Middleware pipeline: sends request (evidence: `MiddlewareExample.Web/Program.cs`)
