# oscarfdiaz/portfolio architecture

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

## Overview

The project is a personal portfolio website built using Vite and React, with a modern tech stack including TypeScript, SASS, animate.css, and i18next for internationalization. The overall purpose is to showcase the portfolio through well-organized and visually appealing sections, incorporating interactive elements such as easter eggs (e.g., the Konami code) and smooth transitions/animations.

##### Main Components
- Client-Side Application: This is the core component running in the browser.
- Entry Point: index.html and src/main.tsx which initialize the React application.
- UI Components: All individual React components grouped by features such as Home, About, Works, Contact, Navigator, and even the fun Konami module.
- Layouts: Specialized layout components (Footer, Navigator, SectionAbout, SectionContact, SectionMain, SectionWorks, SocialIcons) that dictate the overall page structure and navigation.
- Assets and Resources:
- Styles: SCSS files under src/styles that include component-specific and global style definitions.
- Helpers and Data Providers:
- JSON Helpers: Modules in src/helpers/json (e.g., navigatorItems, worksItems, designItems) serving as content/config for dynamic rendering.
- Utility Functions: Helpers such as konamicode.ts and matrix.ts managing interactivity or data transformations.
- Internationalization:
- i18n Setup: Managed under src/lang with configurations and language definitions.

##### Relationships and Interactions
- The index.html loads the bundled React application initialized via src/main.tsx.
- The main application renders high-level layout components (SectionMain, SectionAbout, etc.), which in turn compose smaller, specialized UI components.
- Data and configuration for sections like the navigator or works showcase are provided via JSON helper files.
- Assets and SASS styles are consumed by various components, ensuring consistent theming and iconography throughout the site.
- The i18next configuration (inside src/lang) integrates with React components for language switching.

##### Architectural Patterns and Design Principles
- Component-Based Architecture: Every feature (e.g., About, Contact, Works) is encapsulated in its own React component directory, which promotes modularity and reusability.
- Separation of Concerns: Layouts handle the overall structural presentation while individual components manage specific interface pieces.
- Configuration as Code: The use of JSON helpers to provide data means that the content is loosely coupled with the presentation logic.
- Responsive Design / Theming: SASS and animate.css are used for styling and animations, indicating a focus on a dynamic yet organized user interface.
- Internationalization (i18next): Ensures that language-specific content is decoupled and easily maintained.

##### Relevant Technologies and Frameworks
- Vite (Build Tool): Manages project bundling and development server setup.
- React: The core UI library.
- TypeScript: Provides static typing across the application.
- SASS: Modular styling via SCSS files.
- animate.css: For CSS-based animations.
- i18next: For managing translations and internationalization.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Points
    A["index.html"]:::entry
    B["main.tsx (Entry)"]:::entry

    %% Layout Components
    subgraph "Layout Components"
        L1["SectionMain"]:::layout
        L2["SectionAbout"]:::layout
        L3["SectionWorks"]:::layout
        L4["SectionContact"]:::layout
        L5["Navigator (Layout)"]:::layout
        L6["Footer"]:::layout
        L7["SocialIcons"]:::layout
    end

    %% UI Components
    subgraph "UI Components"
        U1["Home"]:::ui
        U2["About"]:::ui
        U3["Works"]:::ui
        U4["Contact"]:::ui
        U5["Navigator (UI)"]:::ui
        U6["Konami"]:::ui
    end

    %% Assets & Resources
    subgraph "Assets & Resources"
        AR1["Static Assets"]:::assets
        AR2["Public Assets"]:::assets
    end

    %% Styles & Animations
    S["Styles (SASS & animate.css)"]:::styles

    %% Helpers and Data Providers
    subgraph "Helpers and Data"
        H1["JSON Helpers"]:::helpers
        H2["konamicode (Util)"]:::helpers
        H3["matrix (Util)"]:::helpers
    end

    %% Internationalization Setup
    subgraph "Internationalization"
        I1["i18n Setup"]:::i18n
    end

    %% Configuration Files
    subgraph "Configuration"
        C1["vite.config.ts"]:::config
        C2["tsconfig.json"]:::config
        C3["package.json"]:::config
    end

    %% Connections
    A -->|"loads"| B
    B -->|"initializes"| L1
    B -->|"initializes"| L2
    B -->|"initializes"| L3
    B -->|"initializes"| L4
    B -->|"initializes"| L5
    B -->|"initializes"| L6
    B -->|"initializes"| L7
    B -->|"integrates"| I1
    B -->|"applies"| S

    %% Layout to UI Composition
    L1 -->|"includes"| U1
    L2 -->|"includes"| U2
    L3 -->|"includes"| U3
    L4 -->|"includes"| U4
    L5 -->|"supports"| U5
    B -->|"triggers easteregg"| U6

    %% UI Components interactions with Helpers
    U1 -->|"fetches data from"| H1
    U2 -->|"fetches data from"| H1
    U3 -->|"fetches data from"| H1
    U4 -->|"fetches data from"| H1
    U6 -->|"uses"| H2
    U6 -->|"uses"| H3

    %% Assets and Styles Usage
    U1 ---|"uses"| AR1
    U2 ---|"uses"| AR1
    U3 ---|"uses"| AR1
    U4 ---|"uses"| AR1
    L5 ---|"displays"| AR1
    S ---|"styles"| U1
    S ---|"styles"| L1
    S ---|"styles"| L2
    S ---|"styles"| L3
    S ---|"styles"| L4
    S ---|"styles"| L5
    S ---|"styles"| L6
    S ---|"styles"| L7

    %% Public Assets Connection
    AR2 ---|"provides extra assets"| B

    %% Click Events for Entry Points
    click A "https://github.com/oscarfdiaz/portfolio/blob/main/index.html"
    click B "https://github.com/oscarfdiaz/portfolio/blob/main/src/main.tsx"

    %% Click Events for UI Components
    click U1 "https://github.com/oscarfdiaz/portfolio/tree/main/src/components/Home"
    click U2 "https://github.com/oscarfdiaz/portfolio/tree/main/src/components/About"
    click U3 "https://github.com/oscarfdiaz/portfolio/tree/main/src/components/Works"
    click U4 "https://github.com/oscarfdiaz/portfolio/tree/main/src/components/Contact"
    click U5 "https://github.com/oscarfdiaz/portfolio/tree/main/src/components/Navigator"
    click U6 "https://github.com/oscarfdiaz/portfolio/tree/main/src/components/Konami"

    %% Click Events for Layout Components
    click L1 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/SectionMain.tsx"
    click L2 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/SectionAbout.tsx"
    click L3 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/SectionWorks.tsx"
    click L4 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/SectionContact.tsx"
    click L5 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/Navigator.tsx"
    click L6 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/Footer.tsx"
    click L7 "https://github.com/oscarfdiaz/portfolio/blob/main/src/layouts/SocialIcons.tsx"

    %% Click Events for Assets & Resources
    click AR1 "https://github.com/oscarfdiaz/portfolio/tree/main/src/assets"
    click AR2 "https://github.com/oscarfdiaz/portfolio/tree/main/public/CNAME"

    %% Click Event for Styles
    click S "https://github.com/oscarfdiaz/portfolio/tree/main/src/styles"

    %% Click Events for Helpers and Data
    click H1 "https://github.com/oscarfdiaz/portfolio/tree/main/src/helpers/json"
    click H2 "https://github.com/oscarfdiaz/portfolio/blob/main/src/helpers/konamicode.ts"
    click H3 "https://github.com/oscarfdiaz/portfolio/blob/main/src/helpers/matrix.ts"

    %% Click Events for Internationalization
    click I1 "https://github.com/oscarfdiaz/portfolio/blob/main/src/lang/i18n.ts"

    %% Click Events for Configuration Files
    click C1 "https://github.com/oscarfdiaz/portfolio/blob/main/vite.config.ts"
    click C2 "https://github.com/oscarfdiaz/portfolio/blob/main/tsconfig.json"
    click C3 "https://github.com/oscarfdiaz/portfolio/blob/main/package.json"

    %% Class Definitions for Colors
    classDef entry fill:#cfe2f3,stroke:#6c8ebf,stroke-width:2px;
    classDef ui fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef layout fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef assets fill:#e2e3e5,stroke:#41464b,stroke-width:2px;
    classDef styles fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef helpers fill:#ffeeba,stroke:#856404,stroke-width:2px;
    classDef i18n fill:#e0c3fc,stroke:#6f42c1,stroke-width:2px;
    classDef config fill:#f8d7da,stroke:#721c24,stroke-width:2px;
```
