# rripollesg/portfolio architecture

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

## Overview

##### Main Components
- Frontend Client (Browser): This is the user's interface where index.html and EN.html are rendered.
- Static HTML Files: index.html and EN.html serve as the primary entry points.
- Assets Directory: Contains subdirectories for CSS, JS, images, certificates (PDFs). Identify CSS (design/style), JavaScript (interactive behavior, service worker, swipe and timeline features), and images.
- Service Worker: service-worker.js which likely offers offline caching and Progressive Web App (PWA) features.
- External Resources/Dependencies: The vendor directory under assets (if used for third-party libraries) and any externally loaded frameworks or libraries.

##### Relationships & Data Flow
- The Browser loads the primary HTML file (index.html or EN.html).
- From these HTML files, the browser pulls in CSS for styling, JavaScript for interactivity (index.js, main.js, maintimeline.js, swipe-content.js, util.js), and images from assets.
- The service worker (service-worker.js) is registered by the HTML page and interacts with the browser, managing caching and handling offline scenarios.
- The certificates and other PDF files within the assets/certificados directory are static resources that can be accessed via links from the webpage.

##### Architectural Patterns and Design Principles
- Separation of Concerns: HTML, CSS, and JavaScript are in distinct directories, ensuring clear separation between presentation, style, and behavior.
- Static File Serving: With everything stored as static assets, the deployment is likely to be on a platform like GitHub Pages or similar content delivery networks.
- Progressive Enhancement: The presence of a service worker suggests that offline caching or enhanced load performance (a PWA-like feature) is implemented.
- Simple Design: The project does not include a backend or database: all logic is client-side and focused on delivering a professional portfolio experience.

##### Important Technologies, Frameworks, or Libraries
- HTML/CSS/JavaScript: The core web technologies used.
- Service Worker API: Used for offline caching and potentially making the site a PWA.
- Any external libraries in the assets/vendor folder should be recognized as building blocks for UI components or additional interactivity.

##### Putting It All Together
– A direct link to the HTML files.
– From the HTML, include branches that point to CSS for styling and to JavaScript files for functionality.
– Another branch from HTML should indicate access to the “assets” such as images and PDFs.
- Also, include a separate node for the Service Worker showing its registration by the HTML file and illustrating the flow for caching and offline handling.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser("Browser (Client)"):::client
    Hosting("Static Server / GitHub Pages"):::server

    subgraph "HTML Files"
        Index("index.html"):::html
        EN("EN.html"):::html
    end

    CSS("CSS: style.css"):::css

    subgraph "JavaScript Files"
        JS1("index.js"):::js
        JS2("main.js"):::js
        JS3("maintimeline.js"):::js
        JS4("swipe-content.js"):::js
        JS5("util.js"):::js
    end

    SW("Service Worker: service-worker.js"):::sw
    Images("Images Directory"):::asset
    Cert("Certificates/PDFs Directory"):::asset
    Vendor("External Dependencies"):::vendor

    Browser -->|"requests"| Hosting
    Hosting -->|"serves"| Index
    Hosting -->|"serves"| EN

    Index -->|"loads"| CSS
    Index -->|"loads"| JS1
    Index -->|"loads"| JS2
    Index -->|"loads"| JS3
    Index -->|"loads"| JS4
    Index -->|"loads"| JS5
    Index -->|"registers"| SW
    Index -->|"accesses"| Images
    Index -->|"accesses"| Cert
    Index -->|"loads"| Vendor

    EN -->|"loads"| CSS
    EN -->|"loads"| JS1
    EN -->|"loads"| JS2
    EN -->|"loads"| JS3
    EN -->|"loads"| JS4
    EN -->|"loads"| JS5
    EN -->|"registers"| SW
    EN -->|"accesses"| Images
    EN -->|"accesses"| Cert
    EN -->|"loads"| Vendor

    classDef client fill:#C0E8F9,stroke:#333,stroke-width:2px;
    classDef server fill:#FFF2CC,stroke:#333,stroke-width:2px;
    classDef html fill:#D9EAD3,stroke:#333,stroke-width:2px;
    classDef css fill:#D0E0E3,stroke:#333,stroke-width:2px;
    classDef js fill:#F9CB9C,stroke:#333,stroke-width:2px;
    classDef asset fill:#CFE2F3,stroke:#333,stroke-width:2px;
    classDef sw fill:#F4CCCC,stroke:#333,stroke-width:2px;
    classDef vendor fill:#EAD1DC,stroke:#333,stroke-width:2px;

    click Index "https://github.com/rripollesg/portfolio/blob/main/index.html"
    click EN "https://github.com/rripollesg/portfolio/blob/main/EN.html"
    click CSS "https://github.com/rripollesg/portfolio/blob/main/assets/css/style.css"
    click JS1 "https://github.com/rripollesg/portfolio/blob/main/assets/js/index.js"
    click JS2 "https://github.com/rripollesg/portfolio/blob/main/assets/js/main.js"
    click JS3 "https://github.com/rripollesg/portfolio/blob/main/assets/js/maintimeline.js"
    click JS4 "https://github.com/rripollesg/portfolio/blob/main/assets/js/swipe-content.js"
    click JS5 "https://github.com/rripollesg/portfolio/blob/main/assets/js/util.js"
    click Images "https://github.com/rripollesg/portfolio/tree/main/assets/img"
    click Cert "https://github.com/rripollesg/portfolio/tree/main/assets/certificados"
    click SW "https://github.com/rripollesg/portfolio/blob/main/service-worker.js"
    click Vendor "https://github.com/rripollesg/portfolio/tree/main/assets/vendor"
```
