# bryan56gm/portfolio architecture

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

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

## Overview

##### Project Type & Purpose
- This is a single-page application (SPA) portfolio built to showcase professional work and technical proficiency in front-end development.
- The README emphasizes responsive design, interactive interfaces, dynamic routing, and multi-language support, all of which are critical aspects to capture.

##### Analyzing the File Structure
- Top-Level Files:
- index.html serves as the application’s entry point.
- package.json, pnpm-lock.yaml, and vite.config.js indicate usage of a build tool (Vite) and PNPM.
- Public Directory:
- src Directory:
- Contains the application logic, including the main entry (main.jsx) and the App.jsx which bootstraps the application.
- Components are modularized into their own directories (e.g., aboutButtons, header, hero, project); each follows a convention by having both component logic (e.g., AboutButtons.jsx) and styled components (e.g., ButtonsContainer.styled.jsx).
- Contexts and hooks directories provide shared state and custom functionality (e.g., for theme changes, language context, navigation, scroll reveal).
- Pages directory encapsulates major view components (Home, About, Contact, Projects, etc.), which are connected via React Router DOM as mentioned in the README.
- Utilities (utils) supply data for different sections like experience, projects, skills, as well as validation functions.
- Global styles and configuration files are organized under src/styles, ensuring consistency with styled-components.

##### Key Components
a. User Interface Layer:
- Pages (Home, About, Contact, Projects, NoFound) rendered by React Router DOM.
- Reusable UI components (header, hero, navigation, cards, skills, etc.) that build up the pages.
b. State & Theme Management:
- Context (LanguageContext) and hooks (useChangeTheme, useFlipCard, etc.) that manage dynamic behavior and global state.
c. Styling & Presentation:
- Use of styled-components (as seen in various *.styled.jsx files) for modular CSS.
d. Assets & Static Files:
- The public directory containing images, fonts, PDFs, and language JSON files.
e. Routing:
- React Router DOM setup in main components and pages for managing navigation and rendering of different views.

##### Guiding Principles
- Distinct layer as separate blocks/components:
- UI Components / Pages: Include each major view along with the reusable components that form them.
- Routing: A component that handles navigation flow (using React Router DOM).
- Global State: A context layer for language and theme management.
- Assets and Static Resources: Clearly show external asset sources.
- Clear directional flows:
- Data flow from contexts and hooks into components.
- Communication lines between presentation components (pages) and the router.
- Detailed labels:
- Block (e.g., “Theme Context”, “Routing Module”, “Global Styles”, “Reusable UI Components”).

##### Instructing the Principal Software Engineer
- From App.jsx, branch out to:
- The Routing Module that directs to various page components (Home, About, Contact, Projects, NoFound).
- A separate block for the State Management layer that includes LanguageContext and theme hooks.
- A block showing the Global Styling module (Global.styled.jsx and other style configurations).
- Additional blocks for each major component category (e.g., Header, Navigation, Hero, Cards) and grouping common UI elements.
- To represent the flow from the App to the routing and then to pages.
- To illustrate how contexts and hooks supply data to UI components.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry & Bootstrapping
    entry1("index.html"):::entry
    entry2("main.jsx"):::entry
    entry3("App.jsx"):::entry

    entry1 -->|"loads"| entry2
    entry2 -->|"boots"| entry3

    %% Routing Module
    subgraph "Routing Module"
        page1("Home"):::pages
        page2("About"):::pages
        page3("Contact"):::pages
        page4("Projects"):::pages
        page5("NoFound"):::pages
    end

    entry3 -->|"routes_to"| page1
    entry3 -->|"routes_to"| page2
    entry3 -->|"routes_to"| page3
    entry3 -->|"routes_to"| page4
    entry3 -->|"routes_to"| page5

    %% UI Components
    subgraph "UI Components"
        ui1("Header"):::ui
        ui2("Hero"):::ui
        ui3("About Buttons"):::ui
        ui4("Project_&_Swiper"):::ui
        ui5("Skills_&_Articles"):::ui
        ui6("Additional_UI_(Cards,_Description,_Form)"):::ui
    end

    entry3 -->|"integrates"| ui1
    entry3 -->|"integrates"| ui2
    entry3 -->|"integrates"| ui3
    entry3 -->|"integrates"| ui4
    entry3 -->|"integrates"| ui5
    entry3 -->|"integrates"| ui6

    %% State & Theme Management
    subgraph "State Management"
        state1("LanguageContext"):::state
        state2("Theme_&_Other_Hooks"):::state
    end

    entry3 -->|"provides_state"| state1
    entry3 -->|"utilizes_hooks"| state2

    %% Global Styling & Presentation
    subgraph "Global Styles"
        style1("Global_&_Base_Styles"):::styles
    end

    entry3 -->|"applies_styles"| style1

    %% Assets & Static Files
    assets("Public_Assets"):::assets
    entry3 -->|"loads_assets"| assets

    %% Click Events
    click entry1 "https://github.com/bryan56gm/portfolio/blob/main/index.html"
    click entry2 "https://github.com/bryan56gm/portfolio/blob/main/src/main.jsx"
    click entry3 "https://github.com/bryan56gm/portfolio/blob/main/src/App.jsx"

    click page1 "https://github.com/bryan56gm/portfolio/blob/main/src/pages/Home.jsx"
    click page2 "https://github.com/bryan56gm/portfolio/blob/main/src/pages/About.jsx"
    click page3 "https://github.com/bryan56gm/portfolio/blob/main/src/pages/Contact.jsx"
    click page4 "https://github.com/bryan56gm/portfolio/blob/main/src/pages/Projects.jsx"
    click page5 "https://github.com/bryan56gm/portfolio/blob/main/src/pages/NoFound.jsx"

    click ui1 "https://github.com/bryan56gm/portfolio/blob/main/src/components/header/Header.jsx"
    click ui2 "https://github.com/bryan56gm/portfolio/blob/main/src/components/hero/Hero.jsx"
    click ui3 "https://github.com/bryan56gm/portfolio/blob/main/src/components/aboutButtons/AboutButtons.jsx"
    click ui4 "https://github.com/bryan56gm/portfolio/blob/main/src/components/project/Project.jsx"
    click ui5 "https://github.com/bryan56gm/portfolio/blob/main/src/components/skills/Skills.jsx"

    click state1 "https://github.com/bryan56gm/portfolio/blob/main/src/contexts/LanguageContext.jsx"
    click state2 "https://github.com/bryan56gm/portfolio/blob/main/src/hooks/useChangeTheme.js"

    click style1 "https://github.com/bryan56gm/portfolio/blob/main/src/styles/base/Global.styled.jsx"
    click assets "https://github.com/bryan56gm/portfolio/tree/main/public/assets"

    %% Styles
    classDef entry fill:#f9e79f,stroke:#b9770e,stroke-width:2px;
    classDef pages fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef ui fill:#abebc6,stroke:#1e8449,stroke-width:2px;
    classDef state fill:#f5cba7,stroke:#d35400,stroke-width:2px;
    classDef styles fill:#d2b4de,stroke:#6c3483,stroke-width:2px;
    classDef assets fill:#f5b7b1,stroke:#922b21,stroke-width:2px;
```
