# jayyyu1w/jayyue-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/jayyyu1w/jayyue-portfolio
- Repository: https://github.com/jayyyu1w/jayyue-portfolio

## Overview

##### Main Components
- Frontend Presentation Layer: The project consists mainly of client-side components and pages built using Astro. Key folders include:
- src/components – Contains reusable UI components such as Hero, Footer, Nav, and ThemeToggle.
- src/layouts – Contains the BaseLayout that wraps pages with consistent styling and structure.
- src/pages – Defines individual pages like the homepage, about, project overview page, and dynamic project detail pages.
- Content Management: The project uses a content folder (src/content) comprised of configuration and markdown files for each project description, serving as a lightweight content management system.
- Public Assets: The public directory holds static assets (such as images and backgrounds) needed by components and pages.
- Configuration & Build Setup: Files like astro.config.mjs, package.json, tsconfig.json, and the environment type declaration (src/env.d.ts) establish the build configuration, dependencies, and overall project setup.

##### Relationships and Interactions
- The Astro engine (configured via astro.config.mjs) drives the rendering process. During the build, it composes pages by combining layouts (from src/layouts) with content (pulled from src/content and markdown files) and UI components (from src/components).
- The pages in src/pages use BaseLayout and include components that fetch or render content written in Markdown. They interact with the content configuration (src/content/config.ts) to display projects dynamically.
- Public assets are statically served to the client and referenced by UI components for visual enhancements.

##### Architectural Patterns and Design Principles
- Component-based architecture: The use of Astro components (e.g., CallToAction, Footer, Nav) encourages modular and reusable UI elements.
- Separation of concerns: Content is kept separate in markdown files and configuration settings, reducing code clutter and enhancing maintainability.
- Routing and dynamic content: Dynamic pages (notably in src/pages/project/[...slug].astro) indicate the use of dynamic routing, which is very typical in static site generators for handling multiple content entries.
- Static site generation: The project uses SSG principles where pages are pre-built and optimized for fast load times, enhancing performance and reliability.

##### Relevant Technologies and Frameworks
- Astro: The primary framework enabling static site generation with support for components.
- JavaScript/TypeScript: Evident from package.json and tsconfig.json files.
- Markdown: Used for content in src/content/project, facilitating content management.
- CSS and possibly newer styling techniques as referenced in src/styles/global.css.

##### Elements
- Clear Labels: Name each component (e.g., “UI Components”, “Page Templates”, “Content Repository”, “Public Assets”, “Astro Config & Build”).

##### Detailed Breakdown
- Top Level: Represent the Astro build process controlled by configuration files (astro.config.mjs, package.json, tsconfig.json).
- Left/Upper Panel: Outline the Content Layer with src/content (including project markdowns and config.ts).
- Right/Lower Panel: Include the UI Components from src/components, demonstrating how these components are embedded into the pages/layouts.
- Bottom/Side Panel: Show Public Assets (static files in the public directory) which are utilized for visual elements across components.
- Interaction Lines: Illustrate how content and assets feed into the page rendering pipelines and how the Astro CLI orchestrates the build and deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration & Build Setup
    subgraph "Configuration & Build Setup"
        AConf("astro.config.mjs"):::config
        Pkg("package.json"):::config
        TsConf("tsconfig.json"):::config
        Env("src/env.d.ts"):::config
    end

    %% Rendering Layer
    subgraph "Rendering Layer"
        BL("Base Layout"):::rendering
        Pages("Pages"):::rendering
    end

    %% Other Layers
    CR("Content Repository"):::content
    UI("UI Components"):::components
    PA("Public Assets"):::assets

    %% Connections from Configuration to Rendering
    AConf -->|"configures"| BL
    AConf -->|"configures"| Pages
    Pkg -->|"configures"| BL
    Pkg -->|"configures"| Pages
    TsConf -->|"configures"| BL
    TsConf -->|"configures"| Pages
    Env -->|"configures"| BL
    Env -->|"configures"| Pages

    %% Content feeds into Rendering
    CR -->|"provides"| BL
    CR -->|"provides"| Pages

    %% Pages use the Base Layout (Layout wraps Pages)
    Pages -->|"wrappedBy"| BL

    %% UI Components used within Pages
    Pages -->|"includes"| UI

    %% Public Assets referenced by UI Components
    PA -->|"supplies"| UI

    %% Styling Classes
    classDef config fill:#f9e6ff,stroke:#8a2be2,stroke-width:2px;
    classDef rendering fill:#e0f7fa,stroke:#00796b,stroke-width:2px;
    classDef content fill:#e8f5e9,stroke:#388e3c,stroke-width:2px;
    classDef components fill:#fce4ec,stroke:#d81b60,stroke-width:2px;
    classDef assets fill:#fff9c4,stroke:#fbc02d,stroke-width:2px;

    %% Click Events for Component Mapping
    click UI "https://github.com/jayyyu1w/jayyue-portfolio/tree/main/src/components"
    click BL "https://github.com/jayyyu1w/jayyue-portfolio/blob/main/src/layouts/BaseLayout.astro"
    click Pages "https://github.com/jayyyu1w/jayyue-portfolio/tree/main/src/pages"
    click CR "https://github.com/jayyyu1w/jayyue-portfolio/tree/main/src/content"
    click PA "https://github.com/jayyyu1w/jayyue-portfolio/tree/main/public/assets"
    click AConf "https://github.com/jayyyu1w/jayyue-portfolio/blob/main/astro.config.mjs"
    click Pkg "https://github.com/jayyyu1w/jayyue-portfolio/blob/main/package.json"
    click TsConf "https://github.com/jayyyu1w/jayyue-portfolio/blob/main/tsconfig.json"
    click Env "https://github.com/jayyyu1w/jayyue-portfolio/blob/main/src/env.d.ts"
```
