# abeltruong/abel-portfolio architecture

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

## Overview

##### Main Components
- Frontend Markup: The core HTML files (e.g., index.html, google274554f74ea14d5d.html) form the basic structure of the site.
- Style Layer:
- SCSS Source Files: Located in assets/sass, these files (like _nav_bar.scss, _responsive.scss, etc.) are compiled into CSS.
- Compiled CSS: The output CSS files (assets/css/app.css) are used by the HTML.
- JavaScript Functionality:
- Assets in assets/js and js directory form the site’s interactive behaviors (blog handling, modals, actions).
- Mock Data & Additional Assets:
- The mocks directory provides sample data (e.g., blogs.json and abel_CV.pdf) often used for testing or demonstration.
- Images and other static assets are stored in assets/images.
- Build & Tooling:
- package.json, webpack.config.js, and associated configuration files indicate that a build process (such as compiling SCSS, bundling JS) is part of the project.
- Deployment & Configuration:
- Files like CNAME and configuration files for GitHub (.github) and Prettier indicate deployment details and coding styles.

##### Out Component Relationships
- The HTML pages link to the CSS (compiled from SCSS) and include JavaScript files.
- The SCSS files (assets/sass) are processed—likely via a bundler and the “yarn compile_style” script—to generate the main CSS (assets/css/app.css).
- JavaScript components (from both assets/js and js directories) attach dynamic behaviors (e.g., modal pop-ups, blog interactions) to the DOM.
- The build tools (webpack.config.js) and package.json are responsible for compiling and optimizing the code before deployment.
- The mocks folder can be represented as sample data sources; these are not served directly but are useful during development/testing.
- External integrations include Google Search Console and schema markup for blog and homepage, which can be shown as connections from the website to online services.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Presentation (HTML), styling (SCSS/CSS), and behavior (JavaScript) are clearly separated.
- Modular & Maintainable Code: The use of separate SCSS files for different site sections (e.g., _blog.scss, _nav_bar.scss) suggests modularity, making the CSS easier to maintain.
- Static Site Architecture: Since the project is a static site, all resources are precompiled and then served via a static hosting solution.
- Build Pipeline: The integration of Webpack and Yarn scripts points to an automated build process for asset compilation and bundling.

##### Be Detailed but Focused
- Essential details as mentioned without overcomplicating: if needed, label additional paths like the schema markup injection, which is executed by JavaScript after reading meta tags (as shown in the example code from the README).
- Clearly demarcate development-time artifacts (like mocks and configuration files) versus the production build.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Source Files
    subgraph "Source Files"
        HTML1["index.html"]:::markup
        HTML2["google274554f74ea14d5d.html"]:::markup
        SCSS["SCSS Source (assets/sass)"]:::scss
        JSAssets["JS (assets/js)"]:::js
        JSDir["JS (js)"]:::js
        Images["Static Images (assets/images)"]:::static
        Mocks["Mock Data & Assets (mocks)"]:::mocks
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        PackageJSON["package.json"]:::build
        WebpackConfig["webpack.config.js"]:::build
        BuildProcess["Build Process"]:::buildProc
    end

    %% Deployment & Configuration
    subgraph "Deployment & Config"
        CNAME["CNAME"]:::deploy
        Github[".github"]:::deploy
        PrettierRC[".prettierrc"]:::deploy
        PrettierIgnore[".prettierignore"]:::deploy
        Gitignore[".gitignore"]:::deploy
    end

    %% Processed Assets and Final Deployed Site
    CompiledCSS["Compiled CSS (assets/css/app.css)"]:::css
    ProcessedJS["Processed JS (JavaScript Functionality)"]:::jsFunc
    Deployed["Deployed Site"]:::deploy
    External["External Services (Google,SchemaMarkup)"]:::external

    %% Connections from Source Files to Build Process
    PackageJSON --> BuildProcess
    WebpackConfig --> BuildProcess
    SCSS --> BuildProcess
    JSAssets --> BuildProcess
    JSDir --> BuildProcess

    %% Build Process outputs
    BuildProcess --> CompiledCSS
    BuildProcess --> ProcessedJS
    BuildProcess --> Deployed

    %% Deployment & Config contribute to Deployed Site
    CNAME --> Deployed
    Github --> Deployed
    PrettierRC --> Deployed
    PrettierIgnore --> Deployed
    Gitignore --> Deployed

    %% HTML and Images directly included in Deployed Site
    HTML1 --> Deployed
    HTML2 --> Deployed
    Images --> Deployed

    %% HTML references to processed assets
    HTML1 -->|"ref"| CompiledCSS
    HTML2 -->|"ref"| CompiledCSS
    HTML1 -->|"ref"| ProcessedJS
    HTML2 -->|"ref"| ProcessedJS

    %% Mocks used for development/testing
    Mocks -.->|"dev-use"| BuildProcess

    %% Deployed site integrates with external services
    Deployed -->|"integrates"| External

    %% Click Events
    click HTML1 "https://github.com/abeltruong/abel-portfolio/blob/master/index.html"
    click HTML2 "https://github.com/abeltruong/abel-portfolio/blob/master/google274554f74ea14d5d.html"
    click SCSS "https://github.com/abeltruong/abel-portfolio/tree/master/assets/sass"
    click CompiledCSS "https://github.com/abeltruong/abel-portfolio/blob/master/assets/css/app.css"
    click JSAssets "https://github.com/abeltruong/abel-portfolio/tree/master/assets/js"
    click JSDir "https://github.com/abeltruong/abel-portfolio/tree/master/js"
    click Mocks "https://github.com/abeltruong/abel-portfolio/tree/master/mocks"
    click Images "https://github.com/abeltruong/abel-portfolio/tree/master/assets/images"
    click PackageJSON "https://github.com/abeltruong/abel-portfolio/blob/master/package.json"
    click WebpackConfig "https://github.com/abeltruong/abel-portfolio/blob/master/webpack.config.js"
    click CNAME "https://github.com/abeltruong/abel-portfolio/tree/master/CNAME"
    click Github "https://github.com/abeltruong/abel-portfolio/blob/master/.github"
    click PrettierRC "https://github.com/abeltruong/abel-portfolio/blob/master/.prettierrc"
    click PrettierIgnore "https://github.com/abeltruong/abel-portfolio/blob/master/.prettierignore"
    click Gitignore "https://github.com/abeltruong/abel-portfolio/blob/master/.gitignore"

    %% Styles
    classDef markup fill:#f9f,stroke:#333,stroke-width:2px;
    classDef scss fill:#cff,stroke:#333,stroke-width:2px;
    classDef js fill:#cfc,stroke:#333,stroke-width:2px;
    classDef static fill:#fcf,stroke:#333,stroke-width:2px;
    classDef mocks fill:#eee,stroke:#333,stroke-width:2px;
    classDef build fill:#ff9,stroke:#333,stroke-width:2px;
    classDef buildProc fill:#f96,stroke:#333,stroke-width:2px;
    classDef css fill:#ccf,stroke:#333,stroke-width:2px;
    classDef jsFunc fill:#c9f,stroke:#333,stroke-width:2px;
    classDef deploy fill:#9f9,stroke:#333,stroke-width:2px;
    classDef external fill:#f99,stroke:#333,stroke-width:2px;
```
