# aejkatappaja/pizza_land architecture

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

- Interactive diagram: https://gitdiagram.com/aejkatappaja/pizza_land
- Repository: https://github.com/aejkatappaja/pizza_land

## Overview

##### Main System Components

a) Frontend Layer (Client-Side)
- Next.js Application (App Router architecture)
- React Components
- Context API for state management
- UI Components (TailwindCSS styling)

b) Services Layer
- API Services (fetch-pizzas service)

##### Component Architecture Breakdown

A. Presentation Layer
- Layout Component
- Header
- Banner
- Main Content
- Footer

B. Feature Components
- Cart System
- Pizza Customization
- Checkout System

C. State Management
- Context Providers
- Cart Context
- Visibility Context

##### Key Interactions to Highlight

Following flows:
- Pizza selection → Pizza Options Modal → Cart
- Cart → Checkout Modal → Payment Flow
- Context updates affecting multiple components
- Service data flow to components

##### Specific Implementation Details

Technical aspects:
- Next.js 13+ App Router architecture
- TailwindCSS styling system
- React Parallax Mouse integration
- React Hot Toast notification system

##### Notes for Scale

Annotations indicating:
- Potential scaling points
- Component reusability
- State management optimization points
- Performance considerations

Remember to highlight the modern Next.js features being used, such as the App Router and server components, as these are crucial architectural decisions in the application's design.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph NextApp["Next.js Application"]
        Layout["Layout Component"]
        
        subgraph PresentationLayer["Presentation Layer"]
            Header["Header Component"]
            Banner["Banner Component"]
            MainContent["Main Content"]
            Footer["Footer"]
            
            subgraph HeaderStructure["Header Structure"]
                BrandLogo["Brand Logo"]
                CartIcon["Cart Icon"]
                Contact["Contact"]
            end
        end
        
        subgraph FeatureComponents["Feature Components"]
            subgraph CartSystem["Cart System"]
                CartTop["Cart Top"]
                CartBottom["Cart Bottom"]
                CartItem["Cart Item"]
            end
            
            subgraph ModalSystem["Modal System"]
                PizzaModal["Pizza Options Modal"]
                CheckoutModal["Checkout Modal"]
            end
            
            subgraph PizzaCustomization["Pizza Customization"]
                SizeSelection["Size Selection"]
                CrustSelection["Crust Selection"]
                ToppingSelection["Topping Selection"]
            end
            
            subgraph CheckoutSystem["Checkout System"]
                PaymentForm["Payment Form"]
                PaymentAccepted["Payment Accepted"]
            end
        end
        
        subgraph StateManagement["State Management"]
            CartContext["Cart Context"]
            VisibleContext["Visibility Context"]
        end
        
        subgraph ServicesLayer["Services Layer"]
            FetchPizzas["Fetch Pizzas Service"]
            TypeDefs["Type Definitions"]
        end
    end
    
    %% Component Relationships
    Layout --> Header
    Layout --> Banner
    Layout --> MainContent
    Layout --> Footer
    
    Header --> HeaderStructure
    HeaderStructure --> BrandLogo
    HeaderStructure --> CartIcon
    HeaderStructure --> Contact
    
    CartSystem --> CartTop
    CartSystem --> CartBottom
    CartSystem --> CartItem
    
    PizzaCustomization --> SizeSelection
    PizzaCustomization --> CrustSelection
    PizzaCustomization --> ToppingSelection
    
    CheckoutSystem --> PaymentForm
    CheckoutSystem --> PaymentAccepted
    
    %% State and Data Flow
    CartContext -.-> CartSystem
    CartContext -.-> CartIcon
    VisibleContext -.-> ModalSystem
    FetchPizzas -.-> MainContent
    
    %% Click Events
    click Layout "https://github.com/Aejkatappaja/pizza_land/blob/main/app/layout.tsx"
    click Header "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/header/index.tsx"
    click BrandLogo "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/header/structure/brand-logo.tsx"
    click CartIcon "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/header/structure/cart-icon.tsx"
    click Contact "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/header/structure/contact.tsx"
    click Banner "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/banner/index.tsx"
    click CartSystem "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/cart/index.tsx"
    click CartTop "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/cart/structure/cart-top.tsx"
    click CartBottom "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/cart/structure/cart-bottom.tsx"
    click CartItem "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/cart/structure/cart-item.tsx"
    click PizzaModal "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/pizza-options-modal/index.tsx"
    click CheckoutModal "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/checkout-modal/index.tsx"
    click SizeSelection "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/pizza-options-modal/structure/selection/size-selection.tsx"
    click CrustSelection "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/pizza-options-modal/structure/selection/crust-selection.tsx"
    click ToppingSelection "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/pizza-options-modal/structure/selection/topping.tsx"
    click PaymentForm "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/checkout-modal/structure/payment/payment-form.tsx"
    click PaymentAccepted "https://github.com/Aejkatappaja/pizza_land/blob/main/app/components/modal/checkout-modal/structure/payment/payment-accepted.tsx"
    click CartContext "https://github.com/Aejkatappaja/pizza_land/blob/main/app/context/cart.context.tsx"
    click VisibleContext "https://github.com/Aejkatappaja/pizza_land/blob/main/app/context/visible.context.tsx"
    click FetchPizzas "https://github.com/Aejkatappaja/pizza_land/blob/main/app/services/fetch-pizzas.ts"
    click TypeDefs "https://github.com/Aejkatappaja/pizza_land/blob/main/app/types/types.ts"
    
    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef context fill:#d4edda,stroke:#28a745
    classDef service fill:#fff3cd,stroke:#ffc107
    classDef modal fill:#f8d7da,stroke:#dc3545
    classDef component fill:#cce5ff,stroke:#0d6efd
    
    class CartContext,VisibleContext context
    class FetchPizzas,TypeDefs service
    class PizzaModal,CheckoutModal modal
    class Layout,Header,Banner,MainContent,Footer,CartSystem,PizzaCustomization,CheckoutSystem component
```
