# thomyszh07/patitas-felices architecture

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

- Interactive diagram: https://gitdiagram.com/thomyszh07/patitas-felices
- Repository: https://github.com/thomyszh07/patitas-felices

## Overview

Patitas Felices es una tienda web de productos para mascotas. El flujo principal es consultar el catálogo, añadir productos al carrito local, confirmar datos de entrega y crear un pedido tras validar y descontar existencias; después se muestra el detalle del pedido. También incluye registro, inicio de sesión y gestión básica del perfil. La arquitectura se basa en los módulos muestreados y los comentarios de entrada; el README no aporta documentación adicional.

Main entry points: [`js/productos.js`](https://github.com/thomyszh07/patitas-felices/blob/main/js/productos.js) (Catálogo productos), [`js/pedidos.js`](https://github.com/thomyszh07/patitas-felices/blob/main/js/pedidos.js) (Pedidos y entrega), [`js/carrito.js`](https://github.com/thomyszh07/patitas-felices/blob/main/js/carrito.js) (Carrito local), [`js/notificaciones.js`](https://github.com/thomyszh07/patitas-felices/blob/main/js/notificaciones.js) (Notificaciones)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Tienda web"]
  node_home["Inicio<br/>[index.html]"]
  node_catalog_page["Catálogo<br/>[productos.html]"]
  node_cart_page["Carrito<br/>[carrito.html]"]
  node_delivery_page["Datos de entrega<br/>[datos-entrega.html]"]
  node_order_page["Detalle pedido<br/>[pedido.html]"]
  node_login_page["Inicio de sesión<br/>[login.html]"]
  node_register_page["Registro<br/>[registro.html]"]
  node_profile_page["Perfil<br/>[perfil.html]"]
end

subgraph group_commerce["Compra y pedidos"]
  node_products["Catálogo productos<br/>[productos.js]"]
  node_cart["Carrito local<br/>[carrito.js]"]
  node_orders["Pedidos y entrega<br/>[pedidos.js]"]
end

subgraph group_identity["Cuenta de usuario"]
  node_auth["Autenticación<br/>[auth.js]"]
  node_profile["Gestión perfil<br/>[perfil.js]"]
end

subgraph group_platform["Integración y estado"]
  node_entry["Entrada web<br/>[main.js]"]
  node_notices["Notificaciones<br/>[notificaciones.js]"]
  node_firebase_config["Cliente Firebase<br/>[firebase-config.js]"]
end

node_shopper(("Comprador"))
node_firebase_auth["Firebase Auth"]
node_firestore[("Firestore")]
node_local_storage[("Almacenamiento navegador")]

node_shopper -->|"visita"| node_home
node_shopper -->|"consulta"| node_catalog_page
node_shopper -->|"revisa carrito"| node_cart_page
node_shopper -->|"confirma entrega"| node_delivery_page
node_shopper -->|"consulta pedido"| node_order_page
node_shopper -->|"inicia sesión"| node_login_page
node_shopper -->|"se registra"| node_register_page
node_shopper -->|"gestiona cuenta"| node_profile_page
node_entry -->|"carga y expone"| node_products
node_entry -->|"invoca vistas"| node_cart
node_entry -->|"carga y consulta"| node_orders
node_products -->|"lee productos"| node_firestore
node_products -->|"añade producto"| node_cart
node_products -->|"notifica"| node_notices
node_cart -->|"guarda carrito"| node_local_storage
node_orders -->|"lee y vacía"| node_cart
node_orders -->|"lee pedido; descuenta stock y crea pedido"| node_firestore
node_orders -->|"notifica"| node_notices
node_auth -->|"registra e inicia sesión"| node_firebase_auth
node_auth -->|"guarda usuario"| node_firestore
node_auth -->|"notifica"| node_notices
node_profile -->|"verifica y cambia clave"| node_firebase_auth
node_profile -->|"notifica"| node_notices
node_firebase_config -->|"inicializa cliente"| node_firebase_auth
node_firebase_config -->|"inicializa cliente"| node_firestore

click node_home "https://github.com/thomyszh07/patitas-felices/blob/main/index.html"
click node_catalog_page "https://github.com/thomyszh07/patitas-felices/blob/main/productos.html"
click node_cart_page "https://github.com/thomyszh07/patitas-felices/blob/main/carrito.html"
click node_delivery_page "https://github.com/thomyszh07/patitas-felices/blob/main/datos-entrega.html"
click node_order_page "https://github.com/thomyszh07/patitas-felices/blob/main/pedido.html"
click node_login_page "https://github.com/thomyszh07/patitas-felices/blob/main/login.html"
click node_register_page "https://github.com/thomyszh07/patitas-felices/blob/main/registro.html"
click node_profile_page "https://github.com/thomyszh07/patitas-felices/blob/main/perfil.html"
click node_entry "https://github.com/thomyszh07/patitas-felices/blob/main/js/main.js"
click node_products "https://github.com/thomyszh07/patitas-felices/blob/main/js/productos.js"
click node_cart "https://github.com/thomyszh07/patitas-felices/blob/main/js/carrito.js"
click node_orders "https://github.com/thomyszh07/patitas-felices/blob/main/js/pedidos.js"
click node_auth "https://github.com/thomyszh07/patitas-felices/blob/main/js/auth.js"
click node_profile "https://github.com/thomyszh07/patitas-felices/blob/main/js/perfil.js"
click node_notices "https://github.com/thomyszh07/patitas-felices/blob/main/js/notificaciones.js"
click node_firebase_config "https://github.com/thomyszh07/patitas-felices/blob/main/js/firebase-config.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_home,node_catalog_page,node_cart_page,node_delivery_page,node_order_page,node_login_page,node_register_page,node_profile_page toneBlue
class node_products,node_cart,node_orders,node_firestore,node_local_storage toneAmber
class node_auth,node_profile toneMint
class node_entry,node_notices,node_firebase_config toneRose
class node_shopper,node_firebase_auth toneIndigo
```

## Components

### Tienda web

- [Inicio](https://github.com/thomyszh07/patitas-felices/blob/main/index.html): `index.html`
- [Catálogo](https://github.com/thomyszh07/patitas-felices/blob/main/productos.html): `productos.html`
- [Carrito](https://github.com/thomyszh07/patitas-felices/blob/main/carrito.html): `carrito.html`
- [Datos de entrega](https://github.com/thomyszh07/patitas-felices/blob/main/datos-entrega.html): `datos-entrega.html`
- [Detalle pedido](https://github.com/thomyszh07/patitas-felices/blob/main/pedido.html): `pedido.html`
- [Inicio de sesión](https://github.com/thomyszh07/patitas-felices/blob/main/login.html): `login.html`
- [Registro](https://github.com/thomyszh07/patitas-felices/blob/main/registro.html): `registro.html`
- [Perfil](https://github.com/thomyszh07/patitas-felices/blob/main/perfil.html): `perfil.html`

### Compra y pedidos

- [Catálogo productos](https://github.com/thomyszh07/patitas-felices/blob/main/js/productos.js): `js/productos.js`
- [Carrito local](https://github.com/thomyszh07/patitas-felices/blob/main/js/carrito.js): `js/carrito.js`
- [Pedidos y entrega](https://github.com/thomyszh07/patitas-felices/blob/main/js/pedidos.js): `js/pedidos.js`

### Cuenta de usuario

- [Autenticación](https://github.com/thomyszh07/patitas-felices/blob/main/js/auth.js): `js/auth.js`
- [Gestión perfil](https://github.com/thomyszh07/patitas-felices/blob/main/js/perfil.js): `js/perfil.js`

### Integración y estado

- [Entrada web](https://github.com/thomyszh07/patitas-felices/blob/main/js/main.js): `js/main.js`
- [Notificaciones](https://github.com/thomyszh07/patitas-felices/blob/main/js/notificaciones.js): `js/notificaciones.js`
- [Cliente Firebase](https://github.com/thomyszh07/patitas-felices/blob/main/js/firebase-config.js): `js/firebase-config.js`

### Other components

- **Comprador**
- **Firebase Auth**
- **Firestore**
- **Almacenamiento navegador**

## Connections

- Comprador → Inicio: visita
- Comprador → Catálogo: consulta
- Comprador → Carrito: revisa carrito
- Comprador → Datos de entrega: confirma entrega
- Comprador → Detalle pedido: consulta pedido
- Comprador → Inicio de sesión: inicia sesión
- Comprador → Registro: se registra
- Comprador → Perfil: gestiona cuenta
- Entrada web → Catálogo productos: carga y expone
- Entrada web → Carrito local: invoca vistas
- Entrada web → Pedidos y entrega: carga y consulta
- Catálogo productos → Firestore: lee productos
- Catálogo productos → Carrito local: añade producto
- Catálogo productos → Notificaciones: notifica
- Carrito local → Almacenamiento navegador: guarda carrito
- Pedidos y entrega → Carrito local: lee y vacía
- Pedidos y entrega → Firestore: lee pedido; descuenta stock y crea pedido
- Pedidos y entrega → Notificaciones: notifica
- Autenticación → Firebase Auth: registra e inicia sesión
- Autenticación → Firestore: guarda usuario
- Autenticación → Notificaciones: notifica
- Gestión perfil → Firebase Auth: verifica y cambia clave
- Gestión perfil → Notificaciones: notifica
- Cliente Firebase → Firebase Auth: inicializa cliente
- Cliente Firebase → Firestore: inicializa cliente
