# oregonyuky/thrift-store architecture

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

- Interactive diagram: https://gitdiagram.com/oregonyuky/thrift-store
- Repository: https://github.com/oregonyuky/thrift-store

## Overview

Thrift Store is a monorepo of two independent ASP.NET Core applications: an admin/API and a public storefront. A shopper browses the catalog, maintains a session-backed cart, then checks out by Pix as an order or bag; the storefront calls the admin API, which owns persistence and payment integrations. The admin also provides management, identity, shipping, uploads, and notifications. The graph preserves documented product areas, but some admin routes and integrations are represented only at subsystem level because their implementations were not sampled.

Main entry points: [`admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs`](https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs) (Admin HTTP API), [`web/src/AlieBrecho.Presentation/Program.cs`](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Program.cs) (Razor storefront), [`web/src/AlieBrecho.Application/Cart/CartService.cs`](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Cart/CartService.cs) (Cart service), [`web/src/AlieBrecho.Application/Checkout/CheckoutService.cs`](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Checkout/CheckoutService.cs) (Checkout service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Public storefront"]
  node_storefront["Razor storefront<br/>[Program.cs]"]
  node_auth["Store authentication"]
  node_catalog["Catalog browsing<br/>[CatalogService.cs]"]
  node_cart["Cart service<br/>[CartService.cs]"]
  node_cartstate["Session cart"]
  node_checkout["Checkout service<br/>[CheckoutService.cs]"]
  node_api_client["Admin API client"]
  node_bearer["Bearer forwarding"]
  node_instagram["Instagram feed"]
  node_store_cart["Cart domain<br/>[Cart.cs]"]
end

subgraph group_adminapi["Admin API"]
  node_admin_api["Admin HTTP API<br/>[BagController.cs]"]
  node_admin_auth["Admin identity<br/>[SecurityService.cs]"]
  node_bag_ops["Bag management<br/>[BagController.cs]"]
  node_catalog_ops["Catalog management<br/>[CreateProduct.cs]"]
  node_orders["Order management<br/>[CreateOrder.cs]"]
  node_shipping["Shipping workflow"]
  node_media["File management<br/>[CreateImage.cs]"]
  node_realtime["Live notifications"]
end

subgraph group_domain["Admin domain and application"]
  node_data_contract["Persistence contract<br/>[IEntityDbSet.cs]"]
  node_bag_entity["Bag domain<br/>[Bag.cs]"]
  node_shipping_box["Shipping box<br/>[ShippingBox.cs]"]
end

subgraph group_infra["Admin infrastructure"]
  node_payment["Payment integrations"]
  node_shipping_provider["Shipping provider"]
  node_image_storage["Image storage"]
  node_security_impl["Identity service<br/>[SecurityService.cs]"]
  node_db_context[("EF data context<br/>[DataContext.cs]")]
end

node_shopper(("Shopper"))
node_admin_actor(("Admin user"))
node_instagram_service_external(("Instagram<br/>external system"))

node_shopper -->|"uses"| node_storefront
node_storefront -->|"invokes"| node_auth
node_storefront -->|"invokes"| node_catalog
node_storefront -->|"invokes"| node_cart
node_cart -->|"reads and writes"| node_cartstate
node_cart -->|"loads products"| node_catalog
node_cart -->|"builds"| node_store_cart
node_storefront -->|"invokes"| node_checkout
node_checkout -->|"loads and clears"| node_cart
node_checkout -.->|"submits checkout"| node_api_client
node_storefront -->|"configures"| node_api_client
node_api_client -.->|"attaches token"| node_bearer
node_storefront -->|"registers"| node_instagram
node_instagram -.->|"fetches feed"| node_instagram_service_external
node_storefront -->|"calls over HTTP"| node_admin_api
node_admin_actor -->|"manages store"| node_admin_api
node_admin_api -->|"routes bag requests"| node_bag_ops
node_bag_ops -->|"reads and writes"| node_bag_entity
node_admin_api -.->|"handles identity"| node_admin_auth
node_admin_api -.->|"routes catalog requests"| node_catalog_ops
node_admin_api -.->|"routes order requests"| node_orders
node_admin_api -.->|"routes shipping requests"| node_shipping
node_admin_api -.->|"routes upload requests"| node_media
node_admin_api -.->|"publishes updates"| node_realtime
node_admin_auth -.->|"delegates"| node_security_impl
node_security_impl -->|"uses"| node_db_context
node_db_context -.->|"implements"| node_data_contract
node_db_context -->|"persists"| node_bag_entity
node_shipping -.->|"uses"| node_shipping_provider
node_shipping_provider -->|"uses package data"| node_shipping_box
node_checkout -.->|"requests payment"| node_payment
node_media -.->|"stores images"| node_image_storage

click node_storefront "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Program.cs"
click node_auth "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Auth/AuthenticationService.cs"
click node_catalog "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Catalog/CatalogService.cs"
click node_cart "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Cart/CartService.cs"
click node_cartstate "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Infrastructure/SessionCartStore.cs"
click node_checkout "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Checkout/CheckoutService.cs"
click node_api_client "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Infrastructure/Api/AlieBrechoApiClient.cs"
click node_bearer "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Infrastructure/Api/AlieBrechoApiAuthorizationHandler.cs"
click node_instagram "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Instagram/InstagramFeedService.cs"
click node_admin_api "https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs"
click node_admin_auth "https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs"
click node_bag_ops "https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs"
click node_catalog_ops "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/ProductManager/Commands/CreateProduct.cs"
click node_orders "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/OrderManager/Commands/CreateOrder.cs"
click node_shipping "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/OrderManager/Commands/GenerateShippingLabel.cs"
click node_media "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/FileImageManager/Commands/CreateImage.cs"
click node_realtime "https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Hubs/OrderNotificationsHub.cs"
click node_payment "https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/MercadoPagoManager/MercadoPagoService.cs"
click node_shipping_provider "https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/MelhorEnvioManager/MelhorEnvioService.cs"
click node_image_storage "https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/FileImageManager/FileImageService.cs"
click node_security_impl "https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs"
click node_db_context "https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/DataAccessManager/EFCore/Contexts/DataContext.cs"
click node_data_contract "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Common/Repositories/IEntityDbSet.cs"
click node_bag_entity "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Domain/Entities/Bag.cs"
click node_shipping_box "https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Domain/Entities/ShippingBox.cs"
click node_store_cart "https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Domain/Orders/Cart.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_storefront,node_auth,node_catalog,node_cart,node_cartstate,node_checkout,node_api_client,node_bearer,node_instagram,node_store_cart,node_admin_actor toneBlue
class node_admin_api,node_admin_auth,node_bag_ops,node_catalog_ops,node_orders,node_shipping,node_media,node_realtime toneAmber
class node_data_contract,node_bag_entity,node_shipping_box toneMint
class node_payment,node_shipping_provider,node_image_storage,node_security_impl,node_db_context toneRose
class node_shopper,node_instagram_service_external toneIndigo
```

## Components

### Public storefront

- [Razor storefront](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Program.cs): `web/src/AlieBrecho.Presentation/Program.cs`
- [Store authentication](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Auth/AuthenticationService.cs): `web/src/AlieBrecho.Application/Auth/AuthenticationService.cs`
- [Catalog browsing](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Catalog/CatalogService.cs): `web/src/AlieBrecho.Application/Catalog/CatalogService.cs`
- [Cart service](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Cart/CartService.cs): `web/src/AlieBrecho.Application/Cart/CartService.cs`
- [Session cart](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Infrastructure/SessionCartStore.cs): `web/src/AlieBrecho.Presentation/Infrastructure/SessionCartStore.cs`
- [Checkout service](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Application/Checkout/CheckoutService.cs): `web/src/AlieBrecho.Application/Checkout/CheckoutService.cs`
- [Admin API client](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Infrastructure/Api/AlieBrechoApiClient.cs): `web/src/AlieBrecho.Infrastructure/Api/AlieBrechoApiClient.cs`
- [Bearer forwarding](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Infrastructure/Api/AlieBrechoApiAuthorizationHandler.cs): `web/src/AlieBrecho.Infrastructure/Api/AlieBrechoApiAuthorizationHandler.cs`
- [Instagram feed](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Presentation/Instagram/InstagramFeedService.cs): `web/src/AlieBrecho.Presentation/Instagram/InstagramFeedService.cs`
- [Cart domain](https://github.com/oregonyuky/thrift-store/blob/main/web/src/AlieBrecho.Domain/Orders/Cart.cs): `web/src/AlieBrecho.Domain/Orders/Cart.cs`

### Admin API

- [Admin HTTP API](https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs): `admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs`
- [Admin identity](https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs): `admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs`
- [Bag management](https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs): `admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs`
- [Catalog management](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/ProductManager/Commands/CreateProduct.cs): `admin/Core/Application/Features/ProductManager/Commands/CreateProduct.cs`
- [Order management](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/OrderManager/Commands/CreateOrder.cs): `admin/Core/Application/Features/OrderManager/Commands/CreateOrder.cs`
- [Shipping workflow](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/OrderManager/Commands/GenerateShippingLabel.cs): `admin/Core/Application/Features/OrderManager/Commands/GenerateShippingLabel.cs`
- [File management](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Features/FileImageManager/Commands/CreateImage.cs): `admin/Core/Application/Features/FileImageManager/Commands/CreateImage.cs`
- [Live notifications](https://github.com/oregonyuky/thrift-store/blob/main/admin/Presentation/ASPNET/BackEnd/Hubs/OrderNotificationsHub.cs): `admin/Presentation/ASPNET/BackEnd/Hubs/OrderNotificationsHub.cs`

### Admin domain and application

- [Persistence contract](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Application/Common/Repositories/IEntityDbSet.cs): `admin/Core/Application/Common/Repositories/IEntityDbSet.cs`
- [Bag domain](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Domain/Entities/Bag.cs): `admin/Core/Domain/Entities/Bag.cs`
- [Shipping box](https://github.com/oregonyuky/thrift-store/blob/main/admin/Core/Domain/Entities/ShippingBox.cs): `admin/Core/Domain/Entities/ShippingBox.cs`

### Admin infrastructure

- [Payment integrations](https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/MercadoPagoManager/MercadoPagoService.cs): `admin/Infrastructure/Infrastructure/MercadoPagoManager/MercadoPagoService.cs`
- [Shipping provider](https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/MelhorEnvioManager/MelhorEnvioService.cs): `admin/Infrastructure/Infrastructure/MelhorEnvioManager/MelhorEnvioService.cs`
- [Image storage](https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/FileImageManager/FileImageService.cs): `admin/Infrastructure/Infrastructure/FileImageManager/FileImageService.cs`
- [Identity service](https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs): `admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs`
- [EF data context](https://github.com/oregonyuky/thrift-store/blob/main/admin/Infrastructure/Infrastructure/DataAccessManager/EFCore/Contexts/DataContext.cs): `admin/Infrastructure/Infrastructure/DataAccessManager/EFCore/Contexts/DataContext.cs`

### Other components

- **Shopper**
- **Admin user**
- **Instagram**: external system

## Connections

- Shopper → Razor storefront: uses (evidence: `README.md`)
- Razor storefront → Store authentication: invokes (evidence: `web/src/AlieBrecho.Presentation/Program.cs`)
- Razor storefront → Catalog browsing: invokes (evidence: `web/src/AlieBrecho.Presentation/Program.cs`)
- Razor storefront → Cart service: invokes (evidence: `web/src/AlieBrecho.Presentation/Program.cs`)
- Cart service → Session cart: reads and writes (evidence: `web/src/AlieBrecho.Application/Cart/CartService.cs`)
- Cart service → Catalog browsing: loads products (evidence: `web/src/AlieBrecho.Application/Cart/CartService.cs`)
- Cart service → Cart domain: builds (evidence: `web/src/AlieBrecho.Application/Cart/CartService.cs`)
- Razor storefront → Checkout service: invokes (evidence: `web/src/AlieBrecho.Presentation/Program.cs`)
- Checkout service → Cart service: loads and clears (evidence: `web/src/AlieBrecho.Application/Checkout/CheckoutService.cs`)
- Checkout service → Admin API client: submits checkout
- Razor storefront → Admin API client: configures (evidence: `web/src/AlieBrecho.Presentation/Program.cs`)
- Admin API client → Bearer forwarding: attaches token
- Razor storefront → Instagram feed: registers (evidence: `web/src/AlieBrecho.Presentation/Program.cs`)
- Instagram feed → Instagram: fetches feed
- Razor storefront → Admin HTTP API: calls over HTTP (evidence: `README.md`)
- Admin user → Admin HTTP API: manages store (evidence: `README.md`)
- Admin HTTP API → Bag management: routes bag requests (evidence: `admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs`)
- Bag management → Bag domain: reads and writes (evidence: `admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs`)
- Admin HTTP API → Admin identity: handles identity
- Admin HTTP API → Catalog management: routes catalog requests
- Admin HTTP API → Order management: routes order requests
- Admin HTTP API → Shipping workflow: routes shipping requests
- Admin HTTP API → File management: routes upload requests
- Admin HTTP API → Live notifications: publishes updates (evidence: `admin/Presentation/ASPNET/BackEnd/Controllers/BagController.cs`)
- Admin identity → Identity service: delegates (evidence: `admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs`)
- Identity service → EF data context: uses (evidence: `admin/Infrastructure/Infrastructure/SecurityManager/AspNetIdentity/SecurityService.cs`)
- EF data context → Persistence contract: implements (evidence: `admin/Infrastructure/Infrastructure/DataAccessManager/EFCore/Contexts/DataContext.cs`)
- EF data context → Bag domain: persists (evidence: `admin/Infrastructure/Infrastructure/DataAccessManager/EFCore/Contexts/DataContext.cs`)
- Shipping workflow → Shipping provider: uses
- Shipping provider → Shipping box: uses package data (evidence: `admin/Infrastructure/Infrastructure/MelhorEnvioManager/MelhorEnvioService.cs`)
- Checkout service → Payment integrations: requests payment
- File management → Image storage: stores images
