# alexsegovia06/socoblocks-ui architecture

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

- Interactive diagram: https://gitdiagram.com/alexsegovia06/socoblocks-ui
- Repository: https://github.com/alexsegovia06/socoblocks-ui

## Overview

SocoBlocks UI is a React marketplace frontend. The main journey is browsing/filtering the catalog, viewing a set, authenticating when required, adding it to the server-backed cart, and checking out into an order; role-protected areas support collectors, sellers, and administrators. The graph preserves those role-specific capabilities and the local wishlist/collection and review-moderation features. Some page implementations were not sampled, so their internal calls are omitted; route relationships are supported by App.tsx and additional capabilities by the README.

Main entry points: [`src/App.tsx`](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/App.tsx) (Route application), [`src/catalogo/useCatalogo.ts`](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/catalogo/useCatalogo.ts) (Catalog data), [`src/pages/ProductPage/ProductPage.tsx`](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/ProductPage/ProductPage.tsx) (Set details), [`src/api.ts`](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/api.ts) (HTTP API wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_routes["Route application<br/>[App.tsx]"]
  node_layout["Shared layout<br/>[Layout.tsx]"]
end

subgraph group_commerce["Marketplace commerce"]
  node_catalog["Catalog browsing<br/>[CatalogPage.tsx]"]
  node_catalog_data["Catalog data<br/>[useCatalogo.ts]"]
  node_set_detail["Set details<br/>[ProductPage.tsx]"]
  node_cart["Cart state<br/>[CarritoContext.tsx]"]
  node_cart_lines["Cart lines"]
  node_cart_action["Add to cart"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_orders["Order operations<br/>[pedidos.ts]"]
end

subgraph group_accounts["Accounts and lists"]
  node_login["Login and registration<br/>[LoginPage.tsx]"]
  node_auth["Session and JWT<br/>[AuthContext.tsx]"]
  node_guards["Role guards<br/>[guards.tsx]"]
  node_lists[("Wishlist and collection<br/>[useListaDeSets.ts]")]
end

subgraph group_operations["Role operations"]
  node_user_pages["Collector pages"]
  node_seller_pages["Seller pages"]
  node_admin_pages["Admin pages"]
  node_review_state["Review moderation"]
end

subgraph group_shared["Shared services"]
  node_api["HTTP API wrapper<br/>[api.ts]"]
  node_toasts["Toast notifications<br/>[ToastContext.tsx]"]
  node_set_state[("Set publication state<br/>[useEstadoSets.ts]")]
end

node_visitor(("Visitor"))
node_collector(("Collector"))
node_seller(("Seller"))
node_admin(("Administrator"))
node_backend["Spring Boot backend"]

node_visitor -->|"opens"| node_routes
node_collector -->|"opens"| node_routes
node_seller -->|"opens"| node_routes
node_admin -->|"opens"| node_routes
node_routes -->|"wraps routes"| node_layout
node_routes -->|"routes to"| node_catalog
node_routes -->|"routes to"| node_set_detail
node_routes -->|"routes to"| node_login
node_routes -->|"role routes"| node_user_pages
node_routes -->|"role routes"| node_seller_pages
node_routes -->|"role routes"| node_admin_pages
node_routes -->|"guards with"| node_guards
node_catalog -->|"loads sets"| node_catalog_data
node_set_detail -->|"loads sets"| node_catalog_data
node_set_detail -->|"offers add"| node_cart_action
node_cart_action -->|"adds items"| node_cart
node_cart -->|"requests cart"| node_api
node_cart_lines -->|"reads items"| node_cart
node_cart_lines -->|"joins catalog"| node_catalog_data
node_checkout -->|"uses lines"| node_cart_lines
node_checkout -->|"creates orders"| node_orders
node_login -->|"authenticates"| node_auth
node_auth -->|"calls API"| node_api
node_auth -->|"auth endpoints"| node_backend
node_catalog_data -->|"fetches catalog"| node_api
node_api -->|"sends requests"| node_backend
node_user_pages -.->|"uses lists"| node_lists
node_set_detail -->|"uses wishlist"| node_lists
node_admin_pages -->|"moderates reviews"| node_review_state
node_admin_pages -->|"reads catalog"| node_catalog_data
node_seller_pages -->|"reads catalog"| node_catalog_data
node_seller_pages -->|"changes status"| node_set_state
node_cart_action -->|"shows feedback"| node_toasts

click node_routes "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/App.tsx"
click node_layout "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/components/Layout/Layout.tsx"
click node_catalog "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/CatalogPage/CatalogPage.tsx"
click node_catalog_data "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/catalogo/useCatalogo.ts"
click node_set_detail "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/ProductPage/ProductPage.tsx"
click node_cart "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/carrito/CarritoContext.tsx"
click node_cart_lines "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/carrito/useLineasCarrito.ts"
click node_cart_action "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/carrito/useAgregarAlCarrito.ts"
click node_checkout "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/CheckoutPage/CheckoutPage.tsx"
click node_orders "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pedidos/pedidos.ts"
click node_login "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/LoginPage/LoginPage.tsx"
click node_auth "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/auth/AuthContext.tsx"
click node_guards "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/auth/guards.tsx"
click node_lists "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/listas/useListaDeSets.ts"
click node_user_pages "https://github.com/alexsegovia06/socoblocks-ui/tree/master/src/pages/user"
click node_seller_pages "https://github.com/alexsegovia06/socoblocks-ui/tree/master/src/pages/seller"
click node_admin_pages "https://github.com/alexsegovia06/socoblocks-ui/tree/master/src/pages/admin"
click node_review_state "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/resenas/useResenasOcultas.ts"
click node_api "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/api.ts"
click node_toasts "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/toast/ToastContext.tsx"
click node_set_state "https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/catalogo/useEstadoSets.ts"

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_routes,node_layout toneBlue
class node_catalog,node_catalog_data,node_set_detail,node_cart,node_cart_lines,node_cart_action,node_checkout,node_orders toneAmber
class node_login,node_auth,node_guards,node_lists toneMint
class node_user_pages,node_seller_pages,node_admin_pages,node_review_state toneRose
class node_api,node_toasts,node_set_state,node_visitor,node_collector,node_seller,node_admin,node_backend toneIndigo
```

## Components

### App and access

- [Route application](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/App.tsx): `src/App.tsx`
- [Shared layout](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/components/Layout/Layout.tsx): `src/components/Layout/Layout.tsx`

### Marketplace commerce

- [Catalog browsing](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/CatalogPage/CatalogPage.tsx): `src/pages/CatalogPage/CatalogPage.tsx`
- [Catalog data](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/catalogo/useCatalogo.ts): `src/catalogo/useCatalogo.ts`
- [Set details](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/ProductPage/ProductPage.tsx): `src/pages/ProductPage/ProductPage.tsx`
- [Cart state](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/carrito/CarritoContext.tsx): `src/carrito/CarritoContext.tsx`
- [Cart lines](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/carrito/useLineasCarrito.ts): `src/carrito/useLineasCarrito.ts`
- [Add to cart](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/carrito/useAgregarAlCarrito.ts): `src/carrito/useAgregarAlCarrito.ts`
- [Checkout](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/CheckoutPage/CheckoutPage.tsx): `src/pages/CheckoutPage/CheckoutPage.tsx`
- [Order operations](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pedidos/pedidos.ts): `src/pedidos/pedidos.ts`

### Accounts and lists

- [Login and registration](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/pages/LoginPage/LoginPage.tsx): `src/pages/LoginPage/LoginPage.tsx`
- [Session and JWT](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/auth/AuthContext.tsx): `src/auth/AuthContext.tsx`
- [Role guards](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/auth/guards.tsx): `src/auth/guards.tsx`
- [Wishlist and collection](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/listas/useListaDeSets.ts): `src/listas/useListaDeSets.ts`

### Role operations

- [Collector pages](https://github.com/alexsegovia06/socoblocks-ui/tree/master/src/pages/user): `src/pages/user`
- [Seller pages](https://github.com/alexsegovia06/socoblocks-ui/tree/master/src/pages/seller): `src/pages/seller`
- [Admin pages](https://github.com/alexsegovia06/socoblocks-ui/tree/master/src/pages/admin): `src/pages/admin`
- [Review moderation](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/resenas/useResenasOcultas.ts): `src/resenas/useResenasOcultas.ts`

### Shared services

- [HTTP API wrapper](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/api.ts): `src/api.ts`
- [Toast notifications](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/toast/ToastContext.tsx): `src/toast/ToastContext.tsx`
- [Set publication state](https://github.com/alexsegovia06/socoblocks-ui/blob/master/src/catalogo/useEstadoSets.ts): `src/catalogo/useEstadoSets.ts`

### Other components

- **Visitor**
- **Collector**
- **Seller**
- **Administrator**
- **Spring Boot backend**

## Connections

- Visitor → Route application: opens (evidence: `src/App.tsx`)
- Collector → Route application: opens (evidence: `src/App.tsx`)
- Seller → Route application: opens (evidence: `src/App.tsx`)
- Administrator → Route application: opens (evidence: `src/App.tsx`)
- Route application → Shared layout: wraps routes (evidence: `src/App.tsx`)
- Route application → Catalog browsing: routes to (evidence: `src/App.tsx`)
- Route application → Set details: routes to (evidence: `src/App.tsx`)
- Route application → Login and registration: routes to (evidence: `src/App.tsx`)
- Route application → Collector pages: role routes (evidence: `src/App.tsx`)
- Route application → Seller pages: role routes (evidence: `src/App.tsx`)
- Route application → Admin pages: role routes (evidence: `src/App.tsx`)
- Route application → Role guards: guards with (evidence: `src/App.tsx`)
- Catalog browsing → Catalog data: loads sets (evidence: `src/pages/CatalogPage/CatalogPage.tsx`)
- Set details → Catalog data: loads sets (evidence: `src/pages/ProductPage/ProductPage.tsx`)
- Set details → Add to cart: offers add (evidence: `src/pages/ProductPage/ProductPage.tsx`)
- Add to cart → Cart state: adds items (evidence: `src/carrito/useAgregarAlCarrito.ts`)
- Cart state → HTTP API wrapper: requests cart (evidence: `src/carrito/CarritoContext.tsx`)
- Cart lines → Cart state: reads items (evidence: `src/carrito/useLineasCarrito.ts`)
- Cart lines → Catalog data: joins catalog (evidence: `src/carrito/useLineasCarrito.ts`)
- Checkout → Cart lines: uses lines (evidence: `src/pages/CheckoutPage/CheckoutPage.tsx`)
- Checkout → Order operations: creates orders (evidence: `src/pages/CheckoutPage/CheckoutPage.tsx`)
- Login and registration → Session and JWT: authenticates (evidence: `src/pages/LoginPage/LoginPage.tsx`)
- Session and JWT → HTTP API wrapper: calls API (evidence: `src/auth/AuthContext.tsx`)
- Session and JWT → Spring Boot backend: auth endpoints (evidence: `README.md`)
- Catalog data → HTTP API wrapper: fetches catalog (evidence: `src/catalogo/useCatalogo.ts`)
- HTTP API wrapper → Spring Boot backend: sends requests (evidence: `README.md`)
- Collector pages → Wishlist and collection: uses lists
- Set details → Wishlist and collection: uses wishlist (evidence: `src/pages/ProductPage/ProductPage.tsx`)
- Admin pages → Review moderation: moderates reviews (evidence: `src/pages/admin/AdminReviews/AdminReviews.tsx`)
- Admin pages → Catalog data: reads catalog (evidence: `src/pages/admin/AdminReviews/AdminReviews.tsx`)
- Seller pages → Catalog data: reads catalog (evidence: `src/pages/seller/SellerProducts/SellerProducts.tsx`)
- Seller pages → Set publication state: changes status (evidence: `src/catalogo/useEstadoSets.ts`)
- Add to cart → Toast notifications: shows feedback (evidence: `src/carrito/useAgregarAlCarrito.ts`)
