# gerardathletics/astro-portfolio architecture

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

## Overview

Based on our analysis of the provided file tree and README, this project is built using Astro and is structured as a modern static site (or hybrid server-side) with a focus on content presentation, internationalization, and blog/portfolio-like components. Although it started from the basic Astro Starter Kit template, the project’s file organization shows significant customization and expansion for a richer website experience.

##### Main Components
- Frontend Framework: At the heart of the project is the Astro framework, which interprets files in the src/pages directory as routes using .astro and .md files.
- UI Components: The bulk of the UI is built from components in src/components and its subdirectories. Notable components include header, footer, navbar, hero, about, blog-related components (BadgeCategories, HistoryPost, etc.), and several interactive components such as CopyEmail and ScrollTopBtn.
- Layouts: Two distinct layouts are defined—Layout.astro (for general pages) and LayoutBlog.astro (for blog-specific pages), which suggest a separation of overall site presentation and specialized blog views.
- Internationalization (i18n): The presence of the src/i18n directory along with several JSON translation files implies support for multiple languages (such as ca, en, es, nl). This is an important aspect when considering data flow and content rendering.
- Public Assets: The public folder contains static assets like images (for athletics, maps, projects), fonts, and possibly other media that are served directly.
- CSS and Build Tools: Tailwind is configured via tailwind.config.mjs, meaning that styling is managed using this framework; Astro’s configuration is centralized in astro.config.mjs. Also, the package.json and lock files show dependency management and build script definitions.

##### Out Relationships & Interactions
- The core frontend layer is rendered through pages in src/pages which act as entry points to the application. Each page incorporates one or more UI components from src/components.
- Layouts wrap around pages to provide common header, navigation, and footer components.
- The internationalization files deliver localized content to pages/components, influencing how content is rendered based on the chosen language.
- Components often have interrelations—for example, the Header.astro might be used across all pages, while blog-specific components are grouped under src/components/blog.
- Static assets in the public folder support multiple sections, possibly organized by thematic areas such as athletics, projects, and maps.

##### Architectural Patterns & Design Principles
- Component-Based Architecture: The project leverages Astro’s component model, meaning that each UI element (or a group thereof) is isolated in its own file for reusability.
- Separation of Concerns: There is a clear division between pages, components, and layouts. Additionally, internationalization is modularized within its own directory.
- Static Site Generation: By building upon Astro’s philosophy, the project focuses on pre-rendering routes during build time.
- Use of Modern Tooling: Integration with Tailwind and TypeScript (as evidenced by .tsx and tsconfig.json) emphasizes modern development practices.

- Project’s overall workflow: from file management in src and public directories to build processes as outlined by Astro CLI commands and configuration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        PAGES["Pages (src/pages)"]:::presentation
        subgraph "Layouts"
            LAYOUT1["Layout.astro"]:::layout
            LAYOUT2["LayoutBlog.astro"]:::layout
        end
        PAGES -->|"uses"| LAYOUT1
        PAGES -->|"uses"| LAYOUT2
    end

    %% Shared UI Components
    subgraph "Shared Components (UI)"
        UI1["Header.astro"]:::component
        UI2["Footer.astro"]:::component
        UI3["Navbar.tsx"]:::component
        UI4["Hero.astro"]:::component
        UI5["Experience.tsx"]:::component
        UI6["TimeLine.astro"]:::component
        UI7["CopyEmail.tsx"]:::component
        UI8["ScrollTopBtn.tsx"]:::component
    end

    %% Blog Components
    subgraph "Blog Components"
        BLOG1["BadgeCategories.astro"]:::component
        BLOG2["HistoryPost.astro"]:::component
        BLOG3["SectionContainerBlog.astro"]:::component
        BLOG4["FooterBlog.astro"]:::component
    end

    %% Internationalization
    subgraph "Internationalization (i18n)"
        I18N["i18n Directory"]:::i18n
        I18N1["ca.json"]:::i18nFile
        I18N2["en.json"]:::i18nFile
        I18N3["es.json"]:::i18nFile
        I18N4["nl.json"]:::i18nFile
        I18N5["index.ts"]:::i18nFile
        I18N --> I18N1
        I18N --> I18N2
        I18N --> I18N3
        I18N --> I18N4
        I18N --> I18N5
    end

    %% Static Assets
    subgraph "Static Assets"
        ASSETS["Public Assets (public)"]:::asset
    end

    %% Build and Configuration Tools
    subgraph "Build/Config Tools"
        BUILD1["astro.config.mjs"]:::config
        BUILD2["tailwind.config.mjs"]:::config
        BUILD3["package.json"]:::config
        BUILD4["pnpm-lock.yaml"]:::config
        BUILD5["tsconfig.json"]:::config
    end

    %% Relationships between Layers
    LAYOUT1 -->|"incorporates"| UI1
    LAYOUT1 -->|"incorporates"| UI2
    LAYOUT1 -->|"incorporates"| UI3
    LAYOUT1 -->|"incorporates"| UI4
    LAYOUT1 -->|"incorporates"| UI5
    LAYOUT1 -->|"incorporates"| UI6
    LAYOUT1 -->|"incorporates"| UI7
    LAYOUT1 -->|"incorporates"| UI8

    LAYOUT2 -->|"incorporates"| BLOG1
    LAYOUT2 -->|"incorporates"| BLOG2
    LAYOUT2 -->|"incorporates"| BLOG3
    LAYOUT2 -->|"incorporates"| BLOG4

    %% Internationalization flows
    I18N ---|"localizes"| PAGES
    I18N ---|"localizes"| UI1
    I18N ---|"localizes"| UI2

    %% Assets used by components
    ASSETS ---|"feeds"| UI4
    ASSETS ---|"feeds"| BLOG1

    %% Build/Config influences
    BUILD1 ---|"configures"| PAGES
    BUILD2 ---|"styles"| UI1
    BUILD3 ---|"build scripts"| PAGES
    BUILD4 ---|"dependency lock"| BUILD3
    BUILD5 ---|"TypeScript config"| UI3

    %% Click Events
    click PAGES "https://github.com/gerardathletics/astro-portfolio/tree/main/src/pages"
    click LAYOUT1 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/layouts/Layout.astro"
    click LAYOUT2 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/layouts/LayoutBlog.astro"
    click UI1 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/Header.astro"
    click UI2 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/Footer.astro"
    click UI3 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/Navbar.tsx"
    click UI4 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/Hero.astro"
    click UI5 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/Experience.tsx"
    click UI6 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/TimeLine.astro"
    click UI7 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/CopyEmail.tsx"
    click UI8 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/ScrollTopBtn.tsx"
    click BLOG1 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/blog/BadgeCategories.astro"
    click BLOG2 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/blog/HistoryPost.astro"
    click BLOG3 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/blog/SectionContainerBlog.astro"
    click BLOG4 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/components/blog/FooterBlog.astro"
    click I18N "https://github.com/gerardathletics/astro-portfolio/tree/main/src/i18n"
    click I18N1 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/i18n/ca.json"
    click I18N2 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/i18n/en.json"
    click I18N3 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/i18n/es.json"
    click I18N4 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/i18n/nl.json"
    click I18N5 "https://github.com/gerardathletics/astro-portfolio/blob/main/src/i18n/index.ts"
    click ASSETS "https://github.com/gerardathletics/astro-portfolio/tree/main/public"
    click BUILD1 "https://github.com/gerardathletics/astro-portfolio/blob/main/astro.config.mjs"
    click BUILD2 "https://github.com/gerardathletics/astro-portfolio/blob/main/tailwind.config.mjs"
    click BUILD3 "https://github.com/gerardathletics/astro-portfolio/blob/main/package.json"
    click BUILD4 "https://github.com/gerardathletics/astro-portfolio/blob/main/pnpm-lock.yaml"
    click BUILD5 "https://github.com/gerardathletics/astro-portfolio/blob/main/tsconfig.json"

    %% Styling
    classDef presentation fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef layout fill:#FF8C00,stroke:#333,stroke-width:2px;
    classDef component fill:#87CEFA,stroke:#333,stroke-width:2px;
    classDef i18n fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef i18nFile fill:#90EE90,stroke:#333,stroke-width:1px;
    classDef asset fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef config fill:#DDA0DD,stroke:#333,stroke-width:2px;
```
