# raullize/my-personal-portfolio architecture

> Architecture diagram of the GitHub repository raullize/my-personal-portfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raullize/my-personal-portfolio
- Repository: https://github.com/raullize/my-personal-portfolio

## Overview

##### Project Type and Purpose
- This is a Next.js–based personal portfolio website (a frontend-centric full-stack application with server-side rendering and static-site generation).
- It showcases the developer’s bio, projects, timeline, language toggle (i18n), and provides downloadable resumes.

##### Main Components
a. Next.js Server & Routing
- layout.jsx & page.jsx under `/app` define the root layout and the homepage route.
- Next’s file-based routing mechanism automatically exposes these routes.
b. React UI Components
- `/app/components`: Leaf components (About, Contact, Footer, Header, etc.)
- `/app/components/ui`: Reusable UI primitives (FadeIn, GradientText, LoadingScreen, ProjectCard, ClickSpark, SmoothScroll, etc.)
c. Internationalization (i18n)
- `/app/i18n/en.json` & `pt.json`: translation dictionaries
- `useTranslation.js` + `useLanguage.js` hook manage language state and text injection.
d. Styling
- Tailwind CSS configured via `tailwind.config.js`, imported in `globals.css`.
- PostCSS pipeline via `postcss.config.js`
e. Static Assets
f. Build & Config
- `next.config.mjs`: Next.js custom configuration (e.g., image domains, i18n settings).
- `package.json`, `package-lock.json`, `jsconfig.json`, `eslint.config.mjs` for tooling and IDE support.

##### Relationships & Data Flow
- User’s Browser → HTTP Request → Next.js Server
- Server decides SSR vs. static generation → renders React components
- Components fetch translations from `/app/i18n` via hook
- Tailwind-generated CSS & bundled JS served
- Static assets served from `/public`
- Client-Side Interactions
- Language toggle triggers `useLanguage` → updates translations on the fly
- Smooth scroll, fade-ins and other UI effects handled client-side in the primitives

##### Architectural Patterns & Principles
- Component-Based Architecture: clean separation between “dumb” UI primitives and “smart” page-level components
- File-Based Routing (Next.js “app” directory)
- Utility-First CSS (Tailwind) for rapid, consistent styling
- Hook-Driven State & Effects (custom hooks for i18n)
- Static-First with SSR/SSG for performance and SEO

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Global entities
    Browser["User Browser"]:::external

    %% Next.js Server & Routing
    subgraph "Next.js Server & Routing"
        direction TB
        Server["Next.js Server"]:::server
        Layout["layout.jsx"]:::server
        Page["page.jsx"]:::server
    end

    %% React Page-Level Components
    subgraph "Page-Level Components"
        direction TB
        About["About.jsx"]:::page
        CVDownload["CVDownload.jsx"]:::page
        Contact["Contact.jsx"]:::page
        Footer["Footer.jsx"]:::page
        Header["Header.jsx"]:::page
        LanguageToggle["LanguageToggle.jsx"]:::page
        Projects["Projects.jsx"]:::page
        Timeline["Timeline.jsx"]:::page
    end

    %% UI Primitives
    subgraph "UI Primitives"
        direction TB
        ClickSpark["ClickSpark.jsx"]:::ui
        ClientRootWrapper["ClientRootWrapper.jsx"]:::ui
        DecryptedText["DecryptedText.jsx"]:::ui
        FadeIn["FadeIn.jsx"]:::ui
        GradientText["GradientText.jsx"]:::ui
        LoadingScreen["LoadingScreen.jsx"]:::ui
        ProjectCard["ProjectCard.jsx"]:::ui
        ScrollToTop["ScrollToTop.jsx"]:::ui
        SmoothScroll["SmoothScroll.jsx"]:::ui
        Squares["Squares.jsx"]:::ui
    end

    %% Internationalization Service
    subgraph "i18n Service"
        direction TB
        EN["en.json"]:::i18n
        PT["pt.json"]:::i18n
        UseTranslation["useTranslation.js"]:::i18n
    end

    %% Language State Hook
    LanguageHook["useLanguage.js"]:::i18n

    %% Styling Pipeline
    subgraph "Styling Pipeline"
        direction TB
        TailwindCfg["tailwind.config.js"]:::styling
        PostCSS["postcss.config.js"]:::styling
        GlobalsCSS["globals.css"]:::styling
    end

    %% Static Assets
    subgraph "Static Assets"
        direction TB
        CV_EN["cv-raul-en.pdf"]:::assets
        CV_PT["cv-raul-pt-br.pdf"]:::assets
        Icons["icons/"]:::assets
        ProjectsAssets["projects/"]:::assets
    end

    %% Build & Tooling Configuration
    subgraph "Build & Tooling"
        direction TB
        NextConfig["next.config.mjs"]:::tooling
        JSConfig["jsconfig.json"]:::tooling
        ESLint["eslint.config.mjs"]:::tooling
        Package["package.json"]:::tooling
        PackageLock["package-lock.json"]:::tooling
    end

    %% Connections
    Browser -->|"HTTP Request"| Server
    Server -->|"SSR render"| About
    Server -->|"SSR render"| CVDownload
    Server -->|"SSR render"| Contact
    Server -->|"SSR render"| Footer
    Server -->|"SSR render"| Header
    Server -->|"SSR render"| LanguageToggle
    Server -->|"SSR render"| Projects
    Server -->|"SSR render"| Timeline

    %% Page to UI Primitives
    About -->|"uses"| FadeIn
    Header -->|"uses"| GradientText
    Projects -->|"uses"| ProjectCard
    LanguageToggle -->|"uses"| ClickSpark
    Timeline -->|"uses"| SmoothScroll

    %% Translation flow
    About -->|"fetch translations"| UseTranslation
    Contact -->|"fetch translations"| UseTranslation
    LanguageToggle -->|"change language"| LanguageHook
    LanguageHook -->|"updates state"| UseTranslation
    UseTranslation -->|"reads JSON"| EN
    UseTranslation -->|"reads JSON"| PT

    %% Static assets
    Server -->|"serve assets"| CV_EN
    Server -->|"serve assets"| CV_PT
    Server -->|"serve assets"| Icons
    Server -->|"serve assets"| ProjectsAssets

    %% Styling pipeline
    Server -->|"build CSS"| TailwindCfg
    TailwindCfg -->|"configures"| PostCSS
    PostCSS -->|"generates"| GlobalsCSS
    GlobalsCSS -->|"delivers CSS"| Browser

    %% Build & tooling connections
    Server --> NextConfig
    Server --> JSConfig
    Server --> ESLint
    Server --> Package
    Server --> PackageLock

    %% Click Events
    click Layout "https://github.com/raullize/my-personal-portfolio/blob/main/app/layout.jsx"
    click Page "https://github.com/raullize/my-personal-portfolio/blob/main/app/page.jsx"
    click About "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/About.jsx"
    click CVDownload "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/CVDownload.jsx"
    click Contact "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/Contact.jsx"
    click Footer "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/Footer.jsx"
    click Header "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/Header.jsx"
    click LanguageToggle "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/LanguageToggle.jsx"
    click Projects "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/Projects.jsx"
    click Timeline "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/Timeline.jsx"
    click ClickSpark "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/ClickSpark.jsx"
    click ClientRootWrapper "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/ClientRootWrapper.jsx"
    click DecryptedText "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/DecryptedText.jsx"
    click FadeIn "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/FadeIn.jsx"
    click GradientText "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/GradientText.jsx"
    click LoadingScreen "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/LoadingScreen.jsx"
    click ProjectCard "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/ProjectCard.jsx"
    click ScrollToTop "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/ScrollToTop.jsx"
    click SmoothScroll "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/SmoothScroll.jsx"
    click Squares "https://github.com/raullize/my-personal-portfolio/blob/main/app/components/ui/Squares.jsx"
    click EN "https://github.com/raullize/my-personal-portfolio/blob/main/app/i18n/en.json"
    click PT "https://github.com/raullize/my-personal-portfolio/blob/main/app/i18n/pt.json"
    click UseTranslation "https://github.com/raullize/my-personal-portfolio/blob/main/app/i18n/useTranslation.js"
    click LanguageHook "https://github.com/raullize/my-personal-portfolio/blob/main/app/hooks/useLanguage.js"
    click TailwindCfg "https://github.com/raullize/my-personal-portfolio/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/raullize/my-personal-portfolio/blob/main/postcss.config.js"
    click GlobalsCSS "https://github.com/raullize/my-personal-portfolio/blob/main/app/globals.css"
    click CV_EN "https://github.com/raullize/my-personal-portfolio/blob/main/public/cv-raul-en.pdf"
    click CV_PT "https://github.com/raullize/my-personal-portfolio/blob/main/public/cv-raul-pt-br.pdf"
    click Icons "https://github.com/raullize/my-personal-portfolio/tree/main/public/icons/"
    click ProjectsAssets "https://github.com/raullize/my-personal-portfolio/tree/main/public/projects/"
    click NextConfig "https://github.com/raullize/my-personal-portfolio/blob/main/next.config.mjs"
    click JSConfig "https://github.com/raullize/my-personal-portfolio/blob/main/jsconfig.json"
    click ESLint "https://github.com/raullize/my-personal-portfolio/blob/main/eslint.config.mjs"
    click Package "https://github.com/raullize/my-personal-portfolio/blob/main/package.json"
    click PackageLock "https://github.com/raullize/my-personal-portfolio/blob/main/package-lock.json"

    %% Styles
    classDef server fill:#cfe2ff,stroke:#0d6efd,stroke-width:1px
    classDef page fill:#d1e7dd,stroke:#198754,stroke-width:1px
    classDef ui fill:#e2f0d9,stroke:#51cf66,stroke-width:1px
    classDef i18n fill:#fff3bf,stroke:#f59f00,stroke-width:1px
    classDef styling fill:#e5dbf3,stroke:#7950f2,stroke-width:1px
    classDef assets fill:#ffe5d9,stroke:#fd7e14,stroke-width:1px
    classDef tooling fill:#e9ecef,stroke:#adb5bd,stroke-width:1px
    classDef external fill:#f8f9fa,stroke:#6c757d,stroke-width:1px,stroke-dasharray: 5 5
```
