# fcwey/northwindbackend architecture

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

- Interactive diagram: https://gitdiagram.com/fcwey/northwindbackend
- Repository: https://github.com/fcwey/northwindbackend

## Overview

This is a layered ASP.NET API for product and category catalog operations, plus user registration, login, and JWT access-token creation. The main flow is an HTTP request through a controller and business service to a data-access abstraction; authentication additionally checks user credentials and issues tokens. EF-backed repositories and a Northwind context provide the persistence layer. Product operations also use validation, caching, logging, performance, and transaction aspects. Connections are limited to relationships visible in excerpts or the source index; some persistence wiring is therefore left unspecified.

Main entry points: [`Business/Concrete/ProductManager.cs`](https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/ProductManager.cs) (Product Manager), [`Business/Concrete/AuthManager.cs`](https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/AuthManager.cs) (Auth Manager), [`DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs`](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs) (Northwind Context), [`WebAPI/Controllers/AuthController.cs`](https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/AuthController.cs) (Auth Controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_auth_controller["Auth Controller<br/>[AuthController.cs]"]
  node_category_controller["Categories Controller"]
  node_product_controller["Products Controller"]
end

subgraph group_business["Business Services"]
  node_auth_service["Auth Service<br/>[IAuthService.cs]"]
  node_auth_manager["Auth Manager<br/>[AuthManager.cs]"]
  node_user_service["User Service<br/>[IUserService.cs]"]
  node_category_service["Category Service"]
  node_category_manager["Category Manager<br/>[CategoryManager.cs]"]
  node_product_service["Product Service<br/>[IProductService.cs]"]
  node_product_manager["Product Manager<br/>[ProductManager.cs]"]
  node_product_validation["Product Validation"]
end

subgraph group_persistence["Data And Domain"]
  node_user_dal["User Data Access<br/>[IUserDal.cs]"]
  node_category_dal["Category Data Access<br/>[ICategoryDal.cs]"]
  node_ef_category["EF Category Access<br/>[EfCategoryDal.cs]"]
  node_product_dal["Product Data Access<br/>[IProductDal.cs]"]
  node_ef_product["EF Product Access<br/>[EfProductDal.cs]"]
  node_ef_user["EF User Access<br/>[EfUserDal.cs]"]
  node_repository["EF Repository"]
  node_context[("Northwind Context")]
  node_catalog_entities["Catalog Entities<br/>[Product.cs]"]
  node_user_entity["User Identity<br/>[User.cs]"]
end

subgraph group_platform["Core Infrastructure"]
  node_token_helper["JWT Token Helper<br/>[JwtHelper.cs]"]
  node_cache_aspect["Cache Aspect<br/>[CacheAspect.cs]"]
  node_cache_remove["Cache Invalidation"]
  node_logging_aspect["Logging Aspect<br/>[LogAspect.cs]"]
  node_performance_aspect["Performance Aspect"]
  node_transaction_aspect["Transaction Aspect"]
end

node_client(("API Client"))

node_client -.->|"sends request"| node_auth_controller
node_client -.->|"sends request"| node_category_controller
node_client -.->|"sends request"| node_product_controller
node_auth_controller -->|"calls"| node_auth_service
node_category_controller -->|"calls"| node_category_service
node_product_controller -->|"calls"| node_product_service
node_auth_manager -->|"checks users"| node_user_service
node_auth_manager -->|"creates token"| node_token_helper
node_category_manager -->|"calls"| node_category_dal
node_product_manager -->|"calls"| node_product_dal
node_product_manager -->|"validates with"| node_product_validation
node_product_manager -->|"uses aspect"| node_cache_aspect
node_product_manager -->|"uses aspect"| node_cache_remove
node_product_manager -->|"uses aspect"| node_logging_aspect
node_product_manager -->|"uses aspect"| node_performance_aspect
node_product_manager -->|"uses aspect"| node_transaction_aspect
node_category_dal -->|"implemented by"| node_ef_category
node_product_dal -->|"implemented by"| node_ef_product
node_user_dal -->|"implemented by"| node_ef_user
node_context -->|"maps entities"| node_catalog_entities
node_context -->|"maps entities"| node_user_entity

click node_auth_controller "https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/AuthController.cs"
click node_category_controller "https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/CategoriesController.cs"
click node_product_controller "https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/ProductsController.cs"
click node_auth_service "https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/IAuthService.cs"
click node_auth_manager "https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/AuthManager.cs"
click node_user_service "https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/IUserService.cs"
click node_category_service "https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/ICategoryService.cs"
click node_category_manager "https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/CategoryManager.cs"
click node_product_service "https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/IProductService.cs"
click node_product_manager "https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/ProductManager.cs"
click node_product_validation "https://github.com/fcwey/northwindbackend/blob/master/Business/ValidationRules/FluentValidation/ProductValidator.cs"
click node_user_dal "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Abstract/IUserDal.cs"
click node_category_dal "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Abstract/ICategoryDal.cs"
click node_ef_category "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/EfCategoryDal.cs"
click node_product_dal "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Abstract/IProductDal.cs"
click node_ef_product "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/EfProductDal.cs"
click node_ef_user "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/EfUserDal.cs"
click node_repository "https://github.com/fcwey/northwindbackend/blob/master/Core/DataAccess/EntityFramework/EfEntityRepositoryBase.cs"
click node_context "https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs"
click node_catalog_entities "https://github.com/fcwey/northwindbackend/blob/master/Entities/Concrete/Product.cs"
click node_user_entity "https://github.com/fcwey/northwindbackend/blob/master/Core/Entities/Concrate/User.cs"
click node_token_helper "https://github.com/fcwey/northwindbackend/blob/master/Core/Utilities/Security/Jwt/JwtHelper.cs"
click node_cache_aspect "https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Caching/CacheAspect.cs"
click node_cache_remove "https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Caching/CacheRemoveAspect.cs"
click node_logging_aspect "https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Logging/LogAspect.cs"
click node_performance_aspect "https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Performance/PerformanceAspect.cs"
click node_transaction_aspect "https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Transaction/TransactionScopeAspect.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_auth_controller,node_category_controller,node_product_controller,node_client toneBlue
class node_auth_service,node_auth_manager,node_user_service,node_category_service,node_category_manager,node_product_service,node_product_manager,node_product_validation toneAmber
class node_user_dal,node_category_dal,node_ef_category,node_product_dal,node_ef_product,node_ef_user,node_repository,node_context,node_catalog_entities,node_user_entity toneMint
class node_token_helper,node_cache_aspect,node_cache_remove,node_logging_aspect,node_performance_aspect,node_transaction_aspect toneRose
```

## Components

### HTTP API

- [Auth Controller](https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/AuthController.cs): `WebAPI/Controllers/AuthController.cs`
- [Categories Controller](https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/CategoriesController.cs): `WebAPI/Controllers/CategoriesController.cs`
- [Products Controller](https://github.com/fcwey/northwindbackend/blob/master/WebAPI/Controllers/ProductsController.cs): `WebAPI/Controllers/ProductsController.cs`

### Business Services

- [Auth Service](https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/IAuthService.cs): `Business/Abstract/IAuthService.cs`
- [Auth Manager](https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/AuthManager.cs): `Business/Concrete/AuthManager.cs`
- [User Service](https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/IUserService.cs): `Business/Abstract/IUserService.cs`
- [Category Service](https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/ICategoryService.cs): `Business/Abstract/ICategoryService.cs`
- [Category Manager](https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/CategoryManager.cs): `Business/Concrete/CategoryManager.cs`
- [Product Service](https://github.com/fcwey/northwindbackend/blob/master/Business/Abstract/IProductService.cs): `Business/Abstract/IProductService.cs`
- [Product Manager](https://github.com/fcwey/northwindbackend/blob/master/Business/Concrete/ProductManager.cs): `Business/Concrete/ProductManager.cs`
- [Product Validation](https://github.com/fcwey/northwindbackend/blob/master/Business/ValidationRules/FluentValidation/ProductValidator.cs): `Business/ValidationRules/FluentValidation/ProductValidator.cs`

### Data And Domain

- [User Data Access](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Abstract/IUserDal.cs): `DataAccess/Abstract/IUserDal.cs`
- [Category Data Access](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Abstract/ICategoryDal.cs): `DataAccess/Abstract/ICategoryDal.cs`
- [EF Category Access](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/EfCategoryDal.cs): `DataAccess/Concrete/EntityFramework/EfCategoryDal.cs`
- [Product Data Access](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Abstract/IProductDal.cs): `DataAccess/Abstract/IProductDal.cs`
- [EF Product Access](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/EfProductDal.cs): `DataAccess/Concrete/EntityFramework/EfProductDal.cs`
- [EF User Access](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/EfUserDal.cs): `DataAccess/Concrete/EntityFramework/EfUserDal.cs`
- [EF Repository](https://github.com/fcwey/northwindbackend/blob/master/Core/DataAccess/EntityFramework/EfEntityRepositoryBase.cs): `Core/DataAccess/EntityFramework/EfEntityRepositoryBase.cs`
- [Northwind Context](https://github.com/fcwey/northwindbackend/blob/master/DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs): `DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs`
- [Catalog Entities](https://github.com/fcwey/northwindbackend/blob/master/Entities/Concrete/Product.cs): `Entities/Concrete/Product.cs`
- [User Identity](https://github.com/fcwey/northwindbackend/blob/master/Core/Entities/Concrate/User.cs): `Core/Entities/Concrate/User.cs`

### Core Infrastructure

- [JWT Token Helper](https://github.com/fcwey/northwindbackend/blob/master/Core/Utilities/Security/Jwt/JwtHelper.cs): `Core/Utilities/Security/Jwt/JwtHelper.cs`
- [Cache Aspect](https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Caching/CacheAspect.cs): `Core/Aspects/Autofac/Caching/CacheAspect.cs`
- [Cache Invalidation](https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Caching/CacheRemoveAspect.cs): `Core/Aspects/Autofac/Caching/CacheRemoveAspect.cs`
- [Logging Aspect](https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Logging/LogAspect.cs): `Core/Aspects/Autofac/Logging/LogAspect.cs`
- [Performance Aspect](https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Performance/PerformanceAspect.cs): `Core/Aspects/Autofac/Performance/PerformanceAspect.cs`
- [Transaction Aspect](https://github.com/fcwey/northwindbackend/blob/master/Core/Aspects/Autofac/Transaction/TransactionScopeAspect.cs): `Core/Aspects/Autofac/Transaction/TransactionScopeAspect.cs`

### Other components

- **API Client**

## Connections

- API Client → Auth Controller: sends request
- API Client → Categories Controller: sends request
- API Client → Products Controller: sends request
- Auth Controller → Auth Service: calls (evidence: `WebAPI/Controllers/AuthController.cs`)
- Categories Controller → Category Service: calls (evidence: `WebAPI/Controllers/CategoriesController.cs`)
- Products Controller → Product Service: calls (evidence: `WebAPI/Controllers/ProductsController.cs`)
- Auth Manager → User Service: checks users (evidence: `Business/Concrete/AuthManager.cs`)
- Auth Manager → JWT Token Helper: creates token (evidence: `Business/Concrete/AuthManager.cs`)
- Category Manager → Category Data Access: calls (evidence: `Business/Concrete/CategoryManager.cs`)
- Product Manager → Product Data Access: calls (evidence: `Business/Concrete/ProductManager.cs`)
- Product Manager → Product Validation: validates with (evidence: `Business/Concrete/ProductManager.cs`)
- Product Manager → Cache Aspect: uses aspect (evidence: `Business/Concrete/ProductManager.cs`)
- Product Manager → Cache Invalidation: uses aspect (evidence: `Business/Concrete/ProductManager.cs`)
- Product Manager → Logging Aspect: uses aspect (evidence: `Business/Concrete/ProductManager.cs`)
- Product Manager → Performance Aspect: uses aspect (evidence: `Business/Concrete/ProductManager.cs`)
- Product Manager → Transaction Aspect: uses aspect (evidence: `Business/Concrete/ProductManager.cs`)
- Category Data Access → EF Category Access: implemented by (evidence: `Business/DependencyResolvers/Autofac/AutofacBusinessModule.cs`)
- Product Data Access → EF Product Access: implemented by (evidence: `Business/DependencyResolvers/Autofac/AutofacBusinessModule.cs`)
- User Data Access → EF User Access: implemented by (evidence: `Business/DependencyResolvers/Autofac/AutofacBusinessModule.cs`)
- Northwind Context → Catalog Entities: maps entities (evidence: `DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs`)
- Northwind Context → User Identity: maps entities (evidence: `DataAccess/Concrete/EntityFramework/Contexts/NorthwindContext.cs`)
