# yayano/sidradz architecture

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

- Interactive diagram: https://gitdiagram.com/yayano/sidradz
- Repository: https://github.com/yayano/sidradz

## Overview

##### Project type and purpose
- This is a Next.js 13 full-stack (frontend-focused) web application using the new `app/` directory.
- It is primarily a React-based, server-rendered (SSR/SSG) website with client-side hydration, dynamic routing for product pages, and a set of reusable UI components.

##### File structure
- Top-level:
- `app/` – the Next.js “App Router” directory that contains your React pages and layout
- `app/components/` – shared React UI components (Navbar, Footer, Home, Services, etc.)
- `app/product/[id]/page.tsx` – dynamic route for individual product pages
- `app/layout.tsx` & `app/page.tsx` – global layout and home page
- `app/constants/index.js` – static or stub data store for product info
- `public/` – static assets (video, images, fonts) served via CDN
- `next.config.ts`, `postcss.config.mjs`, `tsconfig.json`, `eslint.config.mjs` – build, lint, and compiler configuration
- `package.json` & lock file – dependencies and scripts

##### README for additional insights
- Bootstrapped with `create-next-app`
- Uses `next/font` to auto-optimize Geist from Vercel
- No external API services called out (data likely coming from the `constants` module or a future headless CMS)

##### Main components and their relationships
a. Client (Web Browser)
b. Next.js Server / Edge Functions
c. React “App Router” (app/layout, app/page, dynamic routes)
d. UI Components (Navbar, Footer, Home, Products, etc.)
e. Data Layer (`app/constants/index.js`)
f. Static Assets (public folder, optimized fonts, video)
g. Build & Deployment (Vercel platform or similar CDN/Edge network)

##### Interactions and data flows
- Browser → HTTP GET → Next.js Server
- If request matches a static/SSG page (e.g. `/` or `/services`), server returns prebuilt HTML & JSON for hydration
- If request matches a dynamic route (`/product/42`), Next.js runs the page code, reads from `constants`, and streams SSR HTML
- Next.js Server → React Components → Data Layer → Render HTML + JS bundle → return to client
- Client hydrates components, fetches any client-side only data or interactivity
- Static assets (video, images, CSS) served directly from the CDN endpoint

##### Architectural patterns and design principles
- File-system routing (automatic routing based on `app/` directory)
- Component-based UI (React) with separation of layout, pages, and atomic/reusable components
- SSR/SSG hybrid model – some pages built at compile time, others on-demand
- Single codebase for both server and client (full-stack React)
- CSS handled via global `globals.css` and PostCSS, font optimization via `next/font`

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer"
        Browser["Web Browser"]:::client
        Hydration["React Hydration"]:::client
    end

    %% Server Layer
    subgraph "Server Layer"
        NextServer["Next.js Server / Edge Functions"]:::server

        subgraph "App Router"
            Layout["layout.tsx"]:::server
            HomePage["page.tsx"]:::server
            ProductPage["[id]/page.tsx"]:::server
        end

        subgraph "UI Components"
            Navbar["Navbar"]:::server
            Footer["Footer"]:::server
            HomeSection["Home Section"]:::server
            Services["Services Section"]:::server
            ProductsList["Products List"]:::server
            ImageContainer["Image Container"]:::server
            Contact["Contact Section"]:::server
            Address["Addresse Section"]:::server
            About["About Section"]:::server
            ScrollRest["Scroll Restoration"]:::server
        end

        Constants["constants/index.js"]:::data
        GlobalsCSS["globals.css"]:::server
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        CDN["CDN / Vercel Edge"]:::infra
        Build["Build & Deployment"]:::infra
        Git["Git Repository"]:::infra

        subgraph "Config & Assets"
            NextConfig["next.config.ts"]:::infra
            PostCSS["postcss.config.mjs"]:::infra
            TSConfig["tsconfig.json"]:::infra
            ESLintConfig["eslint.config.mjs"]:::infra
            PackageJSON["package.json & lock"]:::infra
            VideoFile["video.mp4"]:::infra
            AssetsFolder["app/assets/fiches tecnique"]:::infra
        end
    end

    %% Connections
    Browser -->|"GET / or /services (SSG)"| NextServer
    Browser -->|"GET /product/:id (SSR)"| NextServer
    NextServer -->|"uses App Router"| Layout
    Layout --> HomePage
    Layout --> ProductPage
    Layout --> Navbar
    Layout --> Footer
    Layout --> HomeSection
    Layout --> Services
    Layout --> ProductsList
    Layout --> ImageContainer
    Layout --> Contact
    Layout --> Address
    Layout --> About
    Layout --> ScrollRest
    NextServer -->|"fetch data"| Constants
    NextServer -->|"include CSS"| GlobalsCSS
    NextServer -->|"deploys to"| CDN
    NextServer -->|"build step"| Build
    Build --> NextConfig
    Build --> PostCSS
    Build --> TSConfig
    Build --> ESLintConfig
    Build --> PackageJSON
    Build --> CDN
    Git --> Build
    Browser -->|"fetch assets"| CDN
    Browser -->|"hydrate UI"| Hydration

    %% Click Events
    click Layout "https://github.com/yayano/sidradz/blob/master/app/layout.tsx"
    click HomePage "https://github.com/yayano/sidradz/blob/master/app/page.tsx"
    click ProductPage "https://github.com/yayano/sidradz/blob/master/app/product/[id]/page.tsx"
    click Navbar "https://github.com/yayano/sidradz/blob/master/app/components/Navbar.tsx"
    click Footer "https://github.com/yayano/sidradz/blob/master/app/components/Footer.tsx"
    click HomeSection "https://github.com/yayano/sidradz/blob/master/app/components/Home.tsx"
    click Services "https://github.com/yayano/sidradz/blob/master/app/components/Services.tsx"
    click ProductsList "https://github.com/yayano/sidradz/blob/master/app/components/Products.tsx"
    click ImageContainer "https://github.com/yayano/sidradz/blob/master/app/components/ImageContainer.tsx"
    click Contact "https://github.com/yayano/sidradz/blob/master/app/components/Contact.tsx"
    click Address "https://github.com/yayano/sidradz/blob/master/app/components/Addresse.tsx"
    click About "https://github.com/yayano/sidradz/blob/master/app/components/About.tsx"
    click ScrollRest "https://github.com/yayano/sidradz/blob/master/app/components/ScrollRestoration.tsx"
    click Constants "https://github.com/yayano/sidradz/blob/master/app/constants/index.js"
    click GlobalsCSS "https://github.com/yayano/sidradz/blob/master/app/globals.css"
    click VideoFile "https://github.com/yayano/sidradz/blob/master/public/video.mp4"
    click NextConfig "https://github.com/yayano/sidradz/blob/master/next.config.ts"
    click PostCSS "https://github.com/yayano/sidradz/blob/master/postcss.config.mjs"
    click TSConfig "https://github.com/yayano/sidradz/blob/master/tsconfig.json"
    click ESLintConfig "https://github.com/yayano/sidradz/blob/master/eslint.config.mjs"
    click PackageJSON "https://github.com/yayano/sidradz/blob/master/package.json & package-lock.json"
    click AssetsFolder "https://github.com/yayano/sidradz/tree/master/app/assets/fiches tecnique"

    %% Styles
    classDef client fill:#b8f1bc,stroke:#2f843e,color:#000
    classDef server fill:#b3d4fc,stroke:#1a6fb3,color:#000
    classDef data fill:#fce5b3,stroke:#bf781f,color:#000
    classDef infra fill:#e2b3fc,stroke:#892ebf,color:#000
```
