# jorgemacias-12/portfolio architecture

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

## Overview

##### Project Type and Purpose
- This is a personal portfolio site designed to showcase projects, skills, and the developer’s web development approach.
- It’s built using Astro as the static site generator, with React components for interactivity, TypeScript for type safety, and Tailwind CSS (along with Material UI) for styling.
- The project includes CI/CD using GitHub Actions to build and deploy the site to GitHub Pages.

##### Main Components
a. Frontend and Presentation Layer:
- Astro: The static site generator that assembles the pages.
- React Components: All UI components (e.g., Header, Card, Carrousel, etc.) that provide interactive parts within the Astro pages.
- Layouts: The overall page structure provided by Layout.astro.
- Styling: Tailwind CSS for utility-based styling and Material UI components.
b. State Management:
- Nanostores: Present in the /src/stores directory for handling state changes across the UI.
c. Internationalization:
- i18n: Modules that manage language support and locale data (/src/i18n and /src/locales).
d. Build and Deployment Pipeline:
- GitHub Actions: The CI/CD pipeline that triggers on Git tags.
- Build Process: Checkout, environment configuration (using dotenv), site building via Astro, and finally deployment to GitHub Pages.
e. Configuration & Environment:
- Environment files and config (from .env.example and various config files) managing sensitive data and build parameters.

##### Relationships and Interactions
- The Astro engine compiles the componentized pages (using the layouts and React components) into a static build.
- React components interact with the Nanostores-based state management for reactivity.
- The styling layer (Tailwind CSS and Material UI) directly styles the components.
- The build process (initiated via GitHub Actions) takes the source code (including all directories under /src and public assets) and outputs a deployable site.
- The deployed site is hosted on GitHub Pages, making the application accessible over the web.
- Environment variables (handled by dotenv) are injected during the build process for any configuration required.

##### Architectural Patterns and Design Principles
- Component-Driven Design: The separation of UI elements into self-contained components.
- Static Site Generation: Pre-rendered pages enhance performance and security.
- CI/CD Automation: Using GitHub Actions streamlines updates and deployments.
- Internationalization: Philosophy for supporting multiple languages in UI.
- Separation of Concerns: Clearly defined layers (presentation, state management, configuration) add to maintainability.

##### Elements
- Clearly Labeled Components:
- “Astro Engine”, “React Components”, “Layouts”, “State Management (Nanostores)”, “Internationalization”, “CI/CD (GitHub Actions)”, “Deployment (GitHub Pages)”, and “Configuration Management (dotenv, config files)”.
- Distinct Visual Encodings:

## Diagram (Mermaid)

```mermaid
flowchart TD

    subgraph "Frontend Layer"
        astroEngine["Astro Engine & Pages"]:::frontend
        reactComponents["React Components (UI Elements)"]:::frontend
        layouts["Layouts"]:::frontend
        styling["Styling (Tailwind CSS & Material UI)"]:::frontend
        stateManagement["State Management (Nanostores)"]:::frontend
        i18n["Internationalization"]:::frontend
    end

    subgraph "Build & Deployment Pipeline"
        configEnv["Configuration & Environment"]:::build
        cicd["CI/CD Pipeline (GitHub Actions)"]:::build
        buildProcess["Astro Build Process"]:::build
        deployment["Deployment (GitHub Pages)"]:::build
    end

    %% Frontend Interactions
    astroEngine -->|"renders"| layouts
    astroEngine -->|"integrates"| reactComponents
    reactComponents -->|"manages"| stateManagement
    reactComponents -->|"styledBy"| styling
    reactComponents -->|"localizedBy"| i18n

    %% Build Pipeline Flow
    configEnv -->|"providesConfig"| cicd
    cicd -->|"triggersBuild"| buildProcess
    buildProcess -->|"deploysTo"| deployment

    %% Interaction between Build and Frontend
    cicd -->|"buildsStaticSiteFrom"| astroEngine

    %% Styles
    classDef frontend fill:#DCEEFB,stroke:#0366d6,stroke-width:2px;
    classDef build fill:#FEE5CE,stroke:#D97706,stroke-width:2px;

    %% Click Events
    click astroEngine "https://github.com/jorgemacias-12/portfolio/tree/main//src/pages"
    click reactComponents "https://github.com/jorgemacias-12/portfolio/tree/main//src/components"
    click layouts "https://github.com/jorgemacias-12/portfolio/blob/main//src/layouts/Layout.astro"
    click styling "https://github.com/jorgemacias-12/portfolio/blob/main//tailwind.config.mjs"
    click stateManagement "https://github.com/jorgemacias-12/portfolio/blob/main//src/stores/index.ts"
    click i18n "https://github.com/jorgemacias-12/portfolio/tree/main//src/i18n"
    click cicd "https://github.com/jorgemacias-12/portfolio/blob/main//github/workflows/deploy.yml"
    click configEnv "https://github.com/jorgemacias-12/portfolio/blob/main/.env.example"
```
