# sebastianzapatar/nextshadcn architecture

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

- Interactive diagram: https://gitdiagram.com/sebastianzapatar/nextshadcn
- Repository: https://github.com/sebastianzapatar/nextshadcn

## Overview

##### Project type and purpose
- This is a full‑stack React application built with Next.js (App Router).
- From the README and file tree, it’s a data‑driven web app (a “Chef” directory with createChef and getChefs functions, forms, and list pages), likely CRUD over some backing store or API.

##### File structure
- Top‑level
- app/               – Next.js App Router folder
- components/        – Shared UI primitives (button, input, card, etc.)
- lib/               – Utility functions
- public/            – Static assets
- next.config.ts, tsconfig.json, package.json, etc.
- app/ contains:
- layout.tsx, globals.css – global layout and styles
- page.tsx, not-found.tsx – home and fallback pages
- (general)/chef/page.tsx – “Chef” listing page
- app/components/chef – domain‑specific components (ChefList, ChefForm, schema, API hooks getChefs/createChef)
- No explicit “pages/api” folder is present, so data fetching is done via client‑side fetches in createChef.ts/getChefs.ts or future Route Handlers (e.g. app/api).

##### README for additional insights
- It’s a stock create-next-app scaffold with App Router routes, next/font for font optimization, deploys on Vercel.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser("Browser"):::client
    subgraph "Next.js Server"
        NextServer("Next.js SSR/CSR"):::server
        Static("Static Assets (public/)"):::storage
    end

    subgraph "Frontend - App Router"
        Layout["app/layout.tsx"]:::app
        Globals["app/globals.css"]:::app
        HomePage["app/page.tsx"]:::app
        ChefPage["app/(general)/chef/page.tsx"]:::app
        NotFound["app/not-found.tsx"]:::app
    end

    subgraph "UI Layer"
        SharedUI["components/ui/"]:::ui
        LayoutNav["app/components/"]:::ui
        ChefUI["app/components/chef/"]:::ui
    end

    subgraph "Business Logic"
        Utils["lib/utils.ts"]:::logic
        DataFetch["getChefs()/createChef()"]:::logic
    end

    subgraph "API Layer"
        APIRoutes("Next.js Route Handlers /api/..."):::api
    end

    ExternalDB("External Database"):::db
    Vercel("Vercel Hosting"):::infra

    %% Relationships
    Browser --> NextServer
    NextServer --> Layout
    Layout --> HomePage
    Layout --> ChefPage
    Layout --> NotFound
    NextServer --> Static

    HomePage --> SharedUI
    ChefPage --> ChefUI
    ChefUI --> DataFetch
    DataFetch --> Utils
    DataFetch --> APIRoutes
    Browser -->|fetch chefs| DataFetch
    Browser -->|POST chef| APIRoutes
    APIRoutes --> ExternalDB

    NextServer --> Vercel
    APIRoutes --> Vercel
    Static --> Vercel

    %% Click Events
    click Layout "https://github.com/sebastianzapatar/nextshadcn/blob/main/app/layout.tsx"
    click Globals "https://github.com/sebastianzapatar/nextshadcn/blob/main/app/globals.css"
    click HomePage "https://github.com/sebastianzapatar/nextshadcn/blob/main/app/page.tsx"
    click ChefPage "https://github.com/sebastianzapatar/nextshadcn/blob/main/app/(general)/chef/page.tsx"
    click NotFound "https://github.com/sebastianzapatar/nextshadcn/blob/main/app/not-found.tsx"
    click SharedUI "https://github.com/sebastianzapatar/nextshadcn/tree/main/components/ui/"
    click LayoutNav "https://github.com/sebastianzapatar/nextshadcn/tree/main/app/components/"
    click ChefUI "https://github.com/sebastianzapatar/nextshadcn/tree/main/app/components/chef/"
    click Utils "https://github.com/sebastianzapatar/nextshadcn/blob/main/lib/utils.ts"
    click Static "https://github.com/sebastianzapatar/nextshadcn/tree/main/public/"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef server fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef storage fill:#FFE4B5,stroke:#000,stroke-width:1px
    classDef app fill:#DDEEFF,stroke:#000,stroke-width:1px
    classDef ui fill:#BBCCFF,stroke:#000,stroke-width:1px
    classDef logic fill:#CCFFCC,stroke:#000,stroke-width:1px
    classDef api fill:#FFDD99,stroke:#000,stroke-width:1px
    classDef db fill:#F4A460,stroke:#000,stroke-width:1px
    classDef infra fill:#F0F0F0,stroke:#000,stroke-width:1px
```
