# rnhc1000/profile architecture

> Architecture diagram of the GitHub repository rnhc1000/profile, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rnhc1000/profile
- Repository: https://github.com/rnhc1000/profile

## Overview

##### Project Type and Purpose
- This project is a professional portfolio website showcasing Ricardo Ferreira’s career. It is built using React (with TypeScript) and leverages Vite as the build tool. The primary focus is on frontend development, with a clear emphasis on modular components and routing.

##### Analyzing the File Structure
- Key top-level directories include:
- “public”: Serves public assets.
- “jenkins” and “nginx”: Contain build scripts, CI/CD pipeline scripts, and server configuration files (for deployment and reverse proxy configuration).
- “.scannerwork”: Likely generated by a code quality tool (such as SonarQube), demonstrating integration with code quality metrics.
- Notice the modularity and separation of concerns (for example, UI components are organized by function like “Contact”, “Header”, “Footer”, etc.) which indicates a component-based architecture typical of modern React applications.

##### Insights from the README
- The README outlines a hands-on career summary and details the technologies used (ReactJS, Vite, TypeScript, etc.). It emphasizes the use of hooks, component reusability, and a modular approach.
- Integration with external services (Jenkins for CI/CD and SonarQube for code scanning) is mentioned implicitly through the presence of configuration folders.

a. Main Components to Represent:
- Client/Browser: The end-user environment where the single-page React application runs.
- Frontend Application:
- UI/Presentation Layer: Built from React components (e.g., Header, Footer, Carousel, Contact, etc.).
- Routing Mechanism: Managed in the “src/routes” directory representing different pages or views (e.g., Home, Projects, Skills, Contacts).
- Assets and Styling: “src/assets” and “src/css” that provide visual content and styling to the components.
- Utility Functions: “src/utils” which support the components (e.g., CarouselData, ScrollToTop, TypeWriter).
- Development and Build Tools:
- Vite: Build tool driving the bundling and development server experience.
- TypeScript: As indicated by “.ts” and “.tsx” files enhancing type safety.
- CI/CD and Deployment Infrastructure:
- Jenkins: Shown in the “jenkins” folder. Represent this as a component handling automated testing, builds, and deployments.
- SonarQube/Static Analysis: The “.scannerwork” folder shows integration with code scanning tools.
- Nginx: Present via configuration files for deployment, potentially working as a reverse proxy or load balancer.

b. Relationships and Interactions:
- The client browser interacts with the frontend application. The SPA (Single Page Application) structure means that internal navigation is handled via React Router (as seen in “src/routes”).
- The build tool (Vite) compiles and serves the application, while CI/CD pipelines (Jenkins) automatically deploy changes.
- Nginx acts as an intermediary between client requests and the hosted application.
- The static analysis tool (SonarQube via the “.scannerwork” outputs) periodically runs and feeds quality data back to the developers.

c. Architectural Patterns and Technology Usage:
- Component-Based Architecture: Each UI component such as Contact, Footer, Header, Carousel, etc., is self-contained and reusable.
- Separation of Concerns: Clear division between UI components, routing, styling, and utility functions.
- Modern Frontend Tooling: Use of Vite, TypeScript, and React’s hooks indicates adherence to best practices in modern web development.
- CI/CD Integration: Leveraging Jenkins and static analysis emphasizes continuous integration, testing, and quality control.
- Deployment Architecture: Nginx configuration positions the application to be reverse-proxied or served in a production environment with best practices (such as handling SSL through “nginx.conf.proxySSL”).

- For this full-stack (frontend-heavy with build and deployment integrations) application, make sure you separate the user interface (React application) from the supporting tooling (build, CI/CD, and deployment).
- Use distinct sections or layers to show:
- The Client Layer (the browser)
- The Application Layer (React components, routing, assets)
- The Deployment Layer (Vite build system, Jenkins pipelines, Nginx reverse proxy, and static analysis tools)
- Interactions such as:
- User requests flowing from the browser to Nginx, which then passes requests to the served React application.
- Data flow within the application through component hierarchies and routing.
- The CI/CD pipeline that automatically builds and deploys changes.

##### Elements
- Annotations to highlight important patterns, like “Component-Based Architecture” for the UI side, and “CI/CD Pipeline” for the build and deployment side.

- Start from the external client and follow the path through the deployment and build pipelines to the internal components.
- Be as detailed as possible in splitting the concerns; don’t hesitate to separate the application into many smaller components if needed—this helps clarify interactions and dependencies.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        A["Client (Browser)"]:::client
    end

    %% Deployment Layer
    subgraph "Deployment Layer"
        N["Nginx Server"]:::deployment
    end

    %% Application Layer
    subgraph "Application Layer"
        SPA["React SPA"]:::frontend
        subgraph "Frontend Components"
            UI["UI Components (Header,Footer,Carousel,...)"]:::component
            RT["Routing Mechanism"]:::component
            AS["Assets and Styling"]:::component
            UF["Utility Functions"]:::component
        end
    end

    %% Development Tools Layer
    subgraph "Development Tools"
        VT["Vite Build & TypeScript"]:::build
    end

    %% CI/CD and Quality Layer
    subgraph "CI/CD & Quality"
        J["Jenkins CI/CD"]:::ci
        SA["Static Analysis (SonarQube)"]:::ci
    end

    %% Connections
    A -->|"sends_request"| N
    N -->|"forwards_request"| SPA
    SPA -->|"contains"| UI
    SPA -->|"contains"| RT
    SPA -->|"contains"| AS
    SPA -->|"contains"| UF
    VT -->|"builds"| SPA
    J -->|"triggers_build"| VT
    J -->|"deploys_to"| N
    SA -->|"analyzes_code"| VT

    %% Click Events (paths for click events, paths not shown in node labels)
    click A "https://github.com/rnhc1000/profile/blob/main/index.html"
    click SPA "https://github.com/rnhc1000/profile/tree/main/src"
    click UI "https://github.com/rnhc1000/profile/tree/main/src/components"
    click RT "https://github.com/rnhc1000/profile/tree/main/src/routes"
    click AS "https://github.com/rnhc1000/profile/tree/main/src/assets"
    click UF "https://github.com/rnhc1000/profile/tree/main/src/utils"
    click VT "https://github.com/rnhc1000/profile/blob/main/vite.config.ts"
    click J "https://github.com/rnhc1000/profile/tree/main/jenkins"
    click N "https://github.com/rnhc1000/profile/blob/main/nginx/nginx.conf.proxySSL"
    click SA "https://github.com/rnhc1000/profile/blob/main/.scannerwork"

    %% Styles
    classDef client fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef deployment fill:#F9E79F,stroke:#F4D03F,stroke-width:2px;
    classDef frontend fill:#A9DFBF,stroke:#239B56,stroke-width:2px;
    classDef component fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
    classDef build fill:#F5CBA7,stroke:#D35400,stroke-width:2px;
    classDef ci fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
```
