# juan-moresi/proyectofinal-moresi architecture

> Architecture diagram of the GitHub repository juan-moresi/proyectofinal-moresi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/juan-moresi/proyectofinal-moresi
- Repository: https://github.com/juan-moresi/proyectofinal-moresi

## Overview

##### Project type and purpose
- From the file tree and README, Sneakers Shop is a full-stack e-commerce web app built in React (Frontend) that uses Firebase (Backend as a Service) for data storage and retrieval. It implements a product catalog, shopping cart with localStorage persistence, checkout form, and contact page.

##### File structure
- Top-level: index.html, package.json, vite.config.js → front-end scaffolding with Vite.
- src/main.jsx & src/index.css → app entry point and global styles.
- src/App.jsx → root React component.
- src/components/… → UI layer subdivided into page-level containers (e.g., ItemListContainer, ItemDetailContainer) and atomic/component widgets (NavBar, CartWidget, ItemCount, etc.).
- src/context/CartContext.jsx → Context API provider for global cart state.
- src/services/firebaseService.jsx → abstraction over Firebase SDK for product/category/order queries.
- src/assets → static images/fonts.
- Configuration files (eslint.config.js, .gitignore) and package-lock.json.

##### README for architecture clues
- Lists React 19, React Router 7, Context API, Firebase, CSS modules, Vite.
- Describes data flows: fetching all products, fetching by ID, filtering, categories.
- Cart persistence via localStorage.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser/Client Layer
    subgraph "Browser/Client (UI)" 
        direction TB
        bootstrap["main.jsx"]:::ui
        app["App.jsx"]:::ui
        bootstrap -->|"initializes"| app
        subgraph "UI Components" 
            direction TB
            subgraph "Page Containers"
                direction TB
                A1["ItemListContainer"]:::ui
                A2["ItemDetailContainer"]:::ui
                A3["CartPage"]:::ui
                A4["CheckoutPage"]:::ui
                A5["ContactPage"]:::ui
                A6["NotFoundPage"]:::ui
            end
            subgraph "Shared Widgets"
                direction TB
                B1["NavBar"]:::ui
                B2["CartWidget"]:::ui
                B3["ItemCount"]:::ui
                B4["ConfirmationModal"]:::ui
                B5["ProductFilters"]:::ui
                B6["RandomSuggestions"]:::ui
            end
            subgraph "Item Display"
                direction TB
                C1["Item"]:::ui
                C2["ItemList"]:::ui
                C3["ItemDetail"]:::ui
            end
        end
        app -->|"renders"| A1
        app --> A2
        app --> A3
        app --> A4
        app --> A5
        app --> A6
        A1 --> B5
        A1 --> C2
        A2 --> C3
        A3 --> C1
        A4 --> B4
    end

    %% State & Business Logic
    cart["CartContext"]:::logic

    %% Data Access Layer
    service["firebaseService"]:::logic

    %% External Services
    subgraph "Persistence & Backend"
        direction TB
        localS["localStorage"]:::external
        firebase["Firebase"]:::external
    end

    %% Flows
    B2 -->|"addToCart()"| cart
    A3 -->|"viewCart()"| cart
    A4 -->|"checkout()"| cart
    cart -->|"saveCart()"| localS
    localS -->|"loadCart()"| cart
    A1 -->|"fetchProducts()"| service
    A2 -->|"fetchProductById()"| service
    service -->|"query/update"| firebase
    firebase -->|"data"| service
    service -->|"response"| A1
    service -->|"response"| A2
    service -->|"response"| A3

    %% Click Events
    click app "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/App.jsx"
    click bootstrap "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/main.jsx"
    click A1 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ItemListContainer/ItemListContainer.jsx"
    click A2 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ItemDetailContainer/ItemDetailContainer.jsx"
    click A3 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/Cart/Cart.jsx"
    click A4 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/Checkout/Checkout.jsx"
    click A5 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/Contact/Contact.jsx"
    click A6 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/NotFound/NotFound.jsx"
    click B1 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/NavBar/NavBar.jsx"
    click B2 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/CartWidget/CartWidget.jsx"
    click B3 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ItemCount/ItemCount.jsx"
    click B4 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ConfirmationModal/ConfirmationModal.jsx"
    click B5 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ProductFilters/ProductFilters.jsx"
    click B6 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/RandomSuggestions/RandomSuggestions.jsx"
    click C1 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/Item/Item.jsx"
    click C2 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ItemList/ItemList.jsx"
    click C3 "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/components/ItemDetail/ItemDetail.jsx"
    click cart "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/context/CartContext.jsx"
    click service "https://github.com/juan-moresi/proyectofinal-moresi/blob/main/src/services/firebaseService.jsx"

    %% Styles
    classDef ui fill:#a8d8ff,stroke:#000,color:#000
    classDef logic fill:#ffd59e,stroke:#000,color:#000
    classDef external fill:#c2f0c2,stroke:#000,color:#000
```
