# ggonzalesd/astro-profile architecture

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

## Overview

##### Main Components
- Frontend (Presentation Layer): This is largely built using Astro components. The components are divided into several directories such as:
- Pages (in src/pages and src/components/pages) — these represent the different views for the various parts of the site (e.g., home, about, projects).
- Layouts (src/layouts) — there is a central layout (Layout.astro) that may wrap around the main pages.
- Shared and App-level Components (src/components/app, src/components/shared) — these include header, footer, language selector, and reusable UI elements.
- Content and Data Sources:
- Content files (src/content) – these include JSON files for certificates, Markdown files for project descriptions, and experience details.
- Assets (src/assets) – images, certificates, and other static files used for the portfolio.
- Internationalization (i18n):
- Language files are found under src/i18n, with subdirectories for different languages (en, es). This indicates that pages and content are configured to support multiple languages.
- Configuration and Build Tools:
- Configuration files such as astro.config.mjs, tailwind.config.mjs, tsconfig.json, and package.json indicate the use of Astro for static site generation, Tailwind CSS for styling, and TypeScript for type checking.
- Public Directory:
- The public directory, along with its subdirectories (like public/download), hosts static files (PDFs, robots.txt, etc.) accessible directly via URL.

##### Relationships / Interactions
- The Astro Build Process:
- The Astro compiler reads the source files (pages, components, layouts) in the src folder.
- It integrates assets from the src/assets and public directories.
- Markdown and JSON files from src/content feed into dynamic page generation (for projects, certificates, and experience details).
- Internationalization Flow:
- The i18n files provide localization strings used by pages (e.g., About, Projects) based on language-specific URLs (e.g., /en, /es).
- Component Hierarchy:
- A top-level Layout component wraps page components. Within these pages, specialized components like the header, footer, and language selector provide navigation and common UI elements.
- Static Assets Delivery:
- The public folder serves out static downloads and other assets separately from the dynamic content generated by Astro.

##### Architectural Patterns and Design Principles
- Separation of Concerns:
- Different directories for pages, components, layouts, assets, and content clearly indicate a separation between presentation, content, and configuration.
- Static Site Generation:
- Astro’s methodology ensures that dynamic content (such as project details retrieved from JSON/Markdown files) is pre-built into static pages.
- Multi-language Support:
- The inclusion of i18n resources emphasizes a layered approach where content and translations are separately managed and then composed at build time.

##### Relevant Technologies Identified
- Astro – For building the entire static website.
- Tailwind CSS – For styling (configured via tailwind.config.mjs).
- TypeScript – With types declared (tsconfig.json and d.ts files).
- Markdown / JSON – As formats for content (e.g., certificates, projects).
- Vercel (inferred from the portfolio URL) – Likely used for deployment.

##### Elements
- Astro Build & Compiler: Showing the compilation process of components to static pages.
- External interactions such as:
- How a user (browser) accesses the static site.
- The potential integration of build tools (if applicable).

##### Final Advice
- Be detailed and methodical. Avoid generalizing — capture each major component of the project's architecture.
- Separate concerns as much as possible; classify components by their roles (e.g., content generation, UI display, asset serving).

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Configuration Tools Subgraph
    subgraph "Build & Configuration Tools"
        ASTRO_CONFIG["Astro Config (astro.config.mjs)"]:::config
        TAILWIND_CONFIG["Tailwind Config (tailwind.config.mjs)"]:::config
        TSCONFIG["TypeScript Config (tsconfig.json)"]:::config
        PACKAGE["Package Config (package.json)"]:::config
    end

    %% Content Sources Subgraph
    subgraph "Content Sources"
        CONTENT["Content Files (Markdown/JSON)"]:::data
        I18N["Internationalization (i18n Resources)"]:::data
    end

    %% Frontend Components Subgraph
    subgraph "Frontend Components"
        PAGES["Pages / View Components"]:::frontend
        LAYOUT["Main Layout"]:::frontend
        APP_COMP["App Components"]:::frontend
        SHARED_COMP["Shared Components"]:::frontend
    end

    %% Static Assets Subgraph
    subgraph "Static Assets"
        ASSETS["Assets (Images, Certificates, etc.)"]:::static
        DOWNLOADS["Static Downloads"]:::static
    end

    %% Astro Build Process Node
    BUILDER["Astro Build Process"]:::builder

    %% End User Node
    USER["User (Browser)"]:::external

    %% Connections from Build Tools to Builder
    ASTRO_CONFIG --> BUILDER
    TAILWIND_CONFIG --> BUILDER
    TSCONFIG --> BUILDER
    PACKAGE --> BUILDER

    %% Connections from Content Sources to Builder
    CONTENT --> BUILDER
    I18N --> BUILDER

    %% Connections from Frontend Components to Builder
    PAGES --> BUILDER
    LAYOUT --> BUILDER
    APP_COMP --> BUILDER
    SHARED_COMP --> BUILDER

    %% Connections from Static Assets to Builder
    ASSETS --> BUILDER
    DOWNLOADS --> BUILDER

    %% Hierarchical relationships within Frontend Components
    LAYOUT -->|"wraps"| PAGES
    PAGES -->|"includes"| APP_COMP
    PAGES -->|"includes"| SHARED_COMP

    %% Final output to User Browser
    BUILDER -->|"renders static site"| USER

    %% Click Events for Build & Configuration Tools
    click ASTRO_CONFIG "https://github.com/ggonzalesd/astro-profile/blob/main/astro.config.mjs"
    click TAILWIND_CONFIG "https://github.com/ggonzalesd/astro-profile/blob/main/tailwind.config.mjs"
    click TSCONFIG "https://github.com/ggonzalesd/astro-profile/blob/main/tsconfig.json"
    click PACKAGE "https://github.com/ggonzalesd/astro-profile/blob/main/package.json"

    %% Click Events for Content Sources
    click CONTENT "https://github.com/ggonzalesd/astro-profile/tree/main/src/content"
    click I18N "https://github.com/ggonzalesd/astro-profile/tree/main/src/i18n"

    %% Click Events for Frontend Components
    click PAGES "https://github.com/ggonzalesd/astro-profile/tree/main/src/pages and src/components/pages"
    click LAYOUT "https://github.com/ggonzalesd/astro-profile/blob/main/src/layouts/Layout.astro"
    click APP_COMP "https://github.com/ggonzalesd/astro-profile/tree/main/src/components/app"
    click SHARED_COMP "https://github.com/ggonzalesd/astro-profile/tree/main/src/components/shared"

    %% Click Events for Static Assets
    click ASSETS "https://github.com/ggonzalesd/astro-profile/tree/main/src/assets"
    click DOWNLOADS "https://github.com/ggonzalesd/astro-profile/tree/main/public/download"

    %% Styles
    classDef config fill:#FFCC99,stroke:#663300,stroke-width:2px;
    classDef data fill:#FFF0B3,stroke:#CC6600,stroke-width:2px;
    classDef frontend fill:#B3E5FC,stroke:#0288D1,stroke-width:2px;
    classDef static fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef builder fill:#F8BBD0,stroke:#AD1457,stroke-width:2px;
    classDef external fill:#DCEDC8,stroke:#7CB342,stroke-width:2px;
```
