# john241198/petstore-project architecture

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

- Interactive diagram: https://gitdiagram.com/john241198/petstore-project
- Repository: https://github.com/john241198/petstore-project

## Overview

MyBatis JPetStore is a Java web storefront built with MyBatis, Spring, and Stripes. Shoppers browse and search the catalog, manage a cart, sign in or create an account, and submit or review orders. Action beans handle web requests, services coordinate domain operations, and MyBatis mappers provide persistence access. The graph preserves these distinct stages and the account, catalog, cart, and order capabilities. Source excerpts support the service interactions; some view and persistence wiring is documented only partially, so uncertain links are omitted.

Main entry points: [`src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java`](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java) (Account actions), [`src/main/java/org/mybatis/jpetstore/service/CatalogService.java`](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/CatalogService.java) (Catalog service), [`src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java`](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java) (Order actions), [`src/main/java/org/mybatis/jpetstore/mapper`](https://github.com/john241198/petstore-project/tree/master/src/main/java/org/mybatis/jpetstore/mapper) (MyBatis mappers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interaction"]
  node_web_actions["Action base"]
  node_account_action["Account actions"]
  node_catalog_action["Catalog actions"]
  node_cart_action["Cart actions"]
  node_order_action["Order actions"]
  node_store_views["Store pages"]
end

subgraph group_commerce["Storefront operations"]
  node_account_service["Account service"]
  node_catalog_service["Catalog service"]
  node_order_service["Order service<br/>[OrderService.java]"]
end

subgraph group_domain["Domain model"]
  node_domain_models["Store models"]
end

subgraph group_persistence["Persistence"]
  node_mappers["MyBatis mappers"]
  node_store_database[("Store database")]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_catalog_action
node_shopper -->|"manages account"| node_account_action
node_shopper -->|"updates cart"| node_cart_action
node_shopper -->|"checks out"| node_order_action
node_account_action -->|"extends"| node_web_actions
node_catalog_action -->|"extends"| node_web_actions
node_cart_action -->|"extends"| node_web_actions
node_order_action -->|"extends"| node_web_actions
node_account_action -->|"calls"| node_account_service
node_account_action -->|"calls"| node_catalog_service
node_catalog_action -->|"calls"| node_catalog_service
node_cart_action -->|"calls"| node_catalog_service
node_order_action -->|"calls"| node_order_service
node_account_action -->|"forwards to"| node_store_views
node_order_action -->|"forwards to"| node_store_views
node_account_service -->|"uses"| node_mappers
node_catalog_service -->|"queries"| node_mappers
node_order_service -->|"reads and writes"| node_mappers
node_catalog_service -->|"uses models"| node_domain_models
node_order_service -->|"uses models"| node_domain_models
node_mappers -.->|"persists through"| node_store_database

click node_web_actions "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/AbstractActionBean.java"
click node_account_action "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java"
click node_catalog_action "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/CatalogActionBean.java"
click node_cart_action "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/CartActionBean.java"
click node_order_action "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java"
click node_store_views "https://github.com/john241198/petstore-project/tree/master/src/main/webapp/WEB-INF/jsp"
click node_account_service "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/AccountService.java"
click node_catalog_service "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/CatalogService.java"
click node_order_service "https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/OrderService.java"
click node_domain_models "https://github.com/john241198/petstore-project/tree/master/src/main/java/org/mybatis/jpetstore/domain"
click node_mappers "https://github.com/john241198/petstore-project/tree/master/src/main/java/org/mybatis/jpetstore/mapper"
click node_store_database "https://github.com/john241198/petstore-project/blob/master/src/main/resources/database/jpetstore-hsqldb-schema.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_web_actions,node_account_action,node_catalog_action,node_cart_action,node_order_action,node_store_views toneBlue
class node_account_service,node_catalog_service,node_order_service toneAmber
class node_domain_models toneMint
class node_mappers,node_store_database toneRose
class node_shopper toneIndigo
```

## Components

### Web interaction

- [Action base](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/AbstractActionBean.java): `src/main/java/org/mybatis/jpetstore/web/actions/AbstractActionBean.java`
- [Account actions](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java): `src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java`
- [Catalog actions](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/CatalogActionBean.java): `src/main/java/org/mybatis/jpetstore/web/actions/CatalogActionBean.java`
- [Cart actions](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/CartActionBean.java): `src/main/java/org/mybatis/jpetstore/web/actions/CartActionBean.java`
- [Order actions](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java): `src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java`
- [Store pages](https://github.com/john241198/petstore-project/tree/master/src/main/webapp/WEB-INF/jsp): `src/main/webapp/WEB-INF/jsp`

### Storefront operations

- [Account service](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/AccountService.java): `src/main/java/org/mybatis/jpetstore/service/AccountService.java`
- [Catalog service](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/CatalogService.java): `src/main/java/org/mybatis/jpetstore/service/CatalogService.java`
- [Order service](https://github.com/john241198/petstore-project/blob/master/src/main/java/org/mybatis/jpetstore/service/OrderService.java): `src/main/java/org/mybatis/jpetstore/service/OrderService.java`

### Domain model

- [Store models](https://github.com/john241198/petstore-project/tree/master/src/main/java/org/mybatis/jpetstore/domain): `src/main/java/org/mybatis/jpetstore/domain`

### Persistence

- [MyBatis mappers](https://github.com/john241198/petstore-project/tree/master/src/main/java/org/mybatis/jpetstore/mapper): `src/main/java/org/mybatis/jpetstore/mapper`
- [Store database](https://github.com/john241198/petstore-project/blob/master/src/main/resources/database/jpetstore-hsqldb-schema.sql): `src/main/resources/database/jpetstore-hsqldb-schema.sql`

### Other components

- **Shopper**

## Connections

- Shopper → Catalog actions: browses
- Shopper → Account actions: manages account
- Shopper → Cart actions: updates cart
- Shopper → Order actions: checks out
- Account actions → Action base: extends (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java`)
- Catalog actions → Action base: extends (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/CatalogActionBean.java`)
- Cart actions → Action base: extends (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/CartActionBean.java`)
- Order actions → Action base: extends (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java`)
- Account actions → Account service: calls (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java`)
- Account actions → Catalog service: calls (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java`)
- Catalog actions → Catalog service: calls (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/CatalogActionBean.java`)
- Cart actions → Catalog service: calls (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/CartActionBean.java`)
- Order actions → Order service: calls (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java`)
- Account actions → Store pages: forwards to (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/AccountActionBean.java`)
- Order actions → Store pages: forwards to (evidence: `src/main/java/org/mybatis/jpetstore/web/actions/OrderActionBean.java`)
- Account service → MyBatis mappers: uses (evidence: `src/main/java/org/mybatis/jpetstore/service/AccountService.java`)
- Catalog service → MyBatis mappers: queries (evidence: `src/main/java/org/mybatis/jpetstore/service/CatalogService.java`)
- Order service → MyBatis mappers: reads and writes (evidence: `src/main/java/org/mybatis/jpetstore/service/OrderService.java`)
- Catalog service → Store models: uses models (evidence: `src/main/java/org/mybatis/jpetstore/service/CatalogService.java`)
- Order service → Store models: uses models (evidence: `src/main/java/org/mybatis/jpetstore/service/OrderService.java`)
- MyBatis mappers → Store database: persists through
