# nahuam1/nahuam-portfolio architecture

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

## Overview

##### Project Type and Purpose
- It’s a Single-Page Application (SPA) that leverages React for UI, TypeScript for type-safety, and Vite as the build tool.
- The project appears to be structured as a portfolio/personal website with individual pages (home, about-me, contact-me, etc.) and a rich component library including shared UI components and reusable elements.

##### Analyzing the File Structure
- Top-Level Files & Folders: Files like index.html, package.json, tsconfig.json, vite.config.ts, and vercel.json reflect configuration and build setup.
- The src/ directory contains the application code:
- App.tsx: Likely the root component orchestrating the routing and layout.
- pages/: Contains dedicated page-level components that correspond to different routes (home, about-me, contact-me).
- components/: Contains various domain-specific components (AboutMeComponent, ContactMeComponent, NavBar, Resume, etc.). These are the core building blocks for the UI.
- ui-components/: Contains reusable UI elements (ButtonTemplate, IconButton, Loader, etc.) that can be used across the application.
- shared/: Holds shared data models (e.g., Experience.ts, Projects.ts, Skills.ts) and media assets which might be used throughout the site.
- Public Folder: Contains static assets that are referenced by the application through index.html.
- Configuration Files: ESLint configuration (.eslintrc.cjs) and Vite configuration confirm the development setup, and the README highlights configuration enhancements.

a. Main Components:
- Client/Browser (index.html as an entry point).
- Build Tool & Bundler (Vite).
- Application Entry Point (src/main.tsx and src/App.tsx).
- Routing and Pages (contained in src/pages, e.g., home, about-me, contact-me).
- UI & Domain Components (from src/components and src/ui-components).
- Shared Modules (from src/shared for data models and media).
- Configuration and Build Environment (package.json, tsconfig.json, ESLint, etc.).

b. Relationships and Interactions:
- How index.html loads the bundled code (via Vite) which executes main.tsx.
- That App.tsx is the central component that sets up the layout and routing.
- That reusable UI components (from src/ui-components) are integrated into domain-specific components.
- Dependencies such as how shared modules provide data structures used by components.

c. Architectural Patterns and Design Principles:
- Component-Based Architecture: Emphasize the separation into reusable “smart” components (e.g., NavBar, ExperienceCard) and domain-specific components.
- Layered Approach within the front-end: At the top you have routing/pages, followed by components, and at the bottom shared utilities and styling.
- Modern Front-End Best Practices: Use of TypeScript for static type checking and ESLint for code quality, along with Vite ensuring fast builds and HMR.

d. Relevant Technologies & Frameworks:
- React (for component-based UI)
- TypeScript (for type-safety across components)
- Vite (as the build tool and development server)
- SCSS (for component styling)
- ESLint and potentially Babel/SWC for fast refresh and type-aware linting.

##### Instructing the Principal Software Engineer
- Sub-blocks for src/main.tsx and src/App.tsx.
- Routing with branches to each page (home, about-me, contact-me).
- Finally, include a “Shared Modules” cluster that points to data models and static assets.
- Entry vs. UI vs. shared vs. configuration/build components.
- Annotations to note design principles such as “Component-Based Architecture” or “Separation of Concerns.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client"
        a1["index.html"]:::entry
    end

    %% Build Environment
    subgraph "Build Environment"
        b1["vite.config.ts"]:::build
        b2[".eslintrc.cjs"]:::build
    end

    %% Application Core
    subgraph "Application Core"
        ac1["src/main.tsx"]:::app
        ac2["src/App.tsx"]:::app
    end

    %% Page Components
    subgraph "Page Components"
        p1["Home Page (Home.tsx & Home.scss)"]:::page
        p2["About Me Page (AboutMe.tsx & AboutMe.scss)"]:::page
        p3["Contact Me Page (ContactMe.tsx & ContactMe.scss)"]:::page
    end

    %% Domain-Specific Components
    subgraph "Domain Components"
        d1["About Me Component"]:::domain
        d2["Contact Me Component (incl. MailSender)"]:::domain
        d3["Experience Component"]:::domain
        d4["NavBar Component"]:::domain
        d5["Projects Component"]:::domain
        d6["Resume Component"]:::domain
        d7["ResumeAbout Component"]:::domain
        d8["Skills Component"]:::domain
    end

    %% Reusable UI Components
    subgraph "UI Components"
        u1["ButtonTemplate"]:::ui
        u2["ExperienceCard"]:::ui
        u3["IconButton"]:::ui
        u4["Loader"]:::ui
        u5["ProjectCard"]:::ui
        u6["SnackBar"]:::ui
        u7["TextButton"]:::ui
        u8["TopButton"]:::ui
    end

    %% Shared Modules & Resources
    subgraph "Shared Modules"
        s1["Data Models (Experience, Projects, Skills)"]:::shared
        s2["Media Assets"]:::shared
        s3["Shared Styles/Variables"]:::shared
    end

    %% Connections
    a1 -->|"loads"| ac1
    b1 -->|"configures"| ac1
    b2 -->|"ensures quality for"| ac1
    ac1 -->|"initializes"| ac2
    ac2 -->|"routes to"| p1
    ac2 -->|"routes to"| p2
    ac2 -->|"routes to"| p3

    %% Page to Domain Components Connections
    p1 -->|"integrates"| d3
    p1 -->|"integrates"| d4
    p1 -->|"integrates"| d5

    p2 -->|"integrates"| d1
    p2 -->|"integrates"| d4

    p3 -->|"integrates"| d2
    p3 -->|"integrates"| d4

    %% Global Domain Component usage in App (e.g., NavBar)
    ac2 -->|"includes"| d4

    %% Domain Components use UI Components
    d1 ---|"uses"| u1
    d2 ---|"uses"| u3
    d3 ---|"uses"| u2
    d4 ---|"uses"| u7
    d5 ---|"uses"| u5
    d6 ---|"uses"| u6
    d7 ---|"uses"| u6
    d8 ---|"uses"| u4

    %% Pages may also directly use UI Components
    p1 ---|"enhances"| u8
    p2 ---|"enhances"| u8
    p3 ---|"enhances"| u8

    %% Both Domain and UI Components depend on Shared Modules
    d1 ---|"data from"| s1
    d2 ---|"data from"| s1
    d3 ---|"data from"| s1
    u1 ---|"styles from"| s3
    u2 ---|"styles from"| s3
    u3 ---|"styles from"| s3
    u4 ---|"styles from"| s3
    u5 ---|"styles from"| s3
    u6 ---|"styles from"| s3
    u7 ---|"styles from"| s3
    u8 ---|"styles from"| s3
    s1 ---|"assets in"| s2

    %% Click Events for Client and Build Environment
    click a1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/index.html"
    click b1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/vite.config.ts"
    click b2 "https://github.com/nahuam1/nahuam-portfolio/blob/main/.eslintrc.cjs"

    %% Click Events for Application Core
    click ac1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/main.tsx"
    click ac2 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/App.tsx"

    %% Click Events for Page Components
    click p1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/pages/home/Home.tsx"
    click p2 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/pages/about-me/AboutMe.tsx"
    click p3 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/pages/contact-me/ContactMe.tsx"

    %% Click Events for Domain-Specific Components
    click d1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/AboutMeComponent/AboutMeComponent.tsx"
    click d2 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/ContactMeComponent/ContactMeComponent.tsx"
    click d3 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/ExperienceComponent/ExperienceComponent.tsx"
    click d4 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/NavBar/NavBar.tsx"
    click d5 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/Proyects/Proyects.tsx"
    click d6 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/Resume/Resume.tsx"
    click d7 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/ResumeAbout/ResumeAbout.tsx"
    click d8 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/components/Skills/Skills.tsx"

    %% Click Events for UI Components
    click u1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/ButtonTemplate/ButtonTemplate.tsx"
    click u2 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/ExperienceCard/ExperienceCard.tsx"
    click u3 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/IconButton/IconButton.tsx"
    click u4 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/Loader/Loader.tsx"
    click u5 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/ProjectCard/ProjectCard.tsx"
    click u6 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/SnackBar/SnackBar.tsx"
    click u7 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/TextButton/TextButton.tsx"
    click u8 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/ui-components/TopButton/TopButton.tsx"

    %% Click Events for Shared Modules & Resources
    click s1 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/shared/Experience.ts"
    click s2 "https://github.com/nahuam1/nahuam-portfolio/tree/main/src/shared/media"
    click s3 "https://github.com/nahuam1/nahuam-portfolio/blob/main/src/shared/styles-variables.scss"

    %% Styles
    classDef entry fill:#E1F5FE,stroke:#0277BD,stroke-width:2px;
    classDef build fill:#E8F5E9,stroke:#2E7D32,stroke-width:2px;
    classDef app fill:#FFF3E0,stroke:#EF6C00,stroke-width:2px;
    classDef page fill:#FCE4EC,stroke:#C2185B,stroke-width:2px;
    classDef domain fill:#E3F2FD,stroke:#1976D2,stroke-width:2px;
    classDef ui fill:#F3E5F5,stroke:#8E24AA,stroke-width:2px;
    classDef shared fill:#E0F7FA,stroke:#00838F,stroke-width:2px;
```
