# beniciocaraccio77/tp-final-leo architecture

> Architecture diagram of the GitHub repository beniciocaraccio77/tp-final-leo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/beniciocaraccio77/tp-final-leo
- Repository: https://github.com/beniciocaraccio77/tp-final-leo

## Overview

Tienda de Pádel is a mobile storefront for browsing products, viewing details, managing a shared cart, and completing a simulated purchase. The app retrieves the catalog from a FastAPI backend; checkout validates product availability, records an order and its line items, and updates stock in Supabase. The README documents these capabilities and the Supabase-backed deployment. The sampled frontend and backend show the main calls; unsampled routing and other details are represented only where the tree or README supports them.

Main entry points: [`frontend/tienda-padel/src/app/index.jsx`](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/index.jsx) (Product catalog), [`frontend/tienda-padel/src/app/carrito/index.jsx`](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/carrito/index.jsx) (Cart and checkout), [`backend/main.py`](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/backend/main.py) (Catalog and checkout API), [`frontend/tienda-padel/styles/estilos.js`](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/styles/estilos.js) (Shared styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Product catalog<br/>[index.jsx]"]
  node_product_cards["Product cards<br/>[tarjeta.jsx]"]
  node_store_heading["Store heading<br/>[titulos.jsx]"]
  node_product_detail["Product detail<br/>[&#91;id&#93;.jsx]"]
  node_app_routes["App routes<br/>[_layout.jsx]"]
  node_shared_styles["Shared styling<br/>[estilos.js]"]
end

subgraph group_basket["Cart and checkout"]
  node_cart_state["Shared cart state<br/>[useCarrito.js]"]
  node_cart_checkout["Cart and checkout<br/>[index.jsx]"]
end

subgraph group_backend["Backend API"]
  node_backend_api["Catalog and checkout API<br/>[main.py]"]
end

subgraph group_data["Supabase data"]
  node_supabase_config["Supabase client<br/>[supabase.py]"]
  node_product_store[("Product and order data")]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_home
node_home -->|"fetches catalog"| node_backend_api
node_home -->|"renders"| node_product_cards
node_home -->|"renders"| node_store_heading
node_home -->|"opens details"| node_product_detail
node_product_detail -->|"adds product"| node_cart_state
node_cart_checkout -->|"reads and updates"| node_cart_state
node_shopper -->|"checks out"| node_cart_checkout
node_cart_checkout -->|"posts checkout"| node_backend_api
node_backend_api -->|"uses client"| node_supabase_config
node_backend_api -->|"reads and writes"| node_product_store
node_supabase_config -->|"connects to"| node_product_store
node_home -->|"uses styles"| node_shared_styles
node_product_cards -->|"uses styles"| node_shared_styles
node_cart_checkout -->|"uses styles"| node_shared_styles

click node_home "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/index.jsx"
click node_product_cards "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/components/tarjeta.jsx"
click node_store_heading "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/components/titulos.jsx"
click node_product_detail "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/detalle/%5Bid%5D.jsx"
click node_app_routes "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/_layout.jsx"
click node_cart_state "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/hooks/useCarrito.js"
click node_cart_checkout "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/carrito/index.jsx"
click node_shared_styles "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/styles/estilos.js"
click node_backend_api "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/backend/main.py"
click node_supabase_config "https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/backend/config/supabase.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_home,node_product_cards,node_store_heading,node_product_detail,node_app_routes,node_shared_styles toneBlue
class node_cart_state,node_cart_checkout toneAmber
class node_backend_api toneMint
class node_supabase_config,node_product_store toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Product catalog](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/index.jsx): `frontend/tienda-padel/src/app/index.jsx`
- [Product cards](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/components/tarjeta.jsx): `frontend/tienda-padel/components/tarjeta.jsx`
- [Store heading](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/components/titulos.jsx): `frontend/tienda-padel/components/titulos.jsx`
- [Product detail](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/detalle/%5Bid%5D.jsx): `frontend/tienda-padel/src/app/detalle/[id].jsx`
- [App routes](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/_layout.jsx): `frontend/tienda-padel/src/app/_layout.jsx`
- [Shared styling](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/styles/estilos.js): `frontend/tienda-padel/styles/estilos.js`

### Cart and checkout

- [Shared cart state](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/hooks/useCarrito.js): `frontend/tienda-padel/hooks/useCarrito.js`
- [Cart and checkout](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/frontend/tienda-padel/src/app/carrito/index.jsx): `frontend/tienda-padel/src/app/carrito/index.jsx`

### Backend API

- [Catalog and checkout API](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/backend/main.py): `backend/main.py`

### Supabase data

- [Supabase client](https://github.com/beniciocaraccio77/tp-final-leo/blob/Benicio/backend/config/supabase.py): `backend/config/supabase.py`
- **Product and order data**

### Other components

- **Shopper**

## Connections

- Shopper → Product catalog: browses (evidence: `README.md`)
- Product catalog → Catalog and checkout API: fetches catalog (evidence: `frontend/tienda-padel/src/app/index.jsx`)
- Product catalog → Product cards: renders (evidence: `frontend/tienda-padel/src/app/index.jsx`)
- Product catalog → Store heading: renders (evidence: `frontend/tienda-padel/src/app/index.jsx`)
- Product catalog → Product detail: opens details (evidence: `frontend/tienda-padel/src/app/index.jsx`)
- Product detail → Shared cart state: adds product (evidence: `frontend/tienda-padel/src/app/detalle/[id].jsx`)
- Cart and checkout → Shared cart state: reads and updates (evidence: `frontend/tienda-padel/src/app/carrito/index.jsx`)
- Shopper → Cart and checkout: checks out (evidence: `README.md`)
- Cart and checkout → Catalog and checkout API: posts checkout (evidence: `frontend/tienda-padel/src/app/carrito/index.jsx`)
- Catalog and checkout API → Supabase client: uses client (evidence: `backend/main.py`)
- Catalog and checkout API → Product and order data: reads and writes (evidence: `backend/main.py`)
- Supabase client → Product and order data: connects to (evidence: `backend/config/supabase.py`)
- Product catalog → Shared styling: uses styles (evidence: `frontend/tienda-padel/src/app/index.jsx`)
- Product cards → Shared styling: uses styles (evidence: `frontend/tienda-padel/components/tarjeta.jsx`)
- Cart and checkout → Shared styling: uses styles (evidence: `frontend/tienda-padel/src/app/carrito/index.jsx`)
