# alvaldes/portfolio-next architecture

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

- Interactive diagram: https://gitdiagram.com/alvaldes/portfolio-next
- Repository: https://github.com/alvaldes/portfolio-next

## Overview

##### Project type and purpose
- This is a full-stack, front-end-heavy web application built with Next.js 13’s App Router.
- It delivers a multi-language portfolio/interactive site featuring React components, 3D canvases (EarthCanvas, StarsCanvas), and static “works” pages.

##### File structure
- Top-level config & tooling:
- next.config.js, tsconfig.json, tailwind.config.ts, middleware.ts
- .eslintrc.json, .prettierrc, package.json
- app/ folder (Next.js App Router):
- Dynamic locale segment: app/[lang]/layout.tsx, providers.tsx
- Home page: app/[lang]/page.tsx
- Works listing & detail: app/[lang]/works/page.tsx & app/[lang]/works/[id]/page.tsx
- Shared UI: app/[lang]/components/… (Nav, Footer, Cards, Canvas loaders, etc.)
- lib/ + dictionaries/:
- lib/dictionary.ts loads JSON from dictionaries/en.json & dictionaries/es.json
- i18n.config.ts defines locale settings
- fonts.ts: next/font integration for Inter
- Styling: Tailwind via tailwind.config.ts & globals.css

##### README for additional insights
- Confirms it’s a create-next-app scaffold, using next/font, Tailwind, and intended for Vercel deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Side
    subgraph "Client Side"
        direction TB
        Browser["Browser"]:::client
        ClientComponents["Hydrated React Components"]:::client
        CanvasLayer["Canvas Modules"]:::client
        NavLayer["Navigation & UI Components"]:::client
    end

    %% Server Side
    subgraph "Server Side"
        direction TB
        NextServer["Next.js Server (Node.js)"]:::server
        Router["File-System Router"]:::server
        ServerComps["Server Components"]:::server
        DictionarySvc["Dictionary Service"]:::data
    end

    %% Data & Assets
    subgraph "Data & Assets"
        direction TB
        JSON["Translation JSON Files"]:::data
        Assets["Static Assets (images, 3D models)"]:::data
        Fonts["Font Integration"]:::data
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        Build["Next Build → .next"]:::infra
        Vercel["Vercel / CDN"]:::infra
    end

    %% Flow
    Browser -->|"HTTP Request"| NextServer
    NextServer --> Router
    Router --> ServerComps
    ServerComps --> DictionarySvc
    DictionarySvc --> JSON
    ServerComps --> Assets
    ServerComps --> Fonts
    ServerComps --> NextServer
    NextServer -->|"Pre-rendered HTML + JS"| Browser
    Browser --> ClientComponents
    ClientComponents --> CanvasLayer
    ClientComponents --> NavLayer
    Browser --> Assets
    Browser --> Fonts
    Build --> Vercel

    %% Subcomponents & Clicks for Router
    Router --> Layout["layout.tsx"] 
    Router --> Providers["providers.tsx"]
    Router --> Home["page.tsx"]
    Router --> WorksList["works/page.tsx"]
    Router --> WorksDetail["works/[id]/page.tsx"]
    Router --> NotFound["not-found.tsx"]
    click Layout "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/layout.tsx"
    click Providers "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/providers.tsx"
    click Home "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/page.tsx"
    click WorksList "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/works/page.tsx"
    click WorksDetail "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/works/[id]/page.tsx"
    click NotFound "https://github.com/alvaldes/portfolio-next/blob/main/app/not-found.tsx"

    %% Clicks for Canvas & UI
    CanvasLayer --> Earth["EarthCanvas.tsx"]
    CanvasLayer --> Stars["StarsCanvas.jsx"]
    CanvasLayer --> Loader["CanvasLoader.tsx"]
    click Earth "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/EarthCanvas.tsx"
    click Stars "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/StarsCanvas.jsx"
    click Loader "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/CanvasLoader.tsx"

    NavLayer --> Navbar["Nav/Navbar.tsx"]
    NavLayer --> LinkItem["Nav/LinkItem.tsx"]
    NavLayer --> ExternalLink["Nav/ExternalLinkItem.tsx"]
    NavLayer --> LangSwitch["Nav/LangSwitcher.tsx"]
    NavLayer --> ThemeSwitch["Nav/ThemeSwitcher.tsx"]
    NavLayer --> CardItem["CardItem.tsx"]
    NavLayer --> SectionTrans["SectionTransition.tsx"]
    NavLayer --> Footer["Footer.tsx"]
    NavLayer --> Socials["Socials.tsx"]
    NavLayer --> Stacks["Stacks.tsx"]
    NavLayer --> SendMsg["SendMsg.tsx"]
    NavLayer --> BuyCoffee["Buymeacoffee.tsx"]
    NavLayer --> GoToTop["GoToTop.tsx"]
    NavLayer --> Hint["InteractionHint.tsx"]
    NavLayer --> Logo["Logo.tsx"]
    click Navbar "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Nav/Navbar.tsx"
    click LinkItem "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Nav/LinkItem.tsx"
    click ExternalLink "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Nav/ExternalLinkItem.tsx"
    click LangSwitch "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Nav/LangSwitcher.tsx"
    click ThemeSwitch "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Nav/ThemeSwitcher.tsx"
    click CardItem "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/CardItem.tsx"
    click SectionTrans "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/SectionTransition.tsx"
    click Footer "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Footer.tsx"
    click Socials "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Socials.tsx"
    click Stacks "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Stacks.tsx"
    click SendMsg "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/SendMsg.tsx"
    click BuyCoffee "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Buymeacoffee.tsx"
    click GoToTop "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/GoToTop.tsx"
    click Hint "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/InteractionHint.tsx"
    click Logo "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/components/Logo.tsx"

    %% Dictionary & JSON
    click DictionarySvc "https://github.com/alvaldes/portfolio-next/blob/main/lib/dictionary.ts"
    click JSON "https://github.com/alvaldes/portfolio-next/blob/main/dictionaries/en.json"

    %% Assets & Fonts
    click Assets "https://github.com/alvaldes/portfolio-next/tree/main/public/images/"
    click Fonts "https://github.com/alvaldes/portfolio-next/blob/main/app/fonts.ts"

    %% Styles & Config
    click Build "https://github.com/alvaldes/portfolio-next/blob/main/tailwind.config.ts"
    click Build "https://github.com/alvaldes/portfolio-next/blob/main/app/[lang]/globals.css"

    %% Styles
    classDef server fill:#a3d5ff,stroke:#0288d1,stroke-width:1px
    classDef client fill:#d5f5a3,stroke:#558b2f,stroke-width:1px
    classDef data fill:#ffe0b2,stroke:#ef6c00,stroke-width:1px
    classDef infra fill:#e0e0e0,stroke:#9e9e9e,stroke-width:1px
```
