# ta2edh/website architecture

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

- Interactive diagram: https://gitdiagram.com/ta2edh/website
- Repository: https://github.com/ta2edh/website

## Overview

##### Project type and purpose
- This is a single-page, static-first personal website built with Next.js (v13+ app router), React and Tailwind CSS.
- It delivers a modern, responsive home page with a contact form and social-link integration, optimized for SEO and fast performance.

##### File structure
- Top-level “app/” directory: Next.js app router files (layout.tsx, page.tsx) that define your root layout and homepage.
- “components/”: reusable React components split into domain-specific (contact-form.tsx, social-links.tsx) and a “ui/” subfolder with primitives (Button, Dialog, Input, Textarea, Toast).
- “hooks/”: custom React hooks (use-mobile.tsx, use-toast.ts) for runtime behavior.
- “lib/”: utility functions (utils.ts) used across the app.
- “styles/” and global CSS files (app/globals.css, styles/globals.css) plus Tailwind and PostCSS configs for styling.
- Config files: tsconfig.json, next.config.mjs, tailwind.config.ts, package.json.

##### README for additional insights
- Core features: responsive layout, contact form (with validation), social-media links, SEO optimizations.
- Deployment target: Vercel (serverless hosting for Next.js).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser
    Browser["Browser"]:::external

    %% Build & Hosting
    subgraph "Build & Hosting"
        direction TB
        Vercel["Vercel (CI/CD & Hosting)"]:::external
        NextBuild["Next.js Build"]:::server
    end

    Browser -->|"HTTP Request"| Vercel
    Vercel -->|"Build & Deploy"| NextBuild

    %% Server Side (Next.js)
    subgraph "Server Side (Next.js)"
        direction TB
        NextServer["Next.js Server (app router)"]:::server
        Layout["app/layout.tsx\n(Root Layout)"]:::server
        Page["app/page.tsx\n(Homepage)"]:::server
        GlobalsCSS["app/globals.css"]:::styling
    end

    NextBuild --> NextServer
    NextServer --> Layout
    NextServer --> Page
    NextServer --> GlobalsCSS

    %% Client Side (React App)
    subgraph "Client Side (React)"
        direction TB
        ReactHydration["React Hydration"]:::client

        subgraph "Feature Components"
            direction TB
            ContactForm["Contact Form"]:::client
            SocialLinks["Social Links"]:::client
        end

        subgraph "UI Library (Atomic Primitives)"
            direction TB
            Button["Button"]:::ui
            Dialog["Dialog"]:::ui
            Input["Input"]:::ui
            Textarea["Textarea"]:::ui
            Toast["Toast"]:::ui
            Toaster["Toaster"]:::ui
            UIFHook["use-toast (UI Hook)"]:::ui
        end

        subgraph "Logic & Utilities"
            direction TB
            Hooks["Custom Hooks"]:::util
            Utils["lib/utils.ts"]:::util
        end

        subgraph "Styling Pipeline"
            direction TB
            TailwindConfig["tailwind.config.ts"]:::styling
            PostCSS["postcss.config.mjs"]:::styling
            GlobalStyles["styles/globals.css"]:::styling
        end
    end

    Page --> ReactHydration
    ReactHydration --> ContactForm
    ReactHydration --> SocialLinks
    ContactForm --> UIFHook
    ContactForm --> Hooks
    SocialLinks --> UIFHook
    ContactForm --> Utils
    ContactForm -->|"Submit Form"| EmailService
    Hooks --> Utils

    ReactHydration --> Button
    ReactHydration --> Dialog
    ReactHydration --> Input
    ReactHydration --> Textarea
    ReactHydration --> Toast
    ReactHydration --> Toaster

    GlobalStyles --> TailwindConfig
    GlobalStyles --> PostCSS
    TailwindConfig --> Button
    TailwindConfig --> Dialog
    TailwindConfig --> Input
    TailwindConfig --> Textarea
    TailwindConfig --> Toast
    TailwindConfig --> Toaster

    %% External Services
    subgraph "External Services"
        direction TB
        EmailService["Email/API Service"]:::external
    end

    %% Configuration Files
    subgraph "Configurations"
        direction TB
        NextConfig["next.config.mjs"]:::config
        TSConfig["tsconfig.json"]:::config
        PackageJSON["package.json"]:::config
    end

    NextBuild --> NextConfig
    NextBuild --> TSConfig
    NextBuild --> PackageJSON

    %% Flow to external
    ContactForm -->|"API Call"| NextServer
    ReactHydration --> GlobalsCSS

    %% Click Events
    click Layout "https://github.com/ta2edh/website/blob/main/app/layout.tsx"
    click Page "https://github.com/ta2edh/website/blob/main/app/page.tsx"
    click GlobalsCSS "https://github.com/ta2edh/website/blob/main/app/globals.css"
    click ContactForm "https://github.com/ta2edh/website/blob/main/components/contact-form.tsx"
    click SocialLinks "https://github.com/ta2edh/website/blob/main/components/social-links.tsx"
    click Button "https://github.com/ta2edh/website/blob/main/components/ui/button.tsx"
    click Dialog "https://github.com/ta2edh/website/blob/main/components/ui/dialog.tsx"
    click Input "https://github.com/ta2edh/website/blob/main/components/ui/input.tsx"
    click Textarea "https://github.com/ta2edh/website/blob/main/components/ui/textarea.tsx"
    click Toast "https://github.com/ta2edh/website/blob/main/components/ui/toast.tsx"
    click Toaster "https://github.com/ta2edh/website/blob/main/components/ui/toaster.tsx"
    click UIFHook "https://github.com/ta2edh/website/blob/main/components/ui/use-toast.ts"
    click Hooks "https://github.com/ta2edh/website/blob/main/hooks/use-mobile.tsx"
    click Utils "https://github.com/ta2edh/website/blob/main/lib/utils.ts"
    click GlobalStyles "https://github.com/ta2edh/website/blob/main/styles/globals.css"
    click TailwindConfig "https://github.com/ta2edh/website/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/ta2edh/website/blob/main/postcss.config.mjs"
    click NextConfig "https://github.com/ta2edh/website/blob/main/next.config.mjs"
    click TSConfig "https://github.com/ta2edh/website/blob/main/tsconfig.json"
    click PackageJSON "https://github.com/ta2edh/website/blob/main/package.json"

    %% Styles
    classDef server fill:#E8F1FF,stroke:#4A90E2,color:#000
    classDef client fill:#FFF4E6,stroke:#F5A623,color:#000
    classDef ui fill:#E6FFFA,stroke:#2BC3A7,color:#000
    classDef util fill:#F0F0F0,stroke:#9B9B9B,color:#000
    classDef external fill:#FFF0F0,stroke:#E24C4B,color:#000
    classDef styling fill:#F9F9F9,stroke:#CCCCCC,color:#000
    classDef config fill:#F3F3FF,stroke:#7A5AF8,color:#000
```
