# hoojinguyen/portfolio-by-ai architecture

> Architecture diagram of the GitHub repository hoojinguyen/portfolio-by-ai, 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/hoojinguyen/portfolio-by-ai
- Repository: https://github.com/hoojinguyen/portfolio-by-ai

## Overview

##### Main Components
a. Frontend Framework: The backbone is Next.js, which manages the server-side rendering, routing, and overall application lifecycle. This is visible in the “src/app” directory (layout.tsx, page.tsx, globals.css).
c. Configuration and Content Data: The “src/config” folder holds JSON files (portfolio.json, profile.json, resume.json, skills.json) which likely provide dynamic content or configuration for the portfolio.
d. Theme and Context Management: The “src/context/ThemeContext.tsx” is dedicated to managing the dark/light mode functionality, ensuring a consistent theme across components.
e. Utility Libraries: The “src/lib” folder contains helper functions (like utils.ts and iconMap.tsx) to support common functionalities and asset mapping.
f. Public Assets: The “public” directory (and its “images” subfolder) contains static resources that are served directly, such as images that the portfolio might display.
g. Build and Configuration Files: Files like next.config.ts, package.json, tsconfig.json, and configuration files for ESLint, Prettier, and PostCSS indicate the toolchain and deployment settings.

##### Relationships and Data Flow
- A container for the Next.js entry point (src/app).
- Within this container, show how the layout (layout.tsx) and the main page (page.tsx) feed in the various UI components.
- Flow from the layout to individual components:
- A separate block for configuration (src/config) that feeds dynamic data into components via props or context.
- ThemeContext as a provider that wraps around components ensuring consistent theming.
- Animation libraries:
- Separate blocks for “MagicUI” and “ArtifactUI” components (found under “src/components/magicui” and “src/components/artifactui” respectively) that are integrated directly within the UI components to provide advanced animations.
- Static Assets:
- “public” folder supplying assets (images, etc.) directly to components.
- Tooling & Build Process:
- Optionally, include a small block that highlights integration with ESLint, Prettier, and build scripts (like next.config.ts and package-lock.json) that ensure code quality and correct deployment.

##### Architectural Patterns and Design Principles
- Modular Design: The project divides responsibilities into clear directories (app, components, config, context, lib), following a modular component-based approach.
- Separation of Concerns: UI logic (in components) is separated from configuration (in JSON files) and context (for theming).
- Client-Side and Server-Side Blend: Leveraging Next.js allows you to combine server-side and client-side rendering where needed, even though most of the content here is static or pre-rendered.
- Reusability and Extensibility: The components are built for reusability (with specialized animations as separate components) and can be easily enhanced or replaced.

##### Final Checklist for Inclusion
- From configuration to UI components.
- From ThemeContext to all parts of the UI.
- Between UI components and external libraries used for animations.
- Keep details that show both the high-level architecture (entry point, modules, libraries) and the nuances inside the application (like the animation components and theme management).

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Next.js Framework
    subgraph "Next.js Framework"
        A["Next.js Entry (src/app)"]:::framework
        B["Layout Component (layout.tsx/page.tsx)"]:::framework
        C["Global Styles (globals.css)"]:::framework
    end

    %% UI Components
    subgraph "UI Components"
        D["AboutSection.tsx"]:::ui
        E["ContactSection.tsx"]:::ui
        F["Navigation.tsx"]:::ui
        G["PortfolioSection.tsx"]:::ui
        H["ProfileCard.tsx"]:::ui
        I["ResumeSection.tsx"]:::ui
        J["ThemeToggle.tsx"]:::ui
        K["SimpleLoader.tsx"]:::ui
    end

    %% Animation Libraries
    subgraph "Animation Libraries"
        %% General Animations
        subgraph "General Animations"
            L["CustomCursor.tsx"]:::animation
            M["FloatingActionButton.tsx"]:::animation
            N["FloatingElements.tsx"]:::animation
            O["ParticleBackground.tsx"]:::animation
            P["ScrollReveal.tsx"]:::animation
            Q["SpaceUniverse.tsx"]:::animation
            R["TiltEffect.tsx"]:::animation
        end
        %% ArtifactUI Animations
        subgraph "ArtifactUI Animations"
            S["particle-veil.tsx"]:::animation
        end
        %% MagicUI Animations
        subgraph "MagicUI Animations"
            T["apple-hello-effect.tsx"]:::animation
            U["border-beam.tsx"]:::animation
            V["cool-mode.tsx"]:::animation
            W["retro-grid.tsx"]:::animation
        end
    end

    %% Configuration & Content Data
    subgraph "Configuration & Content Data"
        X["portfolio.json"]:::config
        Y["profile.json"]:::config
        Z["resume.json"]:::config
        AA["skills.json"]:::config
    end

    %% Theme & Context
    subgraph "Theme & Context"
        AB["ThemeContext.tsx"]:::context
    end

    %% Utilities & Assets
    subgraph "Utilities & Assets"
        AC["iconMap.tsx"]:::lib
        AD["utils.ts"]:::lib
        AE["Public Assets (public/images)"]:::assets
    end

    %% Build & Configuration Files
    subgraph "Build & Configuration Files"
        AF["next.config.ts"]:::build
        AG["package.json"]:::build
        AH["tsconfig.json"]:::build
        AI[".husky/"]:::build
        AJ[".prettierrc.json"]:::build
        AK["postcss.config.mjs"]:::build
        AL["eslint.config.mjs"]:::build
    end

    %% Data Flow Connections
    A --> B
    B -->|"assembles"| D
    B --> F
    B --> H
    D -->|"integrates"| J

    %% Configuration providing data for UI Components
    X -->|"data"| D
    X -->|"data"| G
    E -->|"data"| X
    Y -->|"data"| H
    Z -->|"data"| I
    AA -->|"skills"| J

    %% Theme Context integration
    AB --- D
    AB --- F
    AB --- G
    AB --- H

    %% UI Components leveraging animations
    D -->|"animation"| L
    D -->|"animation"| T
    F -->|"animation"| N
    E -->|"animation"| O
    G -->|"animation"| S
    H -->|"animation"| U

    %% Global Styles and Assets
    C --> AE
    D --> AD
    E --> AC

    %% Build & Configuration influence the framework
    AF --> A
    AG --> A
    AH --> A

    %% Class Definitions for Colors
    classDef framework fill:#f9c,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbf,stroke:#333,stroke-width:2px;
    classDef animation fill:#bfb,stroke:#333,stroke-width:2px;
    classDef config fill:#ffb,stroke:#333,stroke-width:2px;
    classDef context fill:#fbf,stroke:#333,stroke-width:2px;
    classDef lib fill:#cff,stroke:#333,stroke-width:2px;
    classDef assets fill:#fcf,stroke:#333,stroke-width:2px;
    classDef build fill:#fdd,stroke:#333,stroke-width:2px;

    %% Click Events
    click A "https://github.com/hoojinguyen/portfolio-by-ai/tree/main/src/app"
    click B "https://github.com/hoojinguyen/portfolio-by-ai/tree/main/src/app"
    click C "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/app/globals.css"
    click D "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/AboutSection.tsx"
    click E "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/ContactSection.tsx"
    click F "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/Navigation.tsx"
    click G "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/PortfolioSection.tsx"
    click H "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/ProfileCard.tsx"
    click I "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/ResumeSection.tsx"
    click J "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/ThemeToggle.tsx"
    click K "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/SimpleLoader.tsx"
    click L "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/CustomCursor.tsx"
    click M "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/FloatingActionButton.tsx"
    click N "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/FloatingElements.tsx"
    click O "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/ParticleBackground.tsx"
    click P "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/ScrollReveal.tsx"
    click Q "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/SpaceUniverse.tsx"
    click R "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/animations/TiltEffect.tsx"
    click S "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/artifactui/particle-veil.tsx"
    click T "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/magicui/apple-hello-effect.tsx"
    click U "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/magicui/border-beam.tsx"
    click V "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/magicui/cool-mode.tsx"
    click W "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/components/magicui/retro-grid.tsx"
    click X "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/config/portfolio.json"
    click Y "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/config/profile.json"
    click Z "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/config/resume.json"
    click AA "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/config/skills.json"
    click AB "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/context/ThemeContext.tsx"
    click AC "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/lib/iconMap.tsx"
    click AD "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/src/lib/utils.ts"
    click AE "https://github.com/hoojinguyen/portfolio-by-ai/tree/main/public/images"
    click AF "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/next.config.ts"
    click AG "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/package.json"
    click AH "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/tsconfig.json"
    click AI "https://github.com/hoojinguyen/portfolio-by-ai/tree/main/.husky/"
    click AJ "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/.prettierrc.json"
    click AK "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/postcss.config.mjs"
    click AL "https://github.com/hoojinguyen/portfolio-by-ai/blob/main/eslint.config.mjs"
```
