# yiyixuu/personal-website architecture

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

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

## Overview

- Client (Browser): Represents the end-user’s device making HTTP requests.
- CDN/Deployment Platform: Although the README emphasizes Vercel (and there is also a netlify.toml), include a “Deployment Platform” node that shows platforms like Vercel or Netlify that act as the hosting and edge network.
- Next.js Server and Routing Layer: This represents the server-side part of the app that handles SSR, static generation, and API routes (if used). Indicate that this layer uses React and the Next.js app directory routing mechanism.
- UI Layer (Components): Within the server or build process, show the “Components” node (from src/components) that builds the UI, including navigation, sections (Hero, About, Projects, etc.), and reusable UI components library.
- Business Logic/Utilities: A node for “Lib/Utils,” indicating helper functions and project-specific logic found in src/lib.
- Public Assets: A node showing the “public” directory that contains images, robots.txt, and other static files available to the client.
- Build/Deployment Process: Outline that Next.js automatically builds the app (the .next folder) and produces artifacts that are served in production. You may optionally include “Build Tools and Config” such as tsconfig.json, next.config.js, tailwind.config.ts, and scripts in package.json.

##### Relationships and interactions
- Within the Next.js server layer, illustrate how the “app” folder is composed of pages and nested routes (like “/projects” and “/projects/[slug]”).
- That utilities and data (lib folder) support these components and pages.

##### Technology stack details
- Next.js / React (UI and SSR framework)
- TypeScript (for type safety and development)
- Tailwind CSS (for styling)
- Vercel (or Netlify) as the Deployment Platform
- next/font (for optimized font loading)
- Any additional libraries like Framer Motion, Lucide React, etc., which appear in the build chunks, can be noted as part of the UI/enhancement libraries.

- Labels on each component should clearly indicate their role.
- Distinguish between build-time artifacts and runtime components to indicate the role of the .next build output.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Side
    subgraph "Client Side"
        BROWSER["Client (Browser)"]:::client
    end

    %% Public Assets
    subgraph "Static/Public Assets"
        PUBLIC["Public Assets (public)"]:::public
        IMAGES["Images"]:::public
        ROBOTS["Robots.txt"]:::public
    end

    %% Deployment Platform
    subgraph "Deployment Platform"
        DEPLOY["Deployment Platform (Vercel/Netlify)"]:::deploy
        NETLIFY["netlify.toml"]:::deployFile
    end

    %% Server Side (Next.js)
    subgraph "Server Side (Next.js)"
        APP["App Router (src/app) (SSR/SSG)"]:::server
        HOME["Home Page (src/app/page.tsx)"]:::server
        PROJ["Project Detail (src/app/projects/[slug]/page.tsx)"]:::server
    end

    %% UI Components Layer
    subgraph "UI Components"
        UI["UI Components (src/components)"]:::ui
        NAV["Navigation (src/components/nav)"]:::ui
        FOOTER["Footer (src/components/footer)"]:::ui
        SECTIONS["Sections (src/components/sections)"]:::ui
        UILIB["UI Library (src/components/ui)"]:::ui
    end

    %% Business Logic / Utilities
    subgraph "Business Logic/Utilities"
        UTIL["Utility Layer (src/lib)"]:::util
        PROJECTDATA["projectData (src/lib/projectData.ts)"]:::util
        UTILS["utils (src/lib/utils.ts)"]:::util
    end

    %% Build/Deployment Process
    subgraph "Build/Deployment Process"
        BUILD["Build Tools & Config"]:::build
        NEXTCONFIG["next.config.js"]:::build
        TAILWIND["tailwind.config.ts"]:::build
        TSCONFIG["tsconfig.json"]:::build
        NEXTFOLDER[".next"]:::build
        OUTFOLDER["out"]:::build
    end

    %% Connections
    BROWSER -->|"requests"| DEPLOY
    DEPLOY -->|"forwards to"| APP
    APP -->|"renders views via"| UI
    APP -->|"utilizes"| UTIL
    APP -->|"responds to"| BROWSER
    PUBLIC -->|"serves static assets to"| BROWSER

    %% Internal Server Routing
    APP --> HOME
    APP --> PROJ

    %% Build Process supports Server
    BUILD -->|"builds"| APP

    %% Click Events
    click IMAGES "https://github.com/yiyixuu/personal-website/tree/main/public/images"
    click ROBOTS "https://github.com/yiyixuu/personal-website/blob/main/src/app/robots.txt"

    click NETLIFY "https://github.com/yiyixuu/personal-website/blob/main/netlify.toml"

    click APP "https://github.com/yiyixuu/personal-website/tree/main/src/app"
    click HOME "https://github.com/yiyixuu/personal-website/blob/main/src/app/page.tsx"
    click PROJ "https://github.com/yiyixuu/personal-website/blob/main/src/app/projects/[slug]/page.tsx"

    click UI "https://github.com/yiyixuu/personal-website/tree/main/src/components"
    click NAV "https://github.com/yiyixuu/personal-website/tree/main/src/components/nav"
    click FOOTER "https://github.com/yiyixuu/personal-website/tree/main/src/components/footer"
    click SECTIONS "https://github.com/yiyixuu/personal-website/tree/main/src/components/sections"
    click UILIB "https://github.com/yiyixuu/personal-website/tree/main/src/components/ui"

    click UTIL "https://github.com/yiyixuu/personal-website/tree/main/src/lib"
    click PROJECTDATA "https://github.com/yiyixuu/personal-website/blob/main/src/lib/projectData.ts"
    click UTILS "https://github.com/yiyixuu/personal-website/blob/main/src/lib/utils.ts"

    click NEXTCONFIG "https://github.com/yiyixuu/personal-website/blob/main/next.config.js"
    click TAILWIND "https://github.com/yiyixuu/personal-website/blob/main/tailwind.config.ts"
    click TSCONFIG "https://github.com/yiyixuu/personal-website/blob/main/tsconfig.json"
    click NEXTFOLDER "https://github.com/yiyixuu/personal-website/blob/main/.next"
    click OUTFOLDER "https://github.com/yiyixuu/personal-website/tree/main/out"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef public fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef deploy fill:#E6E6FA,stroke:#000,stroke-width:2px;
    classDef deployFile fill:#EEE8AA,stroke:#000,stroke-width:2px;
    classDef server fill:#98FB98,stroke:#000,stroke-width:2px;
    classDef ui fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef util fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef build fill:#FFA07A,stroke:#000,stroke-width:2px;
```
