How sgcm14/tienda-virtual works
1. Repository type
- This is a fully static front-end project for a pet store (“Tienda Virtual de Mascotas / PetShop”).
- There is no backend, database, or build pipeline in the repo; all behavior runs in the browser using HTML, CSS, and vanilla JavaScript.
2. Top-level site structure
- The app is split into five user-facing pages:
- index.html — home/landing page
- nosotros.html — about page
- productos.html — product catalog and cart interaction
- carrito.html — checkout/cart review page
- contacto.html — contact page
- This is a multi-page site rather than a single-page app.
3. Global presentation layer
- assets/css/style.css is the shared stylesheet that defines the site-wide visual layout.
- assets/img/ contains the product and UI imagery used by the pages.
- The design is a conventional ecommerce-style storefront with a hero/slider, product cards, modal image viewing, and cart UI.
4. Shared front-end behavior
- assets/js/scripts.js appears to hold common UI logic used across pages, such as navigation behavior, slider interaction, modal handling, or other site-wide effects.
- This is the main “shared client-side layer” for presentation behavior.
5. Product catalog subsystem
- productos.html is the core shopping surface.
- It presents a list of products, hover effects, and click-to-open product images in a modal.
- Each product card includes a “comprar” action that adds the item to the cart.
6. Cart interaction subsystem
- assets/js/carrito.js likely manages the cart dropdown/submenu shown from the top-right cart icon on the product page.
- This layer handles the visible cart contents, item removal via the “x”, and the “vaciar carrito” action.
- The cart is clearly intended to persist beyond a single click, so the browser-side state is central to the architecture.
7. Checkout / purchase flow
- assets/js/compra.js and assets/js/pedido.js are the checkout-related scripts.
- The flow described in the README is:
- user adds products on the catalog page
- opens the cart
- chooses “procesar compra”
- is redirected to carrito.html
- reviews selected items and fills in customer data
- This page is the handoff point from product selection to order submission.
8. State propagation across pages
- Since the site moves from productos.html to carrito.html, cart contents must be carried across page navigation using browser-side state.
- The repo does not show a server session or API, so the architecture is almost certainly client-only persistence, most likely via browser storage or equivalent JS-managed state.
9. Contact subsystem
- contacto.html plus assets/js/contacto.js implement the contact form or contact interaction.
- This is a separate user path from shopping, intended for inquiries rather than purchase flow.
10. User experience boundaries
- There are three clear UX zones:
- Browse/learn: home and about pages
- Shop: catalog with cart controls
- Finalize/contact: cart checkout and contact form
- The repository keeps these concerns separated by page and by script file.
11. Documentation and reference assets
- doc/ contains screenshots used in the README to document each screen and interaction.
- These are not runtime dependencies, but they help explain intended behavior and UI states.
12. Important architectural takeaway
- The whole system is a static ecommerce prototype implemented entirely in the browser.
- The main “integration points” are not services or APIs, but page navigation, shared assets, and client-side cart state.
- Any diagram of this repo should center on the browser as the runtime, with HTML pages as entry points and JavaScript modules as behavior layers.
Main entry points: productos.html Catalog · carrito.html Checkout · style.css Styles · doc Screenshots
Components 15
Runtime
Browser-executed static site
- Browser · Executes the static storefront in-page
Pages
User-facing HTML entry points
Behavior
Client-side JavaScript layers
- Shared JS · Common UI behavior across pages
assets/js/scripts.js - Cart UI · Cart dropdown and item controls
assets/js/carrito.js - Purchase · Checkout initiation and purchase flow
assets/js/compra.js - Order Form · Order data handling on checkout page
assets/js/pedido.js - Contact JS · Contact form behavior
assets/js/contacto.js - Cart State · Client-side cart persistence across navigation
Assets
Shared styling and media
Connections 25
- Browser → Home: loads
- Browser → About: loads
- Browser → Catalog: loads
- Browser → Checkout: loads
- Browser → Contact: loads
- Home → Styles: uses
- Home → Shared JS: uses
- About → Styles: uses
- About → Shared JS: uses
- Catalog → Styles: uses
- Catalog → Shared JS: uses
- Catalog → Cart UI: uses
- Catalog → Images: shows
- Catalog → Cart State: updates
- Cart UI → Cart State: reads/writes
- Checkout → Styles: uses
- Checkout → Purchase: uses
- Checkout → Order Form: uses
- Checkout → Cart State: reads
- Contact → Styles: uses
- Contact → Contact JS: uses
- Screenshots → Home: documents
- Screenshots → Catalog: documents
- Screenshots → Checkout: documents
- Screenshots → Contact: documents