# saijaku0/sneakers-shop-saas architecture

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

- Interactive diagram: https://gitdiagram.com/saijaku0/sneakers-shop-saas
- Repository: https://github.com/saijaku0/sneakers-shop-saas

## Overview

Sneakers Shop is an educational full-stack sneaker-store MVP. Its main journey is registration, browsing and filtering the catalog, viewing a product, managing a cart, checking out with inventory reservation, and viewing order details or history. The backend separates API, application use cases, domain rules, and persistence; the Next.js frontend presents the shopping and account flows. README statements support the main journey and checkout coordination; sampled source confirms query and authentication behavior. Several feature implementations were not sampled, so their internal links are documented at subsystem level.

Main entry points: [`backend/src/SneakersShop.API/Controllers`](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.API/Controllers) (HTTP controllers), [`web/src/shared/api`](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/shared/api) (API client), [`backend/src/SneakersShop.Application/Abstractions/ApplicatonDbContext/IApplicationDbContext.cs`](https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Application/Abstractions/ApplicatonDbContext/IApplicationDbContext.cs) (Read context), [`web/src/app`](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/app) (Next.js app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Storefront"]
  node_webapp["Next.js app"]
  node_registration["Registration wizard"]
  node_catalogui["Catalog browsing"]
  node_filters["Catalog filters"]
  node_productui["Product details"]
  node_cartui["Cart"]
  node_checkoutui["Checkout wizard"]
  node_ordersui["Order views"]
  node_webapi["API client"]
end

subgraph group_api["Backend API"]
  node_controllers["HTTP controllers<br/>[Controllers]"]
end

subgraph group_application["Application use cases"]
  node_auth["Authentication<br/>[Auth]"]
  node_catalog["Catalog queries<br/>[Queries]"]
  node_cart["Cart operations<br/>[Carts]"]
  node_ordercreate["Checkout orchestration<br/>[CreateOrder]"]
  node_orderviews["Order queries<br/>[Queries]"]
  node_profiles["Profile operations<br/>[Profiles]"]
  node_readcontext["Read context"]
end

subgraph group_domain["Commerce domain"]
  node_aggregates["Commerce aggregates"]
end

subgraph group_persistence["Persistence and identity"]
  node_db[("PostgreSQL store<br/>[AppDbContext.cs]")]
  node_identity["Identity and tokens"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_webapp
node_webapp -->|"registers through"| node_registration
node_registration -->|"submits registration"| node_webapi
node_webapp -->|"browses"| node_catalogui
node_catalogui -->|"filters listings"| node_filters
node_catalogui -->|"requests catalog"| node_webapi
node_webapp -->|"opens product"| node_productui
node_productui -->|"requests details"| node_webapi
node_shopper -->|"manages cart"| node_cartui
node_cartui -->|"updates cart"| node_webapi
node_shopper -->|"checks out"| node_checkoutui
node_checkoutui -->|"places order"| node_webapi
node_shopper -->|"views orders"| node_ordersui
node_ordersui -->|"requests orders"| node_webapi
node_webapi -.->|"calls API"| node_controllers
node_controllers -->|"dispatches auth"| node_auth
node_controllers -.->|"dispatches catalog"| node_catalog
node_controllers -.->|"dispatches cart"| node_cart
node_controllers -.->|"dispatches checkout"| node_ordercreate
node_controllers -.->|"dispatches order queries"| node_orderviews
node_controllers -.->|"dispatches profile"| node_profiles
node_catalog -->|"queries data"| node_readcontext
node_cart -->|"reads cart view"| node_readcontext
node_orderviews -->|"reads order views"| node_readcontext
node_profiles -->|"reads profile"| node_readcontext
node_auth -->|"authenticates users"| node_identity
node_ordercreate -->|"coordinates checkout"| node_aggregates
node_ordercreate -->|"commits transaction"| node_db
node_readcontext -.->|"reads entities"| node_db
node_identity -.->|"persists identity"| node_db

click node_webapp "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/app"
click node_registration "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/registration-wizard"
click node_catalogui "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/widgets/catalog-route"
click node_filters "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/catalog-filters"
click node_productui "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/product-detail"
click node_cartui "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/entities/cart"
click node_checkoutui "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/checkout-wizard"
click node_ordersui "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/widgets/order-history"
click node_webapi "https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/shared/api"
click node_controllers "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.API/Controllers"
click node_auth "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Auth"
click node_catalog "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Catalog/Queries"
click node_cart "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Carts"
click node_ordercreate "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Orders/Command/CreateOrder"
click node_orderviews "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Orders/Queries"
click node_profiles "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Profiles"
click node_readcontext "https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Application/Abstractions/ApplicatonDbContext/IApplicationDbContext.cs"
click node_aggregates "https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Domain"
click node_db "https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Infrastructure/Persistence/AppDbContext.cs"
click node_identity "https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Infrastructure/Persistence/Auth/AuthenticationService.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_webapp,node_registration,node_catalogui,node_filters,node_productui,node_cartui,node_checkoutui,node_ordersui,node_webapi toneBlue
class node_controllers toneAmber
class node_auth,node_catalog,node_cart,node_ordercreate,node_orderviews,node_profiles,node_readcontext toneMint
class node_aggregates toneRose
class node_db,node_identity,node_shopper toneIndigo
```

## Components

### Storefront

- [Next.js app](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/app): `web/src/app`
- [Registration wizard](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/registration-wizard): `web/src/features/registration-wizard`
- [Catalog browsing](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/widgets/catalog-route): `web/src/widgets/catalog-route`
- [Catalog filters](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/catalog-filters): `web/src/features/catalog-filters`
- [Product details](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/product-detail): `web/src/features/product-detail`
- [Cart](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/entities/cart): `web/src/entities/cart`
- [Checkout wizard](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/features/checkout-wizard): `web/src/features/checkout-wizard`
- [Order views](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/widgets/order-history): `web/src/widgets/order-history`
- [API client](https://github.com/saijaku0/sneakers-shop-saas/tree/main/web/src/shared/api): `web/src/shared/api`

### Backend API

- [HTTP controllers](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.API/Controllers): `backend/src/SneakersShop.API/Controllers`

### Application use cases

- [Authentication](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Auth): `backend/src/SneakersShop.Application/Auth`
- [Catalog queries](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Catalog/Queries): `backend/src/SneakersShop.Application/Catalog/Queries`
- [Cart operations](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Carts): `backend/src/SneakersShop.Application/Carts`
- [Checkout orchestration](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Orders/Command/CreateOrder): `backend/src/SneakersShop.Application/Orders/Command/CreateOrder`
- [Order queries](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Orders/Queries): `backend/src/SneakersShop.Application/Orders/Queries`
- [Profile operations](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Application/Profiles): `backend/src/SneakersShop.Application/Profiles`
- [Read context](https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Application/Abstractions/ApplicatonDbContext/IApplicationDbContext.cs): `backend/src/SneakersShop.Application/Abstractions/ApplicatonDbContext/IApplicationDbContext.cs`

### Commerce domain

- [Commerce aggregates](https://github.com/saijaku0/sneakers-shop-saas/tree/main/backend/src/SneakersShop.Domain): `backend/src/SneakersShop.Domain`

### Persistence and identity

- [PostgreSQL store](https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Infrastructure/Persistence/AppDbContext.cs): `backend/src/SneakersShop.Infrastructure/Persistence/AppDbContext.cs`
- [Identity and tokens](https://github.com/saijaku0/sneakers-shop-saas/blob/main/backend/src/SneakersShop.Infrastructure/Persistence/Auth/AuthenticationService.cs): `backend/src/SneakersShop.Infrastructure/Persistence/Auth/AuthenticationService.cs`

### Other components

- **Shopper**

## Connections

- Shopper → Next.js app: uses (evidence: `README.md`)
- Next.js app → Registration wizard: registers through (evidence: `README.md`)
- Registration wizard → API client: submits registration (evidence: `README.md`)
- Next.js app → Catalog browsing: browses (evidence: `README.md`)
- Catalog browsing → Catalog filters: filters listings (evidence: `README.md`)
- Catalog browsing → API client: requests catalog (evidence: `README.md`)
- Next.js app → Product details: opens product (evidence: `README.md`)
- Product details → API client: requests details (evidence: `README.md`)
- Shopper → Cart: manages cart (evidence: `README.md`)
- Cart → API client: updates cart (evidence: `README.md`)
- Shopper → Checkout wizard: checks out (evidence: `README.md`)
- Checkout wizard → API client: places order (evidence: `README.md`)
- Shopper → Order views: views orders (evidence: `README.md`)
- Order views → API client: requests orders (evidence: `README.md`)
- API client → HTTP controllers: calls API
- HTTP controllers → Authentication: dispatches auth (evidence: `backend/src/SneakersShop.API/Controllers/AuthController.cs`)
- HTTP controllers → Catalog queries: dispatches catalog
- HTTP controllers → Cart operations: dispatches cart
- HTTP controllers → Checkout orchestration: dispatches checkout
- HTTP controllers → Order queries: dispatches order queries
- HTTP controllers → Profile operations: dispatches profile
- Catalog queries → Read context: queries data (evidence: `backend/src/SneakersShop.Application/Catalog/Queries/GetProducts/GetProductsQueryHandler.cs`)
- Cart operations → Read context: reads cart view (evidence: `backend/src/SneakersShop.Application/Carts/Queries/GetCart/GetCartQueryHandler.cs`)
- Order queries → Read context: reads order views (evidence: `backend/src/SneakersShop.Application/Orders/Queries/GetOrderById/GetOrderByIdQueryHandler.cs`)
- Profile operations → Read context: reads profile (evidence: `backend/src/SneakersShop.Application/Profiles/Queries/GetDefaultAddress/GetDefaultAddressQueryHandler.cs`)
- Authentication → Identity and tokens: authenticates users (evidence: `backend/src/SneakersShop.Infrastructure/Persistence/Auth/AuthenticationService.cs`)
- Checkout orchestration → Commerce aggregates: coordinates checkout (evidence: `README.md`)
- Checkout orchestration → PostgreSQL store: commits transaction (evidence: `README.md`)
- Read context → PostgreSQL store: reads entities
- Identity and tokens → PostgreSQL store: persists identity (evidence: `backend/src/SneakersShop.Infrastructure/Persistence/Auth/AuthenticationService.cs`)
