# amirshehzadshah/cookery architecture

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

- Interactive diagram: https://gitdiagram.com/amirshehzadshah/cookery
- Repository: https://github.com/amirshehzadshah/cookery

## Overview

##### Main Components

A. Client-Side Layer
- Next.js Frontend Application
- Page Components (Home, Contact, Portfolio)
- Common Components (Base, Dropdown)
- Shared Components (Header, Footer)
- Static Assets (videos in public/assets/portfolio)

B. Build & Configuration Layer
- Next.js Config
- Tailwind CSS
- ESLint
- PostCSS

C. Data Layer
- Static Data Files (brands.js, portfolio.js)

**[Client Browser]**
- ↕
**[Next.js Application]**
- Pages Layer
- Home Page
- Contact Page
- Portfolio Pages (Dynamic Routes)

- Components Layer
- Common Components
- Base
- Dropdown
- Shared Components
- Header
- Footer

- Static Assets
- Portfolio Media

- Data Layer
- Static Data Files

##### Key Architectural Aspects to Highlight

- Next.js App Router Structure: Show the hierarchical routing system using the app directory structure
- Component Reusability: Illustrate how common and shared components are used across pages
- Static Asset Management: Show how public assets are served
- Data Flow: Demonstrate how static data from src/data connects to components

##### Technical Stack Callouts

- Next.js 14 (App Router)
- Tailwind CSS for styling
- JavaScript/JSX implementation
- Static file-based data management
- Client-side components

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Client Browser"]
    end

    subgraph NextApp["Next.js Application"]
        Layout["Main Layout"]:::core
        click Layout "https://github.com/amirshehzadshah/cookery/blob/main/src/app/layout.js"
        GlobalStyles["Global Styles"]:::styles
        click GlobalStyles "https://github.com/amirshehzadshah/cookery/blob/main/src/app/globals.css"

        subgraph Pages["Pages Layer"]
            Home["Home Page"]:::page
            click Home "https://github.com/amirshehzadshah/cookery/blob/main/src/app/home/page.jsx"
            Contact["Contact Page"]:::page
            click Contact "https://github.com/amirshehzadshah/cookery/blob/main/src/app/contact/page.jsx"
            Portfolio["Portfolio Page [id]"]:::page
            click Portfolio "https://github.com/amirshehzadshah/cookery/blob/main/src/app/portfolio/[id]/page.jsx"
        end

        subgraph Components["Components Layer"]
            subgraph Common["Common Components"]
                Base["Base Component"]:::component
                click Base "https://github.com/amirshehzadshah/cookery/blob/main/src/app/common/Base.jsx"
                Dropdown["Dropdown Component"]:::component
                click Dropdown "https://github.com/amirshehzadshah/cookery/blob/main/src/app/common/Dropdown.jsx"
            end

            subgraph Shared["Shared Components"]
                Header["Header"]:::component
                click Header "https://github.com/amirshehzadshah/cookery/blob/main/src/app/components/Header.jsx"
                Footer["Footer"]:::component
                click Footer "https://github.com/amirshehzadshah/cookery/blob/main/src/app/components/Footer.jsx"
            end
        end

        subgraph Assets["Static Assets"]
            PortfolioMedia["Portfolio Media"]:::assets
            click PortfolioMedia "https://github.com/amirshehzadshah/cookery/tree/main/public/assets/portfolio/"
        end

        subgraph Data["Data Layer"]
            BrandsData["Brands Data"]:::data
            click BrandsData "https://github.com/amirshehzadshah/cookery/blob/main/src/data/brands.js"
            PortfolioData["Portfolio Data"]:::data
            click PortfolioData "https://github.com/amirshehzadshah/cookery/blob/main/src/data/portfolio.js"
        end

        subgraph Config["Configuration Layer"]
            NextConfig["Next.js Config"]:::config
            click NextConfig "https://github.com/amirshehzadshah/cookery/blob/main/next.config.mjs"
            TailwindConfig["Tailwind Config"]:::config
            click TailwindConfig "https://github.com/amirshehzadshah/cookery/blob/main/tailwind.config.js"
            ESLintConfig["ESLint Config"]:::config
            click ESLintConfig "https://github.com/amirshehzadshah/cookery/blob/main/.eslintrc.json"
            PostCSSConfig["PostCSS Config"]:::config
            click PostCSSConfig "https://github.com/amirshehzadshah/cookery/blob/main/postcss.config.mjs"
        end
    end

    Browser <--> Layout
    Layout --> GlobalStyles
    Layout --> Pages
    Layout --> Components

    Home --> Header
    Home --> Footer
    Contact --> Header
    Contact --> Footer
    Portfolio --> Header
    Portfolio --> Footer

    Portfolio --> PortfolioData
    Portfolio --> PortfolioMedia
    Home --> BrandsData

    classDef core fill:#2563eb,color:white
    classDef page fill:#22c55e,color:white
    classDef component fill:#eab308,color:black
    classDef assets fill:#6b7280,color:white
    classDef data fill:#6b7280,color:white
    classDef config fill:#9333ea,color:white
    classDef styles fill:#f43f5e,color:white

    subgraph Legend
        L1["Core Components"]:::core
        L2["Page Components"]:::page
        L3["Common/Shared Components"]:::component
        L4["Static Assets"]:::assets
        L5["Data Files"]:::data
        L6["Configuration"]:::config
        L7["Styles"]:::styles
    end
```
