# petruhertea/full-stack-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/petruhertea/full-stack-ecommerce
- Repository: https://github.com/petruhertea/full-stack-ecommerce

## Overview

Luv2Shop is a full-stack storefront: shoppers browse and search products, manage a locally persisted cart, submit shipping and billing details, pay by card, and authenticated users can review order history. Angular services connect catalog and checkout workflows to Spring APIs; the backend creates Stripe payment intents and persists submitted orders. The graph includes documented authentication and order-history capabilities, but source excerpts do not expose every frontend service or backend endpoint implementation, so those links are documented at subsystem level.

Main entry points: [`02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts`](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts) (Checkout Form), [`02-frontend/angular-ecommerce/src/app/services/product.service.ts`](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/product.service.ts) (Product Service), [`02-frontend/angular-ecommerce/src/app/services/luv2-shop-form.service.ts`](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/luv2-shop-form.service.ts) (Address Lookups), [`01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java`](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java) (Checkout Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Catalog and Cart"]
  node_catalog_ui["Catalog Views"]
  node_product_detail["Product Details"]
  node_product_api["Product Service<br/>[product.service.ts]"]
  node_category_search["Category and Search"]
  node_cart_ui["Cart Views"]
  node_cart_service["Cart State<br/>[cart.service.ts]"]
end

subgraph group_purchase["Checkout and Orders"]
  node_checkout_ui["Checkout Form"]
  node_address_service["Address Lookups"]
  node_checkout_front["Checkout Service"]
  node_history_ui["Order History"]
  node_history_service["History Service"]
end

subgraph group_identity["Identity"]
  node_auth_ui["Login Status"]
  node_auth_interceptor["Auth Interceptor"]
end

subgraph group_backend["Commerce Backend"]
  node_checkout_controller["Checkout API"]
  node_checkout_impl["Checkout Logic"]
  node_customer_repo["Customer Repository"]
  node_order_repo["Order Repository"]
  node_product_repo["Product Repository"]
  node_category_repo["Category Repository"]
  node_country_repo["Country Repository"]
  node_state_repo["State Repository"]
end

node_shopper(("Shopper"))
node_stripe{{"Stripe"}}
node_auth0{{"Auth0"}}
node_mysql[("MySQL")]

node_shopper -->|"browses"| node_catalog_ui
node_shopper -->|"manages cart"| node_cart_ui
node_catalog_ui -.->|"requests products"| node_product_api
node_product_detail -.->|"loads product"| node_product_api
node_category_search -.->|"searches catalog"| node_product_api
node_product_api -.->|"requests catalog"| node_product_repo
node_product_api -.->|"requests categories"| node_category_repo
node_cart_ui -.->|"updates cart"| node_cart_service
node_cart_service -->|"persists locally"| node_shopper
node_shopper -->|"submits purchase"| node_checkout_ui
node_checkout_ui -->|"reads cart"| node_cart_service
node_checkout_ui -->|"loads states"| node_address_service
node_address_service -.->|"loads countries"| node_country_repo
node_address_service -.->|"loads states"| node_state_repo
node_checkout_ui -->|"requests payment and order"| node_checkout_front
node_checkout_front -.->|"calls checkout API"| node_checkout_controller
node_checkout_ui -->|"confirms card payment"| node_stripe
node_checkout_controller -->|"delegates checkout"| node_checkout_impl
node_checkout_impl -->|"creates payment intent"| node_stripe
node_checkout_impl -->|"saves customer order"| node_customer_repo
node_customer_repo -.->|"reads and writes"| node_mysql
node_shopper -->|"signs in"| node_auth_ui
node_auth_ui -.->|"authenticates"| node_auth0
node_auth_interceptor -->|"gets access token"| node_auth0
node_shopper -->|"views orders"| node_history_ui
node_history_ui -.->|"requests history"| node_history_service
node_history_service -.->|"loads past orders"| node_order_repo
node_order_repo -.->|"reads orders"| node_mysql

click node_catalog_ui "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/product-list/product-list.component.ts"
click node_product_detail "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/product-details/product-details.component.ts"
click node_product_api "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/product.service.ts"
click node_category_search "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/search/search.component.ts"
click node_cart_ui "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/cart-details/cart-details.component.ts"
click node_cart_service "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/cart.service.ts"
click node_checkout_ui "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts"
click node_address_service "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/luv2-shop-form.service.ts"
click node_checkout_front "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/checkout.service.ts"
click node_history_ui "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/order-history/order-history.component.ts"
click node_history_service "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/order-history.service.ts"
click node_auth_ui "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/login-status/login-status.component.ts"
click node_auth_interceptor "https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/auth-interceptor.service.ts"
click node_checkout_controller "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/controller/CheckoutController.java"
click node_checkout_impl "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java"
click node_customer_repo "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/CustomerRepository.java"
click node_order_repo "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/OrderRepository.java"
click node_product_repo "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/ProductRepository.java"
click node_category_repo "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/ProductCategoryRepository.java"
click node_country_repo "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/CountryRepository.java"
click node_state_repo "https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/StateRepository.java"

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_catalog_ui,node_product_detail,node_product_api,node_category_search,node_cart_ui,node_cart_service toneBlue
class node_checkout_ui,node_address_service,node_checkout_front,node_history_ui,node_history_service,node_mysql toneAmber
class node_auth_ui,node_auth_interceptor toneMint
class node_checkout_controller,node_checkout_impl,node_customer_repo,node_order_repo,node_product_repo,node_category_repo,node_country_repo,node_state_repo toneRose
class node_shopper,node_stripe,node_auth0 toneIndigo
```

## Components

### Catalog and Cart

- [Catalog Views](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/product-list/product-list.component.ts): `02-frontend/angular-ecommerce/src/app/components/product-list/product-list.component.ts`
- [Product Details](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/product-details/product-details.component.ts): `02-frontend/angular-ecommerce/src/app/components/product-details/product-details.component.ts`
- [Product Service](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/product.service.ts): `02-frontend/angular-ecommerce/src/app/services/product.service.ts`
- [Category and Search](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/search/search.component.ts): `02-frontend/angular-ecommerce/src/app/components/search/search.component.ts`
- [Cart Views](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/cart-details/cart-details.component.ts): `02-frontend/angular-ecommerce/src/app/components/cart-details/cart-details.component.ts`
- [Cart State](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/cart.service.ts): `02-frontend/angular-ecommerce/src/app/services/cart.service.ts`

### Checkout and Orders

- [Checkout Form](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts): `02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts`
- [Address Lookups](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/luv2-shop-form.service.ts): `02-frontend/angular-ecommerce/src/app/services/luv2-shop-form.service.ts`
- [Checkout Service](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/checkout.service.ts): `02-frontend/angular-ecommerce/src/app/services/checkout.service.ts`
- [Order History](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/order-history/order-history.component.ts): `02-frontend/angular-ecommerce/src/app/components/order-history/order-history.component.ts`
- [History Service](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/order-history.service.ts): `02-frontend/angular-ecommerce/src/app/services/order-history.service.ts`

### Identity

- [Login Status](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/components/login-status/login-status.component.ts): `02-frontend/angular-ecommerce/src/app/components/login-status/login-status.component.ts`
- [Auth Interceptor](https://github.com/petruhertea/full-stack-ecommerce/blob/master/02-frontend/angular-ecommerce/src/app/services/auth-interceptor.service.ts): `02-frontend/angular-ecommerce/src/app/services/auth-interceptor.service.ts`

### Commerce Backend

- [Checkout API](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/controller/CheckoutController.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/controller/CheckoutController.java`
- [Checkout Logic](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java`
- [Customer Repository](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/CustomerRepository.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/CustomerRepository.java`
- [Order Repository](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/OrderRepository.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/OrderRepository.java`
- [Product Repository](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/ProductRepository.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/ProductRepository.java`
- [Category Repository](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/ProductCategoryRepository.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/ProductCategoryRepository.java`
- [Country Repository](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/CountryRepository.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/CountryRepository.java`
- [State Repository](https://github.com/petruhertea/full-stack-ecommerce/blob/master/01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/StateRepository.java): `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/dao/StateRepository.java`

### Other components

- **Shopper**
- **Stripe**
- **Auth0**
- **MySQL**

## Connections

- Shopper → Catalog Views: browses (evidence: `README.md`)
- Shopper → Cart Views: manages cart (evidence: `README.md`)
- Catalog Views → Product Service: requests products (evidence: `02-frontend/angular-ecommerce/src/app/components/product-list/product-list.component.ts`)
- Product Details → Product Service: loads product (evidence: `02-frontend/angular-ecommerce/src/app/components/product-details/product-details.component.ts`)
- Category and Search → Product Service: searches catalog
- Product Service → Product Repository: requests catalog (evidence: `README.md`)
- Product Service → Category Repository: requests categories (evidence: `README.md`)
- Cart Views → Cart State: updates cart (evidence: `02-frontend/angular-ecommerce/src/app/components/cart-details/cart-details.component.ts`)
- Cart State → Shopper: persists locally (evidence: `02-frontend/angular-ecommerce/src/app/services/cart.service.ts`)
- Shopper → Checkout Form: submits purchase (evidence: `README.md`)
- Checkout Form → Cart State: reads cart (evidence: `02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts`)
- Checkout Form → Address Lookups: loads states (evidence: `02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts`)
- Address Lookups → Country Repository: loads countries
- Address Lookups → State Repository: loads states
- Checkout Form → Checkout Service: requests payment and order (evidence: `02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts`)
- Checkout Service → Checkout API: calls checkout API (evidence: `README.md`)
- Checkout Form → Stripe: confirms card payment (evidence: `02-frontend/angular-ecommerce/src/app/components/checkout/checkout.component.ts`)
- Checkout API → Checkout Logic: delegates checkout (evidence: `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/controller/CheckoutController.java`)
- Checkout Logic → Stripe: creates payment intent (evidence: `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java`)
- Checkout Logic → Customer Repository: saves customer order (evidence: `01-backend/spring-boot-ecommerce/src/main/java/com/luv2code/ecommerce/service/CheckoutServiceImpl.java`)
- Customer Repository → MySQL: reads and writes (evidence: `README.md`)
- Shopper → Login Status: signs in (evidence: `README.md`)
- Login Status → Auth0: authenticates (evidence: `README.md`)
- Auth Interceptor → Auth0: gets access token (evidence: `02-frontend/angular-ecommerce/src/app/services/auth-interceptor.service.ts`)
- Shopper → Order History: views orders (evidence: `README.md`)
- Order History → History Service: requests history (evidence: `02-frontend/angular-ecommerce/src/app/components/order-history/order-history.component.ts`)
- History Service → Order Repository: loads past orders (evidence: `README.md`)
- Order Repository → MySQL: reads orders (evidence: `README.md`)
