# upadhcha/charueshoponweb architecture

> Architecture diagram of the GitHub repository upadhcha/charueshoponweb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/upadhcha/charueshoponweb
- Repository: https://github.com/upadhcha/charueshoponweb

## Overview

##### Main Components

a. Frontend Layer:
- Web Application (ASP.NET Core MVC)
- Blazor Admin Panel (WebAssembly)
- Public API (REST endpoints)

b. Application Core:
- Entities
- Interfaces
- Services
- Specifications

c. Infrastructure Layer:
- Data Access
- Identity
- Logging
- External Services

d. Database Layer:
- Catalog Database (SQL Server)
- Identity Database (SQL Server)

##### Component Relationships

**[Web Browser] ←→ [Load Balancer/Gateway]**
- ↓
**[Frontend Layer] - Web App (MVC)**
- Blazor Admin
- Public API
- ↓
**[Application Core] - Services**
- Business Logic
- Domain Entities
- ↓
**[Infrastructure] - Data Access**
- Identity
- External Services
- ↓
**[Databases] - Catalog DB**
- Identity DB

##### Specific Implementation Details

Key components:
**Frontend:**
- MVC Controllers (/src/Web/Controllers)
- Blazor Admin Pages (/src/BlazorAdmin)
- API Endpoints (/src/PublicApi)

**Application Core:**
- Entities (Basket, Order, Catalog)
- Services (BasketService, OrderService)
- Interfaces (IRepository, IBasketService)

**Infrastructure:**
- EF Core Contexts (CatalogContext, AppIdentityDbContext)
- Repository Implementations
- Identity Services

##### Cross-Cutting Concerns

As vertical layers:
- Authentication/Authorization
- Logging
- Caching
- Error Handling

##### Additional Elements

Include:
- External service connections (email, payment)
- Cache layers
- API endpoints
- Security boundaries

##### Deployment Context

Azure deployment options:
- App Service
- SQL Database
- Key Vault
- Container support

##### Integration points

Remember to:
- Both synchronous and asynchronous communication paths
- Scalability points
- Security boundaries clearly

This will provide a complete view of the system while maintaining clarity and usefulness for technical discussions and architectural decisions.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]:::client
    end

    subgraph LoadBalancer
        LB["Load Balancer/Gateway"]:::gateway
    end

    subgraph FrontendLayer["Frontend Layer"]
        WebApp["Web Application (MVC)"]:::frontend
        BlazorAdmin["Blazor Admin Panel"]:::frontend
        PublicAPI["Public API"]:::frontend
        AuthEndpoints["Auth Endpoints"]:::frontend
        CatalogEndpoints["Catalog Endpoints"]:::frontend
    end

    subgraph ApplicationCore["Application Core"]
        Entities["Domain Entities"]:::core
        Interfaces["Interfaces"]:::core
        Services["Services"]:::core
        Specs["Specifications"]:::core
    end

    subgraph Infrastructure["Infrastructure Layer"]
        DataAccess["Data Access"]:::infra
        Identity["Identity Services"]:::infra
        Logging["Logging"]:::infra
        ExtServices["External Services"]:::infra
    end

    subgraph Database["Database Layer"]
        CatalogDB[(Catalog DB)]:::database
        IdentityDB[(Identity DB)]:::database
    end

    subgraph CrossCutting["Cross-Cutting Concerns"]
        Auth["Authentication"]:::security
        Cache["Caching"]:::utility
        ErrorHandling["Error Handling"]:::utility
        HealthChecks["Health Checks"]:::utility
    end

    Browser --> LB
    LB --> WebApp
    LB --> BlazorAdmin
    LB --> PublicAPI

    WebApp --> Services
    BlazorAdmin --> Services
    PublicAPI --> Services

    Services --> Entities
    Services --> Interfaces
    Services --> Specs

    Interfaces --> DataAccess
    DataAccess --> CatalogDB
    Identity --> IdentityDB
    
    %% Click events for component mapping
    click WebApp "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Web/"
    click BlazorAdmin "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/BlazorAdmin/"
    click PublicAPI "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/PublicApi/"
    click Entities "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/ApplicationCore/Entities/"
    click Interfaces "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/ApplicationCore/Interfaces/"
    click Services "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/ApplicationCore/Services/"
    click Specs "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/ApplicationCore/Specifications/"
    click DataAccess "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Infrastructure/Data/"
    click Identity "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Infrastructure/Identity/"
    click Logging "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Infrastructure/Logging/"
    click ExtServices "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Infrastructure/Services/"
    click Auth "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Web/Areas/Identity/"
    click HealthChecks "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/Web/HealthChecks/"
    click AuthEndpoints "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/PublicApi/AuthEndpoints/"
    click CatalogEndpoints "https://github.com/upadhcha/charueShopOnWeb/tree/main/src/PublicApi/CatalogItemEndpoints/"

    %% Styling
    classDef client fill:#e1e1e1
    classDef gateway fill:#f9f,stroke:#333
    classDef frontend fill:#69c,stroke:#333
    classDef core fill:#9c6,stroke:#333
    classDef infra fill:#f96,stroke:#333
    classDef database fill:#c9f,stroke:#333
    classDef security fill:#f66,stroke:#333
    classDef utility fill:#ccc,stroke:#333

    %% Legend
    subgraph Legend
        Client_["Client"]:::client
        Gateway_["Gateway"]:::gateway
        Frontend_["Frontend"]:::frontend
        Core_["Core"]:::core
        Infra_["Infrastructure"]:::infra
        DB_["Database"]:::database
        Security_["Security"]:::security
        Utility_["Utility"]:::utility
    end
```
