# rammcodes/headless-pizza architecture

> Architecture diagram of the GitHub repository rammcodes/headless-pizza, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rammcodes/headless-pizza
- Repository: https://github.com/rammcodes/headless-pizza

## Overview

##### Main System Components

a) Frontend Layer (React Application)
- Divide it into three main sections:
- Layout Components (Header, Footer)
- Core Features (MainContent, Items, Pagination)
- UI Controls (Filter, Sort, FilterDropdown)

b) Headless CMS Layer (Wix Studio)
- CMS as a separate system
- Content collection for menu items
- Content management interface

c) API/Integration Layer
- Communication between React and Wix Studio
- REST/GraphQL endpoints (depending on Wix Studio's implementation)

##### Component Organization

a) Top-level components:
- App
- Header
- MainContent
- Filter
- Sort
- Items
- Item
- ItemPopup
- Footer

##### Data Flow Representation
- Content flow from Wix CMS to React components
- User interaction flows (filtering, sorting, pagination)
- State management patterns

##### Specific Implementation Details

- Vite as the build tool
- CSS modules for styling
- Component-specific features (ItemSkeleton for loading states)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph CMS["Wix Studio Headless CMS"]
        WixContent[Content Collections]
        WixInterface[Management Interface]
        WixContent --> WixInterface
    end

    subgraph API["API/Integration Layer"]
        REST[REST/GraphQL Endpoints]
    end

    subgraph Frontend["React Application"]
        App["App Container"]:::react
        Header["Header"]:::layout
        Footer["Footer"]:::layout
        MainContent["Main Content"]:::feature
        Items["Items Container"]:::feature
        Item["Individual Item"]:::component
        ItemPopup["Item Popup"]:::component
        ItemSkeleton["Loading Skeleton"]:::component
        Filter["Filter"]:::control
        Sort["Sort"]:::control
        FilterDropdown["Filter Dropdown"]:::control
        Pagination["Pagination"]:::control

        App --> Header
        App --> MainContent
        App --> Footer
        MainContent --> Filter
        MainContent --> Sort
        MainContent --> Items
        Items --> Item
        Item --> ItemPopup
        Filter --> FilterDropdown
    end

    WixContent -.-> REST
    REST -.-> App

    classDef react fill:#61DAFB,stroke:#000
    classDef layout fill:#4A90E2,stroke:#000
    classDef feature fill:#45B7D1,stroke:#000
    classDef component fill:#5D7FEB,stroke:#000
    classDef control fill:#F5A623,stroke:#000
    classDef cms fill:#98FB98,stroke:#000
    classDef api fill:#FFE4B5,stroke:#000

    class CMS cms
    class API api

    click App "https://github.com/rammcodes/Headless-Pizza/blob/main/src/App.jsx"
    click Header "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/header/Header.jsx"
    click Footer "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/footer/Footer.jsx"
    click MainContent "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/main-content/MainContent.jsx"
    click Items "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/items/Items.jsx"
    click Item "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/item/Item.jsx"
    click ItemPopup "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/item-popup/ItemPopup.jsx"
    click ItemSkeleton "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/item-skeleton/ItemSkeleton.jsx"
    click Filter "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/filter/Filter.jsx"
    click Sort "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/sort/Sort.jsx"
    click FilterDropdown "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/filter-dropdown/FilterDropdown.jsx"
    click Pagination "https://github.com/rammcodes/Headless-Pizza/blob/main/src/components/pagination/Pagination.jsx"

    subgraph Legend
        L1[React Component]:::react
        L2[Layout Component]:::layout
        L3[Feature Component]:::feature
        L4[UI Component]:::component
        L5[Control Component]:::control
        L6[CMS Component]:::cms
        L7[API Layer]:::api
    end
```
