# ashwani-labs/pixel-mart architecture

> Architecture diagram of the GitHub repository ashwani-labs/pixel-mart, 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/ashwani-labs/pixel-mart
- Repository: https://github.com/ashwani-labs/pixel-mart

## Overview

PixelMart is a React storefront and admin console backed by Spring Boot services. The main customer journey runs from browsing catalog items through cart and checkout to an order; authentication supports customer/admin access, while catalog, order, and notification services own distinct business stages. The README documents gateway routing, service responsibilities, and service-owned MySQL schemas. Sampled code confirms selected authentication, checkout, review, and media-storage calls; other feature links are omitted or marked unverified rather than inferred from module names.

Main entry points: [`pixelmart-backend/gateway/src/main/java/com/pixelmart/gateway/filter/JwtGatewayFilter.java`](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/gateway/src/main/java/com/pixelmart/gateway/filter/JwtGatewayFilter.java) (Spring Cloud Gateway), [`pixelmart-backend/order-service/src/main/java/com/pixelmart/order/service/CheckoutService.java`](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/service/CheckoutService.java) (Checkout and orders), [`pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java`](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java) (Notification API), [`pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/AuthService.java`](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/AuthService.java) (Identity and tokens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront"]
  node_spa["React storefront<br/>[main.tsx]"]
end

subgraph group_edge["API Gateway"]
  node_gateway["Spring Cloud Gateway"]
end

subgraph group_identity["Identity"]
  node_auth_api["Authentication API"]
  node_auth_service["Identity and tokens<br/>[AuthService.java]"]
  node_guest_auth["Guest sessions"]
  node_refresh["Refresh-token lifecycle"]
end

subgraph group_commerce["Catalog and Orders"]
  node_catalog_api["Catalog API"]
  node_product["Product catalog"]
  node_offers["Offers and pricing<br/>[OfferService.java]"]
  node_reviews["Reviews and moderation<br/>[ReviewService.java]"]
  node_review_media["Review images"]
  node_storage["Media storage"]
  node_orders_api["Cart and checkout API"]
  node_checkout["Checkout and orders"]
  node_order_catalog["Catalog client<br/>[CatalogClient.java]"]
end

subgraph group_messaging["Notifications"]
  node_notify_api["Notification API"]
  node_email["Order email outbox"]
  node_whatsapp["WhatsApp status outbox"]
end

node_shopper(("Shopper or admin"))
node_mysql[("Service-owned MySQL schemas")]
node_smtp(("SMTP provider"))
node_s3(("AWS S3"))

node_shopper -->|"uses"| node_spa
node_spa -->|"proxies /api"| node_gateway
node_gateway -->|"routes auth"| node_auth_api
node_gateway -->|"routes catalog"| node_catalog_api
node_gateway -->|"routes orders"| node_orders_api
node_gateway -->|"routes internal"| node_notify_api
node_auth_api -.->|"delegates"| node_auth_service
node_auth_service -->|"issues and revokes"| node_refresh
node_catalog_api -.->|"serves catalog"| node_product
node_catalog_api -.->|"serves reviews"| node_reviews
node_reviews -->|"uploads images"| node_review_media
node_review_media -->|"stores and loads"| node_storage
node_reviews -->|"checks delivered purchase"| node_orders_api
node_orders_api -.->|"delegates"| node_checkout
node_checkout -->|"reserves stock"| node_order_catalog
node_checkout -.->|"requests confirmation"| node_notify_api
node_notify_api -.->|"dispatches email"| node_email
node_notify_api -.->|"queues status"| node_whatsapp
node_email -->|"sends when configured"| node_smtp
node_auth_service -->|"persists identity"| node_mysql
node_product -->|"persists catalog"| node_mysql
node_checkout -->|"persists orders"| node_mysql
node_email -->|"persists outbox"| node_mysql
node_storage -.->|"optional backend"| node_s3

click node_spa "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-frontend/src/main.tsx"
click node_gateway "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/gateway/src/main/java/com/pixelmart/gateway/filter/JwtGatewayFilter.java"
click node_auth_api "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/controller/AuthController.java"
click node_auth_service "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/AuthService.java"
click node_guest_auth "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/GuestAuthService.java"
click node_refresh "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/security/RefreshTokenService.java"
click node_catalog_api "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/controller/PublicCatalogController.java"
click node_product "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ProductService.java"
click node_offers "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/OfferService.java"
click node_reviews "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewService.java"
click node_review_media "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewImageService.java"
click node_storage "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/storage/StorageService.java"
click node_orders_api "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/controller/CheckoutController.java"
click node_checkout "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/service/CheckoutService.java"
click node_order_catalog "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/client/CatalogClient.java"
click node_notify_api "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java"
click node_email "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderConfirmationEmailService.java"
click node_whatsapp "https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderStatusWhatsAppService.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_spa toneBlue
class node_gateway,node_mysql toneAmber
class node_auth_api,node_auth_service,node_guest_auth,node_refresh toneMint
class node_catalog_api,node_product,node_offers,node_reviews,node_review_media,node_storage,node_orders_api,node_checkout,node_order_catalog toneRose
class node_notify_api,node_email,node_whatsapp,node_shopper,node_smtp,node_s3 toneIndigo
```

## Components

### Storefront

- [React storefront](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-frontend/src/main.tsx): `pixelmart-frontend/src/main.tsx`

### API Gateway

- [Spring Cloud Gateway](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/gateway/src/main/java/com/pixelmart/gateway/filter/JwtGatewayFilter.java): `pixelmart-backend/gateway/src/main/java/com/pixelmart/gateway/filter/JwtGatewayFilter.java`

### Identity

- [Authentication API](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/controller/AuthController.java): `pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/controller/AuthController.java`
- [Identity and tokens](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/AuthService.java): `pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/AuthService.java`
- [Guest sessions](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/GuestAuthService.java): `pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/GuestAuthService.java`
- [Refresh-token lifecycle](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/security/RefreshTokenService.java): `pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/security/RefreshTokenService.java`

### Catalog and Orders

- [Catalog API](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/controller/PublicCatalogController.java): `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/controller/PublicCatalogController.java`
- [Product catalog](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ProductService.java): `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ProductService.java`
- [Offers and pricing](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/OfferService.java): `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/OfferService.java`
- [Reviews and moderation](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewService.java): `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewService.java`
- [Review images](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewImageService.java): `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewImageService.java`
- [Media storage](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/storage/StorageService.java): `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/storage/StorageService.java`
- [Cart and checkout API](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/controller/CheckoutController.java): `pixelmart-backend/order-service/src/main/java/com/pixelmart/order/controller/CheckoutController.java`
- [Checkout and orders](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/service/CheckoutService.java): `pixelmart-backend/order-service/src/main/java/com/pixelmart/order/service/CheckoutService.java`
- [Catalog client](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/order-service/src/main/java/com/pixelmart/order/client/CatalogClient.java): `pixelmart-backend/order-service/src/main/java/com/pixelmart/order/client/CatalogClient.java`

### Notifications

- [Notification API](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java): `pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java`
- [Order email outbox](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderConfirmationEmailService.java): `pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderConfirmationEmailService.java`
- [WhatsApp status outbox](https://github.com/ashwani-labs/pixel-mart/blob/main/pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderStatusWhatsAppService.java): `pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderStatusWhatsAppService.java`

### Other components

- **Shopper or admin**
- **Service-owned MySQL schemas**
- **SMTP provider**
- **AWS S3**

## Connections

- Shopper or admin → React storefront: uses (evidence: `README.md`)
- React storefront → Spring Cloud Gateway: proxies /api (evidence: `README.md`)
- Spring Cloud Gateway → Authentication API: routes auth (evidence: `README.md`)
- Spring Cloud Gateway → Catalog API: routes catalog (evidence: `README.md`)
- Spring Cloud Gateway → Cart and checkout API: routes orders (evidence: `README.md`)
- Spring Cloud Gateway → Notification API: routes internal (evidence: `README.md`)
- Authentication API → Identity and tokens: delegates
- Identity and tokens → Refresh-token lifecycle: issues and revokes (evidence: `pixelmart-backend/auth-service/src/main/java/com/pixelmart/auth/service/AuthService.java`)
- Catalog API → Product catalog: serves catalog
- Catalog API → Reviews and moderation: serves reviews
- Reviews and moderation → Review images: uploads images (evidence: `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewService.java`)
- Review images → Media storage: stores and loads (evidence: `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewImageService.java`)
- Reviews and moderation → Cart and checkout API: checks delivered purchase (evidence: `pixelmart-backend/catalog-service/src/main/java/com/pixelmart/catalog/service/ReviewService.java`)
- Cart and checkout API → Checkout and orders: delegates (evidence: `pixelmart-backend/order-service/src/main/java/com/pixelmart/order/controller/CheckoutController.java`)
- Checkout and orders → Catalog client: reserves stock (evidence: `pixelmart-backend/order-service/src/main/java/com/pixelmart/order/service/CheckoutService.java`)
- Checkout and orders → Notification API: requests confirmation
- Notification API → Order email outbox: dispatches email (evidence: `pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java`)
- Notification API → WhatsApp status outbox: queues status (evidence: `pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/controller/OrderConfirmationController.java`)
- Order email outbox → SMTP provider: sends when configured (evidence: `pixelmart-backend/notification-service/src/main/java/com/pixelmart/notification/service/OrderConfirmationEmailService.java`)
- Identity and tokens → Service-owned MySQL schemas: persists identity (evidence: `README.md`)
- Product catalog → Service-owned MySQL schemas: persists catalog (evidence: `README.md`)
- Checkout and orders → Service-owned MySQL schemas: persists orders (evidence: `README.md`)
- Order email outbox → Service-owned MySQL schemas: persists outbox (evidence: `README.md`)
- Media storage → AWS S3: optional backend (evidence: `README.md`)
