# mauriciofrc/portfolio architecture

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

## Overview

##### Main Components
- Frontend Framework: Astro is the core of this project, which manages the rendering and bundling of components.
- Components: Under src/components, there’s a collection of reusable UI pieces (e.g., Hero, Header, Footer, AboutMe). They represent individual parts of the portfolio (work history, projects, social links, etc.).
- Layouts: The src/layouts directory (with Layout.astro) provides the common structure or template used across different pages.
- Pages: The src/pages directory holds the actual pages (e.g., index.astro) that put the components together to form the site.
- Public and Assets: The public folder (including its projects subfolder) contains static assets like images or project-specific files that are directly served.
- Configuration Files: Files like astro.config.mjs, tailwind.config.mjs, tsconfig.json, package.json help in defining the build process, dependencies, and overall project configuration.

##### Relationships and Interactions
- The Page (index.astro) is the entry point that uses the Layout component. The Layout, in turn, integrates various smaller components (like Hero, AboutMe, and Projects) to form the entire page.
- The public folder assets are referenced by components or configured during the build process using settings in astro.config.mjs.
- Dependencies and build settings from package.json and configuration files coordinate how the site is compiled and styled.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Layouts, pages, and components are kept distinct to separate the content, design, and reusability aspects.
- Static Site Generation: Astro pre-renders pages during build time, and components indicate this static-first paradigm.

##### Technologies, Frameworks, and Libraries
- Astro: Core framework to run the application.
- Tailwind CSS: Utility-first CSS styling that’s configured via tailwind.config.mjs.
- JavaScript & TypeScript: The project uses JavaScript features and has TypeScript definitions (indicated by tsconfig.json and env.d.ts).
- Other Build Tools: Package managers (npm, pnpm) and configuration files for dependency management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration & Build
    subgraph "Configuration & Build"
        AConfig["astro.config.mjs"]:::config
        Tailwind["tailwind.config.mjs"]:::config
        Package["package.json"]:::config
        Tsconfig["tsconfig.json"]:::config
        Env["src/env.d.ts"]:::config
    end

    %% Pages Layer
    subgraph "Pages"
        Page["index.astro"]:::page
    end

    %% Layouts Layer
    subgraph "Layouts"
        Layout["Layout Template"]:::layout
    end

    %% Reusable UI Components
    subgraph "Reusable UI Components"
        Hero["Hero"]:::component
        Header["Header"]:::component
        Footer["Footer"]:::component
        AboutMe["AboutMe"]:::component
        Projects["Projects"]:::component
    end

    %% Icons Components
    subgraph "Icons Components"
        GitHubIcon["GitHubIcon"]:::icon
        LinkedIn["LinkedIn"]:::icon
    end

    %% Static Assets
    subgraph "Static Assets"
        Assets["public"]:::static
    end

    %% Connections
    AConfig -->|"builds"| Page
    Page -->|"uses"| Layout
    Layout -->|"includes"| Hero
    Layout -->|"includes"| Header
    Layout -->|"includes"| Footer
    Layout -->|"includes"| AboutMe
    Layout -->|"includes"| Projects
    Layout -->|"includes"| GitHubIcon
    Layout -->|"includes"| LinkedIn

    Hero -->|"references"| Assets
    Header -->|"references"| Assets
    Footer -->|"references"| Assets
    AboutMe -->|"references"| Assets
    Projects -->|"references"| Assets

    %% Click Events
    click AConfig "https://github.com/mauriciofrc/portfolio/blob/main/astro.config.mjs"
    click Tailwind "https://github.com/mauriciofrc/portfolio/blob/main/tailwind.config.mjs"
    click Package "https://github.com/mauriciofrc/portfolio/blob/main/package.json"
    click Tsconfig "https://github.com/mauriciofrc/portfolio/blob/main/tsconfig.json"
    click Env "https://github.com/mauriciofrc/portfolio/blob/main/src/env.d.ts"
    click Page "https://github.com/mauriciofrc/portfolio/blob/main/src/pages/index.astro"
    click Layout "https://github.com/mauriciofrc/portfolio/blob/main/src/layouts/Layout.astro"
    click Hero "https://github.com/mauriciofrc/portfolio/blob/main/src/components/Hero.astro"
    click Header "https://github.com/mauriciofrc/portfolio/blob/main/src/components/Header.astro"
    click Footer "https://github.com/mauriciofrc/portfolio/blob/main/src/components/Footer.astro"
    click AboutMe "https://github.com/mauriciofrc/portfolio/blob/main/src/components/AboutMe.astro"
    click Projects "https://github.com/mauriciofrc/portfolio/blob/main/src/components/Projects.astro"
    click GitHubIcon "https://github.com/mauriciofrc/portfolio/blob/main/src/components/icons/GitHubIcon.astro"
    click LinkedIn "https://github.com/mauriciofrc/portfolio/blob/main/src/components/icons/LinkedIn.astro"
    click Assets "https://github.com/mauriciofrc/portfolio/tree/main/public"

    %% Styles
    classDef config fill:#f9e79f,stroke:#8e44ad,stroke-width:2px;
    classDef page fill:#fadbd8,stroke:#c0392b,stroke-width:2px;
    classDef layout fill:#d6eaf8,stroke:#2874a6,stroke-width:2px;
    classDef component fill:#d5f5e3,stroke:#239b56,stroke-width:2px;
    classDef icon fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef static fill:#fdebd0,stroke:#e67e22,stroke-width:2px;
```
