# andreodev/port-main architecture

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

- Interactive diagram: https://gitdiagram.com/andreodev/port-main
- Repository: https://github.com/andreodev/port-main

## Overview

##### Main Components
- Web Client: This is the core of the portfolio, built entirely with React.
- Public Assets: The public folder (with index.html, CNAME, etc.) acts as the entry point and contains static assets.
- Application Source: The src directory holds all React code, components, pages, contexts, and configuration.
- Routing & Navigation: The routing structure is managed via React Router (see src/rotas/routes.jsx) for different pages.
- Components & UI: Multiple sub-components (Header, Projects, Contacts, Footer, etc.) are used to build the interface.
- Styling: Tailwind CSS is configured (e.g., tailwind.config.js, postcss.config.js) and integrated through CSS files.
- Internationalization/Context Handling: LanguageContext, ThemeProvider, and i18n (src/i18n.js, src/locale) handle state/context and localization.

##### Relationships and Interactions
- The entry point (index.html) loads the React application.
- The React app (src/index.js / src/main.jsx) renders the App component (src/App.jsx), which orchestrates the display of various components.
- The routing layer (src/rotas/routes.jsx) directs navigation between the different pages (home, contacts, projects).
- UI components (in src/components) are assembled hierarchically – for example, the Header component composed of multiple subcomponents.
- Context providers (LanguageContext, ThemeProvider) wrap around the app to make internationalization and theming available throughout.
- The use of custom hooks (e.g., useSetupProjects, useSpotify) suggests there are interactive data-fetching elements.

##### Architectural Patterns & Design Principles
- Component-Based Architecture: React’s component model organizes the UI into reusable, isolated elements.
- Single Page Application (SPA): With React Router, the project follows SPA principles ensuring smooth, client-side navigation.
- Separation of Concerns: Different directories handle separate responsibilities (components, routes, context, localization, assets).
- Declarative UI: React’s declarative style makes the data flow and state management clearer.

##### Relevant Technologies
- React: Core library for the UI.
- Tailwind CSS: For rapid and responsive styling.
- Vite: Build tool for fast development iterations.
- React Router: Manages navigation between pages.
- JavaScript and some TypeScript files (such as the ProjectCards component) indicate potential type checking in some parts.
- Additional libraries and custom hooks (e.g., for interacting with APIs like Spotify) add dynamic data functionalities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Public Assets
    subgraph "Public Assets"
        IT["Entry Point (index.html)"]:::asset
        PUB["Public Folder"]:::asset
        click IT "https://github.com/andreodev/port-main/blob/main/index.html"
        click PUB "https://github.com/andreodev/port-main/tree/main/public/"
    end

    %% Source Code Layer
    subgraph "Source Code"
        WC["React Bootstrapping"]:::client
        click WC "https://github.com/andreodev/port-main/blob/main/src/index.js"
        click WC "https://github.com/andreodev/port-main/blob/main/src/main.jsx"
        
        AS["Application Source (src/)"]:::source
        click AS "https://github.com/andreodev/port-main/tree/main/src/"

        AR["App Component"]:::app

        CTR["Context Providers (Wrapper)"]:::context
        RT["Routing & Navigation"]:::router
        click RT "https://github.com/andreodev/port-main/blob/main/src/rotas/routes.jsx"

        %% UI Components Subgraph
        subgraph "UI Components"
            HD["Header Component"]:::component
            click HD "https://github.com/andreodev/port-main/blob/main/src/components/Header/index.jsx"
            click HD "https://github.com/andreodev/port-main/blob/main/src/components/Header/topo.jsx"
            PR["Projects Component"]:::component
            click PR "https://github.com/andreodev/port-main/blob/main/src/components/Projects/Projects.jsx"
            click PR "https://github.com/andreodev/port-main/blob/main/src/components/Projects/components/ProjectCards.tsx"
            CT["Contacts Component"]:::component
            click CT "https://github.com/andreodev/port-main/blob/main/src/components/contacts/contact.jsx"
            FT["Footer Component"]:::component
            click FT "https://github.com/andreodev/port-main/blob/main/src/components/footer/footer.jsx"
            GH["GitHub Component"]:::component
            click GH "https://github.com/andreodev/port-main/blob/main/src/components/github/github.jsx"
            SP["Spotify Component"]:::component
            click SP "https://github.com/andreodev/port-main/blob/main/src/components/spotify/SpotifyRecentTracks.jsx"
        end

        %% Internationalization Subgraph
        subgraph "Internationalization"
            INTL["i18n & Locale"]:::intl
            click INTL "https://github.com/andreodev/port-main/blob/main/src/i18n.js"
            click INTL "https://github.com/andreodev/port-main/tree/main/src/locale/"
        end

        %% Styling Subgraph
        subgraph "Styling"
            TW["Tailwind Config"]:::styling
            click TW "https://github.com/andreodev/port-main/blob/main/tailwind.config.js"
            PC["PostCSS Config"]:::styling
            click PC "https://github.com/andreodev/port-main/blob/main/postcss.config.js"
            AC["App.css"]:::styling
            click AC "https://github.com/andreodev/port-main/blob/main/src/App.css"
            IC["index.css"]:::styling
            click IC "https://github.com/andreodev/port-main/blob/main/src/index.css"
            HC["Hora.css"]:::styling
            click HC "https://github.com/andreodev/port-main/blob/main/src/components/Hora.css"
        end

        %% Context Providers Components Subgraph
        subgraph "Context Provider Components"
            LC["LanguageContext"]:::contextComp
            click LC "https://github.com/andreodev/port-main/blob/main/src/context/LanguageContext.jsx"
            TP["ThemeProvider"]:::contextComp
            click TP "https://github.com/andreodev/port-main/blob/main/src/context/ThemeProvider.jsx"
        end
    end

    %% Connections (Vertical Flow)
    IT --> WC
    WC --> AR
    AR --> CTR
    AR --> RT
    AR --> HD
    AR --> PR
    AR --> CT
    AR --> FT
    AR --> GH
    AR --> SP
    CTR --> LC
    CTR --> TP
    AR --> INTL
    AR --> TW

    %% Styles
    classDef asset fill:#f9e79f,stroke:#d4ac0d,stroke-width:2px;
    classDef client fill:#d6eaf8,stroke:#3498db,stroke-width:2px;
    classDef source fill:#ede7f6,stroke:#8e44ad,stroke-width:2px;
    classDef app fill:#f5eef8,stroke:#af7ac5,stroke-width:2px;
    classDef component fill:#e8f8f5,stroke:#1abc9c,stroke-width:2px;
    classDef router fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef context fill:#fce4ec,stroke:#e91e63,stroke-width:2px;
    classDef intl fill:#ebf5fb,stroke:#3498db,stroke-width:2px;
    classDef styling fill:#fdf2e9,stroke:#e67e22,stroke-width:2px;
    classDef contextComp fill:#E9F7EF,stroke:#28B463,stroke-width:2px;
```
