# geniuurievich/sneaker_store architecture

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

- Interactive diagram: https://gitdiagram.com/geniuurievich/sneaker_store
- Repository: https://github.com/geniuurievich/sneaker_store

## Overview

This repository implements a microservice commerce backend: users authenticate, browse products, manage a cart, and create and inspect orders. The clearest documented transaction path is order creation: the order service resolves the user, reads the cart, checks product availability, records order data, updates stock, and removes cart items. Separate catalog, cart, and user capabilities remain visible. Several messaging listeners and cross-service RPC implementations were not excerpted, so those relationships are omitted or marked unverified rather than inferred from filenames.

Main entry points: [`orders_service/app/services/Order_service.py`](https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/services/Order_service.py) (Order workflow), [`users_service/app/api`](https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/api) (Auth and user API), [`products_service/app/api/product_router.py`](https://github.com/geniuurievich/sneaker_store/blob/master/products_service/app/api/product_router.py) (Product API), [`cart_service/app/services/CartService.py`](https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/services/CartService.py) (Cart operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_users["Identity"]
  node_user_api["Auth and user API"]
  node_auth["Authentication<br/>[AuthService.py]"]
  node_user_store[("User and token data")]
  node_user_events["User messaging"]
end

subgraph group_products["Catalog"]
  node_product_api["Product API<br/>[product_router.py]"]
  node_product_service["Product management<br/>[ProductService.py]"]
  node_catalog_store[("Catalog and sizes")]
  node_product_messaging["Product messaging"]
end

subgraph group_cart["Cart"]
  node_cart_api["Cart API<br/>[cart_router.py]"]
  node_cart_service["Cart operations<br/>[CartService.py]"]
  node_cart_store[("Cart data")]
  node_cart_listener["Cart listener<br/>[listen.py]"]
end

subgraph group_orders["Orders"]
  node_order_api["Order API<br/>[order.py]"]
  node_order_service["Order workflow<br/>[Order_service.py]"]
  node_order_store[("Order data")]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))
node_message_broker["Message broker"]

node_shopper -.->|"authenticates"| node_user_api
node_user_api -->|"routes auth"| node_auth
node_auth -->|"reads and writes"| node_user_store
node_auth -->|"publishes registration"| node_user_events
node_user_events -.->|"publishes events"| node_message_broker
node_shopper -.->|"browses catalog"| node_product_api
node_admin -.->|"manages catalog"| node_product_api
node_product_api -->|"routes product actions"| node_product_service
node_product_service -->|"queries catalog"| node_catalog_store
node_product_service -->|"checks role"| node_user_api
node_product_messaging -.->|"listens for events"| node_message_broker
node_shopper -.->|"manages cart"| node_cart_api
node_cart_api -->|"routes cart actions"| node_cart_service
node_cart_service -->|"reads and writes"| node_cart_store
node_cart_service -->|"fetches product"| node_product_api
node_cart_service -->|"resolves user"| node_user_api
node_cart_listener -->|"updates cart"| node_cart_store
node_cart_listener -.->|"listens for events"| node_message_broker
node_shopper -.->|"places and views orders"| node_order_api
node_order_api -.->|"routes order actions"| node_order_service
node_order_service -->|"resolves token"| node_user_api
node_order_service -->|"fetches and clears cart"| node_cart_api
node_order_service -->|"checks and updates stock"| node_product_api
node_order_service -->|"creates and queries orders"| node_order_store
node_order_service -->|"requests order updates"| node_product_messaging
node_order_service -.->|"coordinates events"| node_message_broker

click node_user_api "https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/api"
click node_auth "https://github.com/geniuurievich/sneaker_store/blob/master/users_service/app/services/AuthService.py"
click node_user_store "https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/repositories"
click node_user_events "https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/messaging"
click node_product_api "https://github.com/geniuurievich/sneaker_store/blob/master/products_service/app/api/product_router.py"
click node_product_service "https://github.com/geniuurievich/sneaker_store/blob/master/products_service/app/services/ProductService.py"
click node_catalog_store "https://github.com/geniuurievich/sneaker_store/tree/master/products_service/app/repositories"
click node_product_messaging "https://github.com/geniuurievich/sneaker_store/tree/master/products_service/app/messaging"
click node_cart_api "https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/api/cart_router.py"
click node_cart_service "https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/services/CartService.py"
click node_cart_store "https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/repositories/CartRepositories.py"
click node_cart_listener "https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/message/listen.py"
click node_order_api "https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/api/order.py"
click node_order_service "https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/services/Order_service.py"
click node_order_store "https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/Repositories/OrderRepositories.py"

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_user_api,node_auth,node_user_store,node_user_events toneBlue
class node_product_api,node_product_service,node_catalog_store,node_product_messaging toneAmber
class node_cart_api,node_cart_service,node_cart_store,node_cart_listener toneMint
class node_order_api,node_order_service,node_order_store toneRose
class node_shopper,node_admin,node_message_broker toneIndigo
```

## Components

### Identity

- [Auth and user API](https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/api): `users_service/app/api`
- [Authentication](https://github.com/geniuurievich/sneaker_store/blob/master/users_service/app/services/AuthService.py): `users_service/app/services/AuthService.py`
- [User and token data](https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/repositories): `users_service/app/repositories`
- [User messaging](https://github.com/geniuurievich/sneaker_store/tree/master/users_service/app/messaging): `users_service/app/messaging`

### Catalog

- [Product API](https://github.com/geniuurievich/sneaker_store/blob/master/products_service/app/api/product_router.py): `products_service/app/api/product_router.py`
- [Product management](https://github.com/geniuurievich/sneaker_store/blob/master/products_service/app/services/ProductService.py): `products_service/app/services/ProductService.py`
- [Catalog and sizes](https://github.com/geniuurievich/sneaker_store/tree/master/products_service/app/repositories): `products_service/app/repositories`
- [Product messaging](https://github.com/geniuurievich/sneaker_store/tree/master/products_service/app/messaging): `products_service/app/messaging`

### Cart

- [Cart API](https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/api/cart_router.py): `cart_service/app/api/cart_router.py`
- [Cart operations](https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/services/CartService.py): `cart_service/app/services/CartService.py`
- [Cart data](https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/repositories/CartRepositories.py): `cart_service/app/repositories/CartRepositories.py`
- [Cart listener](https://github.com/geniuurievich/sneaker_store/blob/master/cart_service/app/message/listen.py): `cart_service/app/message/listen.py`

### Orders

- [Order API](https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/api/order.py): `orders_service/app/api/order.py`
- [Order workflow](https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/services/Order_service.py): `orders_service/app/services/Order_service.py`
- [Order data](https://github.com/geniuurievich/sneaker_store/blob/master/orders_service/app/Repositories/OrderRepositories.py): `orders_service/app/Repositories/OrderRepositories.py`

### Other components

- **Shopper**
- **Administrator**
- **Message broker**

## Connections

- Shopper → Auth and user API: authenticates
- Auth and user API → Authentication: routes auth (evidence: `users_service/app/api/auth.py`)
- Authentication → User and token data: reads and writes (evidence: `users_service/app/services/AuthService.py`)
- Authentication → User messaging: publishes registration (evidence: `users_service/app/services/AuthService.py`)
- User messaging → Message broker: publishes events
- Shopper → Product API: browses catalog
- Administrator → Product API: manages catalog
- Product API → Product management: routes product actions (evidence: `products_service/app/api/product_router.py`)
- Product management → Catalog and sizes: queries catalog (evidence: `products_service/app/services/ProductService.py`)
- Product management → Auth and user API: checks role (evidence: `products_service/app/services/ProductService.py`)
- Product messaging → Message broker: listens for events
- Shopper → Cart API: manages cart
- Cart API → Cart operations: routes cart actions (evidence: `cart_service/app/api/cart_router.py`)
- Cart operations → Cart data: reads and writes (evidence: `cart_service/app/services/CartService.py`)
- Cart operations → Product API: fetches product (evidence: `cart_service/app/services/CartService.py`)
- Cart operations → Auth and user API: resolves user (evidence: `cart_service/app/services/CartService.py`)
- Cart listener → Cart data: updates cart (evidence: `cart_service/app/message/listen.py`)
- Cart listener → Message broker: listens for events
- Shopper → Order API: places and views orders
- Order API → Order workflow: routes order actions
- Order workflow → Auth and user API: resolves token (evidence: `orders_service/app/services/Order_service.py`)
- Order workflow → Cart API: fetches and clears cart (evidence: `orders_service/app/services/Order_service.py`)
- Order workflow → Product API: checks and updates stock (evidence: `orders_service/app/services/Order_service.py`)
- Order workflow → Order data: creates and queries orders (evidence: `orders_service/app/services/Order_service.py`)
- Order workflow → Product messaging: requests order updates (evidence: `orders_service/app/services/Order_service.py`)
- Order workflow → Message broker: coordinates events
