# winston-edwin-chiong/personal-website architecture

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

- Interactive diagram: https://gitdiagram.com/winston-edwin-chiong/personal-website
- Repository: https://github.com/winston-edwin-chiong/personal-website

## Overview

##### Main Components
- Next.js Framework: At the center of the architecture, the Next.js framework manages routing, server rendering, and optimizations.
- App Directory (src/app): This folder holds the main pages of the application. Note there are several sub‑directories like “projects”, “song”, and “story” each containing their own “page.tsx”. These represent distinct routes and functional areas.
- Components Directory (src/components): Contains reusable UI components such as header, footer, theme toggle, and a theme provider. These components are used across different pages.
- Assets (src/assets): Holds static assets like images that the application can reference.
- Library Utilities (src/lib): Contains helper functions (e.g., utils.ts) used across the app.
- Configuration Files: Files like next.config.ts, tsconfig.json, eslint.config.mjs, and postcss.config.mjs indicate project-level configuration—for routing, type checking, linting, and styling.

##### Relationships and Interactions
- User Interaction flows into routes defined under the “app” directory. For example, accessing /projects, /song, or /story will load corresponding pages.
- Static assets in the “assets” directory are imported by components or pages for UI rendering.
- The “lib” folder provides utility functions that can be used anywhere in the app, so represent this as a shared library that many components or pages may refer to.
- The Next.js configuration and build files (next.config.ts, tsconfig.json, etc.) are not runtime components but drive how the system is built, optimized, and executed. They can be mentioned in a “Configuration” block.

##### Architectural Patterns and Design Principles
- The application leverages the file‑system based routing of Next.js.
- Components are organized for reusability: a clear separation between the UI layout (header, footer, theme toggle) and the page contents.
- The separation of concerns is evident from the structure: pages for routing, components for UI elements, and lib for utilities.
- It adopts modern React (and possibly TypeScript) best practices given the .tsx file usage and configuration files.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User("User"):::external
    Framework("Next.js Framework"):::framework

    User -->|"makesRequest"| Framework

    subgraph "Pages (src/app)"
        direction TB
        Home("Home Page"):::page
        Globals("Globals Styling"):::page
        Projects("Projects Page"):::page
        Song("Song Page"):::page
        Story("Story Page"):::page
    end

    Framework -->|"routesTo"| Home
    Framework --> Projects
    Framework --> Song
    Framework --> Story
    Home -->|"includes"| Globals

    subgraph "UI Components (src/components)"
        direction TB
        Header("Header"):::component
        Footer("Footer"):::component
        ThemeProvider("Theme Provider"):::component
        ThemeToggle("Theme Toggle"):::component
    end

    Home -->|"renders"| Header
    Home --> Footer
    Home --> ThemeProvider
    Home --> ThemeToggle

    subgraph "Utility Libraries (src/lib)"
        direction TB
        Utilities("Utility Library"):::utility
    end

    Home -->|"uses"| Utilities

    subgraph "Assets (src/assets)"
        direction TB
        Assets("Assets"):::assets
    end

    Home -->|"imports"| Assets

    subgraph "Configuration"
        direction TB
        NextConfig("next.config.ts"):::config
        TSConfig("tsconfig.json"):::config
        ESLint("eslint.config.mjs"):::config
        PostCSS("postcss.config.mjs"):::config
    end

    Framework -->|"configuredBy"| NextConfig
    Framework --> TSConfig
    Framework --> ESLint
    Framework --> PostCSS

    click Home "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/app/page.tsx"
    click Globals "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/app/globals.css"
    click Projects "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/app/projects/page.tsx"
    click Song "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/app/song/page.tsx"
    click Story "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/app/story/page.tsx"
    click Header "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/components/header.tsx"
    click Footer "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/components/footer.tsx"
    click ThemeProvider "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/components/theme-provider.tsx"
    click ThemeToggle "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/components/theme-toggle.tsx"
    click Assets "https://github.com/winston-edwin-chiong/personal-website/tree/main/src/assets"
    click Utilities "https://github.com/winston-edwin-chiong/personal-website/blob/main/src/lib/utils.ts"
    click NextConfig "https://github.com/winston-edwin-chiong/personal-website/blob/main/next.config.ts"
    click TSConfig "https://github.com/winston-edwin-chiong/personal-website/blob/main/tsconfig.json"
    click ESLint "https://github.com/winston-edwin-chiong/personal-website/blob/main/eslint.config.mjs"
    click PostCSS "https://github.com/winston-edwin-chiong/personal-website/blob/main/postcss.config.mjs"

    classDef external fill:#f9f,stroke:#333,stroke-width:2px;
    classDef framework fill:#FFE0B2,stroke:#666,stroke-width:2px;
    classDef page fill:#BBDEFB,stroke:#0d47a1,stroke-width:2px;
    classDef component fill:#C8E6C9,stroke:#2e7d32,stroke-width:2px;
    classDef utility fill:#D1C4E9,stroke:#512da8,stroke-width:2px;
    classDef assets fill:#FFF9C4,stroke:#fbc02d,stroke-width:2px;
    classDef config fill:#FFCDD2,stroke:#c62828,stroke-width:2px;
```
