# codedbymethegreatest/tienda-sonido-vivo architecture

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

- Interactive diagram: https://gitdiagram.com/codedbymethegreatest/tienda-sonido-vivo
- Repository: https://github.com/codedbymethegreatest/tienda-sonido-vivo

## Overview

Jelico is the React frontend for Sonido Vivo, an instrument and audio-equipment shop. Customers browse and filter the catalog, manage a cart, authenticate, place orders, and review order status; staff manage products, stock, orders, users, and reports. The documented runtime flow is pages → shared contexts → API services → DTOs/Axios → REST API. The graph reflects that documented flow and sampled calls; unsampled page and service internals are represented at their existing directories, so some links are documented rather than source-verified.

Main entry points: [`src/services/api.js`](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/api.js) (Axios client), [`src/App.jsx`](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/App.jsx) (Route application), [`src/pages`](https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages) (Shop pages), [`src/context/SesionContext.jsx`](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/SesionContext.jsx) (Session context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_store["Storefront"]
  node_app["Route application<br/>[App.jsx]"]
  node_storepages["Shop pages"]
  node_catalog["Catalog context<br/>[ProductContext.jsx]"]
end

subgraph group_commerce["Orders"]
  node_cart["Cart context<br/>[CarritoContext.jsx]"]
  node_checkout["Checkout hook<br/>[useCheckout.js]"]
  node_orderpages["Order pages"]
  node_orders["Order context<br/>[PedidoContext.jsx]"]
end

subgraph group_identity["Identity"]
  node_authpages["Login and registration"]
  node_authhooks["Auth hooks"]
  node_session["Session context<br/>[SesionContext.jsx]"]
  node_users["User context<br/>[UsuarioContext.jsx]"]
  node_guard["Protected routes"]
end

subgraph group_admin["Staff tools"]
  node_adminorders["Order administration<br/>[AdminPedidos.jsx]"]
  node_adminproducts["Product administration<br/>[AdminProductos.jsx]"]
  node_adminusers["User administration<br/>[AdminUsuarios.jsx]"]
  node_reports["Sales and stock reports<br/>[AdminReportes.jsx]"]
end

subgraph group_integration["API integration"]
  node_productservice["Product API service"]
  node_orderservice["Order API service"]
  node_authservice["Auth service<br/>[authService.js]"]
  node_userapi["User API service"]
  node_reportapi["Reports API service"]
  node_dtos["API DTOs"]
  node_http["Axios client<br/>[api.js]"]
end

node_customer(("Shopper / staff"))
node_backend{{"REST API"}}
node_database[("PostgreSQL")]

node_customer -->|"opens"| node_app
node_app -->|"routes to"| node_storepages
node_app -->|"routes to"| node_orderpages
node_app -->|"routes to"| node_authpages
node_app -->|"protects routes"| node_guard
node_storepages -.->|"uses"| node_catalog
node_catalog -->|"loads products"| node_productservice
node_productservice -->|"maps products"| node_dtos
node_storepages -.->|"uses"| node_cart
node_orderpages -.->|"uses"| node_checkout
node_checkout -->|"validates cart"| node_cart
node_orderpages -.->|"uses"| node_orders
node_orders -->|"requests orders"| node_orderservice
node_orderservice -->|"maps orders"| node_dtos
node_authpages -.->|"uses"| node_authhooks
node_authhooks -.->|"uses"| node_session
node_session -->|"authenticates"| node_authservice
node_users -->|"requests users"| node_userapi
node_session -->|"supplies session"| node_guard
node_adminorders -->|"reads and updates"| node_orders
node_adminproducts -->|"manages products"| node_catalog
node_adminusers -.->|"manages users"| node_users
node_reports -->|"requests reports"| node_reportapi
node_authservice -->|"sends requests"| node_http
node_userapi -.->|"sends requests"| node_http
node_orderservice -->|"sends requests"| node_http
node_productservice -->|"sends requests"| node_http
node_reportapi -->|"sends requests"| node_http
node_http -->|"calls REST API"| node_backend
node_backend -->|"reads and writes"| node_database

click node_app "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/App.jsx"
click node_storepages "https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages"
click node_catalog "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/ProductContext.jsx"
click node_productservice "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/productoApiService.js"
click node_cart "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/CarritoContext.jsx"
click node_checkout "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/hooks/useCheckout.js"
click node_orderpages "https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages"
click node_orders "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/PedidoContext.jsx"
click node_orderservice "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/pedidoApiService.js"
click node_authpages "https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages"
click node_authhooks "https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/hooks"
click node_session "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/SesionContext.jsx"
click node_users "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/UsuarioContext.jsx"
click node_authservice "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/authService.js"
click node_userapi "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/usuarioApiService.js"
click node_guard "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/routes/RutasProtegidas.jsx"
click node_adminorders "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminPedidos.jsx"
click node_adminproducts "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminProductos.jsx"
click node_adminusers "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminUsuarios.jsx"
click node_reports "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminReportes.jsx"
click node_reportapi "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/reporteApiService.js"
click node_dtos "https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/dto"
click node_http "https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/api.js"

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_app,node_storepages,node_catalog toneBlue
class node_cart,node_checkout,node_orderpages,node_orders,node_database toneAmber
class node_authpages,node_authhooks,node_session,node_users,node_guard,node_backend toneMint
class node_adminorders,node_adminproducts,node_adminusers,node_reports toneRose
class node_productservice,node_orderservice,node_authservice,node_userapi,node_reportapi,node_dtos,node_http,node_customer toneIndigo
```

## Components

### Storefront

- [Route application](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/App.jsx): `src/App.jsx`
- [Shop pages](https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages): `src/pages`
- [Catalog context](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/ProductContext.jsx): `src/context/ProductContext.jsx`

### Orders

- [Cart context](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/CarritoContext.jsx): `src/context/CarritoContext.jsx`
- [Checkout hook](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/hooks/useCheckout.js): `src/hooks/useCheckout.js`
- [Order pages](https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages): `src/pages`
- [Order context](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/PedidoContext.jsx): `src/context/PedidoContext.jsx`

### Identity

- [Login and registration](https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/pages): `src/pages`
- [Auth hooks](https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/hooks): `src/hooks`
- [Session context](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/SesionContext.jsx): `src/context/SesionContext.jsx`
- [User context](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/context/UsuarioContext.jsx): `src/context/UsuarioContext.jsx`
- [Protected routes](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/routes/RutasProtegidas.jsx): `src/routes/RutasProtegidas.jsx`

### Staff tools

- [Order administration](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminPedidos.jsx): `src/pages/AdminPedidos.jsx`
- [Product administration](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminProductos.jsx): `src/pages/AdminProductos.jsx`
- [User administration](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminUsuarios.jsx): `src/pages/AdminUsuarios.jsx`
- [Sales and stock reports](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/pages/AdminReportes.jsx): `src/pages/AdminReportes.jsx`

### API integration

- [Product API service](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/productoApiService.js): `src/services/productoApiService.js`
- [Order API service](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/pedidoApiService.js): `src/services/pedidoApiService.js`
- [Auth service](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/authService.js): `src/services/authService.js`
- [User API service](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/usuarioApiService.js): `src/services/usuarioApiService.js`
- [Reports API service](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/reporteApiService.js): `src/services/reporteApiService.js`
- [API DTOs](https://github.com/codedbymethegreatest/tienda-sonido-vivo/tree/main/src/dto): `src/dto`
- [Axios client](https://github.com/codedbymethegreatest/tienda-sonido-vivo/blob/main/src/services/api.js): `src/services/api.js`

### Other components

- **Shopper / staff**
- **REST API**
- **PostgreSQL**

## Connections

- Shopper / staff → Route application: opens (evidence: `src/App.jsx`)
- Route application → Shop pages: routes to (evidence: `src/App.jsx`)
- Route application → Order pages: routes to (evidence: `src/App.jsx`)
- Route application → Login and registration: routes to (evidence: `src/App.jsx`)
- Route application → Protected routes: protects routes (evidence: `src/App.jsx`)
- Shop pages → Catalog context: uses (evidence: `src/pages/AdminProductos.jsx`)
- Catalog context → Product API service: loads products (evidence: `src/context/ProductContext.jsx`)
- Product API service → API DTOs: maps products (evidence: `src/services/productoApiService.js`)
- Shop pages → Cart context: uses
- Order pages → Checkout hook: uses
- Checkout hook → Cart context: validates cart (evidence: `src/hooks/useCheckout.js`)
- Order pages → Order context: uses (evidence: `src/pages/AdminPedidos.jsx`)
- Order context → Order API service: requests orders (evidence: `src/context/PedidoContext.jsx`)
- Order API service → API DTOs: maps orders (evidence: `src/services/pedidoApiService.js`)
- Login and registration → Auth hooks: uses (evidence: `src/pages/AdminReportes.jsx`)
- Auth hooks → Session context: uses
- Session context → Auth service: authenticates (evidence: `src/context/SesionContext.jsx`)
- User context → User API service: requests users (evidence: `src/context/UsuarioContext.jsx`)
- Session context → Protected routes: supplies session (evidence: `src/routes/RutasProtegidas.jsx`)
- Order administration → Order context: reads and updates (evidence: `src/pages/AdminPedidos.jsx`)
- Product administration → Catalog context: manages products (evidence: `src/pages/AdminProductos.jsx`)
- User administration → User context: manages users (evidence: `src/pages/AdminUsuarios.jsx`)
- Sales and stock reports → Reports API service: requests reports (evidence: `src/pages/AdminReportes.jsx`)
- Auth service → Axios client: sends requests (evidence: `src/services/authService.js`)
- User API service → Axios client: sends requests (evidence: `src/services/usuarioApiService.js`)
- Order API service → Axios client: sends requests (evidence: `src/services/pedidoApiService.js`)
- Product API service → Axios client: sends requests (evidence: `src/services/productoApiService.js`)
- Reports API service → Axios client: sends requests (evidence: `src/services/reporteApiService.js`)
- Axios client → REST API: calls REST API (evidence: `README.md`)
- REST API → PostgreSQL: reads and writes (evidence: `README.md`)
