# gagishmagi/online_shoping architecture

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

- Interactive diagram: https://gitdiagram.com/gagishmagi/online_shoping
- Repository: https://github.com/gagishmagi/online_shoping

## Overview

This is a JSF online shop with a customer storefront, session-scoped shopping cart, product and category administration, and order management. The intended customer journey is product browsing, adding items to a cart, and proceeding to payment; the sampled cart computes item totals, while payment-provider wiring is not shown. Admin managers call DAO operations, and the sampled listing managers retrieve catalog data through ListDao. The README provides no feature detail, and most view and payment implementation files were not sampled, so those connections are shown only where supported by the tree or source.

Main entry points: [`src/java/dao/ListDao.java`](https://github.com/gagishmagi/online_shoping/blob/master/src/java/dao/ListDao.java) (Listing DAO), [`src/java/dao`](https://github.com/gagishmagi/online_shoping/tree/master/src/java/dao) (Write DAOs), [`web/admin`](https://github.com/gagishmagi/online_shoping/tree/master/web/admin) (Admin Pages), [`src/java/add_handler/OrderManager.java`](https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/OrderManager.java) (Order Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog_pages["Catalog Pages"]
  node_catalog_manager["Catalog Listing"]
  node_product_details["Product Details"]
end

subgraph group_commerce["Cart And Orders"]
  node_cart_page["Cart Page<br/>[cart.xhtml]"]
  node_shopping_cart["Shopping Cart<br/>[ShoppingCart.java]"]
  node_payment_page["Payment Page<br/>[payment.xhtml]"]
  node_paypal_config["PayPal Config<br/>[paypal.xml]"]
  node_order_manager["Order Management<br/>[OrderManager.java]"]
end

subgraph group_admin["Shop Administration"]
  node_admin_pages["Admin Pages"]
  node_category_manager["Category Manager"]
  node_subcategory_manager["Subcategory Manager"]
  node_product_manager["Product Manager"]
end

subgraph group_persistence["Persistence"]
  node_list_dao["Listing DAO<br/>[ListDao.java]"]
  node_write_daos["Write DAOs"]
  node_entities["Shop Entities"]
  node_shop_database[("Shop Database")]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_catalog_pages
node_catalog_pages -->|"lists products"| node_catalog_manager
node_catalog_manager -->|"queries catalog"| node_list_dao
node_customer -->|"views product"| node_product_details
node_customer -->|"adds product"| node_shopping_cart
node_shopping_cart -->|"shows cart"| node_cart_page
node_customer -->|"proceeds to payment"| node_payment_page
node_payment_page -.->|"uses configuration"| node_paypal_config
node_admin_pages -->|"manages categories"| node_category_manager
node_admin_pages -->|"manages subcategories"| node_subcategory_manager
node_admin_pages -->|"manages products"| node_product_manager
node_admin_pages -->|"manages orders"| node_order_manager
node_category_manager -->|"loads categories"| node_list_dao
node_category_manager -->|"adds category"| node_write_daos
node_subcategory_manager -->|"loads categories"| node_list_dao
node_subcategory_manager -->|"adds subcategory"| node_write_daos
node_product_manager -->|"loads subcategories"| node_list_dao
node_product_manager -->|"adds product"| node_write_daos
node_order_manager -->|"queries orders"| node_list_dao
node_order_manager -->|"edits or deletes order"| node_write_daos
node_list_dao -->|"queries"| node_entities
node_write_daos -->|"persists"| node_entities
node_entities -->|"maps data"| node_shop_database

click node_catalog_pages "https://github.com/gagishmagi/online_shoping/tree/master/web"
click node_catalog_manager "https://github.com/gagishmagi/online_shoping/tree/master/src/java/display"
click node_product_details "https://github.com/gagishmagi/online_shoping/blob/master/web/product-details.xhtml"
click node_cart_page "https://github.com/gagishmagi/online_shoping/blob/master/web/cart.xhtml"
click node_shopping_cart "https://github.com/gagishmagi/online_shoping/blob/master/src/java/cart/ShoppingCart.java"
click node_payment_page "https://github.com/gagishmagi/online_shoping/blob/master/web/payment.xhtml"
click node_paypal_config "https://github.com/gagishmagi/online_shoping/blob/master/web/WEB-INF/paypal.xml"
click node_order_manager "https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/OrderManager.java"
click node_admin_pages "https://github.com/gagishmagi/online_shoping/tree/master/web/admin"
click node_category_manager "https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/CategoryManager.java"
click node_subcategory_manager "https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/SubCategoryManager.java"
click node_product_manager "https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/ProductManager.java"
click node_list_dao "https://github.com/gagishmagi/online_shoping/blob/master/src/java/dao/ListDao.java"
click node_write_daos "https://github.com/gagishmagi/online_shoping/tree/master/src/java/dao"
click node_entities "https://github.com/gagishmagi/online_shoping/tree/master/src/java/entity"
click node_shop_database "https://github.com/gagishmagi/online_shoping/blob/master/java_online_shop.sql"

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_pages,node_catalog_manager,node_product_details toneBlue
class node_cart_page,node_shopping_cart,node_payment_page,node_paypal_config,node_order_manager toneAmber
class node_admin_pages,node_category_manager,node_subcategory_manager,node_product_manager toneMint
class node_list_dao,node_write_daos,node_entities,node_shop_database toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Catalog Pages](https://github.com/gagishmagi/online_shoping/tree/master/web): `web`
- [Catalog Listing](https://github.com/gagishmagi/online_shoping/tree/master/src/java/display): `src/java/display`
- [Product Details](https://github.com/gagishmagi/online_shoping/blob/master/web/product-details.xhtml): `web/product-details.xhtml`

### Cart And Orders

- [Cart Page](https://github.com/gagishmagi/online_shoping/blob/master/web/cart.xhtml): `web/cart.xhtml`
- [Shopping Cart](https://github.com/gagishmagi/online_shoping/blob/master/src/java/cart/ShoppingCart.java): `src/java/cart/ShoppingCart.java`
- [Payment Page](https://github.com/gagishmagi/online_shoping/blob/master/web/payment.xhtml): `web/payment.xhtml`
- [PayPal Config](https://github.com/gagishmagi/online_shoping/blob/master/web/WEB-INF/paypal.xml): `web/WEB-INF/paypal.xml`
- [Order Management](https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/OrderManager.java): `src/java/add_handler/OrderManager.java`

### Shop Administration

- [Admin Pages](https://github.com/gagishmagi/online_shoping/tree/master/web/admin): `web/admin`
- [Category Manager](https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/CategoryManager.java): `src/java/add_handler/CategoryManager.java`
- [Subcategory Manager](https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/SubCategoryManager.java): `src/java/add_handler/SubCategoryManager.java`
- [Product Manager](https://github.com/gagishmagi/online_shoping/blob/master/src/java/add_handler/ProductManager.java): `src/java/add_handler/ProductManager.java`

### Persistence

- [Listing DAO](https://github.com/gagishmagi/online_shoping/blob/master/src/java/dao/ListDao.java): `src/java/dao/ListDao.java`
- [Write DAOs](https://github.com/gagishmagi/online_shoping/tree/master/src/java/dao): `src/java/dao`
- [Shop Entities](https://github.com/gagishmagi/online_shoping/tree/master/src/java/entity): `src/java/entity`
- [Shop Database](https://github.com/gagishmagi/online_shoping/blob/master/java_online_shop.sql): `java_online_shop.sql`

### Other components

- **Customer**

## Connections

- Customer → Catalog Pages: browses
- Catalog Pages → Catalog Listing: lists products
- Catalog Listing → Listing DAO: queries catalog
- Customer → Product Details: views product
- Customer → Shopping Cart: adds product
- Shopping Cart → Cart Page: shows cart
- Customer → Payment Page: proceeds to payment
- Payment Page → PayPal Config: uses configuration
- Admin Pages → Category Manager: manages categories
- Admin Pages → Subcategory Manager: manages subcategories
- Admin Pages → Product Manager: manages products
- Admin Pages → Order Management: manages orders
- Category Manager → Listing DAO: loads categories
- Category Manager → Write DAOs: adds category
- Subcategory Manager → Listing DAO: loads categories
- Subcategory Manager → Write DAOs: adds subcategory
- Product Manager → Listing DAO: loads subcategories
- Product Manager → Write DAOs: adds product
- Order Management → Listing DAO: queries orders
- Order Management → Write DAOs: edits or deletes order
- Listing DAO → Shop Entities: queries
- Write DAOs → Shop Entities: persists
- Shop Entities → Shop Database: maps data
