# eliascoca85/my-portfolio architecture

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

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

## Overview

##### Project type & purpose (from file tree + README)
This is a **Next.js (App Router) single-page portfolio-style web application** (no explicit backend service in the repo). Evidence:
- `src/app/` with `layout.js` + `page.js` → Next.js **App Router** structure.
- A set of UI sections/components: `hero.js`, `QuienSoy.js`, `habilidades.js`, `portafolio.js`, `contacto.js`, `nav.js`.
- One custom hook: `hooks/useResponsive.js`.
- Static assets under `public/` (e.g., `public/images`).
- No `src/app/api/*` routes, no database layer, no server folder → likely **static / SSR** site with client-side interactions only.

So the “system” is primarily: **Browser ⇄ Next.js runtime (Node/Vercel) → static assets**, plus build tooling.

##### Runtime / app structure
- `src/app/page.js`: the **root page** (likely composes the portfolio sections).
- `src/app/layout.js`: the **root layout** (wrapping HTML structure, global providers, fonts via `next/font`).
- `src/app/components/*`: **presentation components/sections**.
- `src/app/hooks/useResponsive.js`: **shared behavior** for responsive layout decisions.

##### Build/config/deploy
- `next.config.mjs` and `next.config.optimized.mjs`: app configuration (and an “optimized” variant) → show as “Build/Runtime Configuration”.
- `eslint.config.mjs`, `postcss.config.mjs`, `jsconfig.json`: dev/build tooling.
- `OPTIMIZACION.md`: hints there is an intentional optimization story (could affect bundling, images, config choices).
- README suggests typical Next dev server and likely **Vercel deployment**.

Architectural pattern: **component-composed UI** within a single Next.js app, with a small “shared hook” layer and global layout.

##### Client / User Agent
- Browser (Desktop/Mobile)
- Optional: “Viewport/Responsive constraints” (ties to `useResponsive`)

##### Next.js Application (App Router)
Inside this, explicitly decompose:
- **Root Route**: `/` → `src/app/page.js`
- **Root Layout**: `src/app/layout.js`
- `nav.js`
- `hero.js`
- `QuienSoy.js`
- `habilidades.js`
- `portafolio.js`
- `contacto.js`
- **Hooks / Shared Logic**
- `useResponsive.js`
- **Styling**
- `globals.css`

##### Static Assets
- `public/images/*` (and any other `public/*` content)
- Served as static files by Next/Vercel CDN

##### Build & Tooling (non-runtime but important
- Node.js build pipeline (`next build`)
- Config:
- `next.config.mjs`
- `next.config.optimized.mjs` (show as alternate config profile)
- `postcss.config.mjs`
- `eslint.config.mjs`
- Package manager / scripts (`package.json`)

##### Hosting/Delivery Platform
- Vercel (as suggested by README) or generic “Node hosting + CDN”
- CDN for static assets
- Server runtime for SSR (if used) / routing

##### External services (only if present in code)
From the tree/README, none are explicit. If `contacto.js` submits to an external email service (not visible here), you’d add it later after verifying code.

##### HTTP request flow
- Browser → Hosting Platform (Vercel)
- Hosting Platform → Next.js App Router
- Next.js returns HTML (SSR) or a static response (SSG) + JS bundles
- Browser fetches static assets:
- Browser → CDN/static hosting → `public/images/*`, CSS, JS chunks

##### In-app composition flow (important here)
- `layout.js` wraps `page.js`
- `page.js` composes the section components:
- `page.js` → `nav.js`, `hero.js`, `QuienSoy.js`, `habilidades.js`, `portafolio.js`, `contacto.js`
- Components that rely on responsive behavior:

##### Build/deploy flow
- Developer machine (npm scripts) → `next build`
- `next build` reads `next.config.mjs` (or optimized variant) → produces `.next/` output (not in tree but implied)
- CI/CD → Vercel deploy → CDN + runtime

##### Important architectural patterns/principles to highlight

- **App Router + Layout/Page model** (`src/app/layout.js`, `src/app/page.js`)
- **Component-based UI composition** (sections as components)
- **Shared hook for responsive logic** (`useResponsive.js`) as the “behavior reuse” layer
- **Static assets served from `public/`** (separate from JS bundle)
- **Build-time optimization** via Next.js + `next/font` (from README) and the existence of `next.config.optimized.mjs` / `OPTIMIZACION.md`

##### Labeling conventions (be explicit)
- “Root Page (`src/app/page.js`)"
- “Responsive Hook (`src/app/hooks/useResponsive.js`)"
- “HTTP GET /”
- “imports / composes”
- “loads static image”
- “build reads config”

##### Don’t overthink it: decompose aggressively
Even though it’s “just a Next app”, you get the most accurate architecture by separating:
- routing (`page.js`)
- shell (`layout.js`)
- each section component
- shared hook
- static assets
- build/config vs runtime

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% Client / User Agent
  %% =========================
  subgraph "Client"
    BROWSER["Browser (Desktop/Mobile)"]:::external
    VIEWPORT["Viewport / Responsive constraints"]:::external
    BROWSER -->|"renders_ui"| VIEWPORT
  end

  %% =========================
  %% Hosting / Delivery Platform
  %% =========================
  subgraph "Hosting & Delivery Platform"
    VERCEL["Hosting Platform (Vercel / Node hosting)"]:::platform
    EDGE["Edge/CDN (Static delivery)"]:::platform
    RUNTIME["Next.js Server Runtime (App Router)"]:::platform
    VERCEL -->|"routes_requests"| EDGE
    VERCEL -->|"invokes_ssr_or_static"| RUNTIME
  end

  %% =========================
  %% Next.js App Internals (App Router)
  %% =========================
  subgraph "Next.js Application (App Router)"
    ROUTE["Root Route: /"]:::runtime

    subgraph "Routing & Shell"
      LAYOUT["Root Layout (global shell)"]:::runtime
      PAGE["Root Page (portfolio composition)"]:::runtime
      CSS["Global Styles (globals.css)"]:::styles

      ROUTE -->|"resolves_to"| PAGE
      LAYOUT -->|"wraps"| PAGE
      LAYOUT -->|"imports_styles"| CSS
      PAGE -->|"imports_styles"| CSS
    end

    subgraph "UI Components / Sections"
      COMPONENTS_DIR["Components Directory"]:::group
      NAV["Navigation (nav)"]:::ui
      HERO["Hero Section (hero)"]:::ui
      QUIEN["QuienSoy Section"]:::ui
      HABS["Habilidades Section"]:::ui
      PORT["Portafolio Section"]:::ui
      CONT["Contacto Section"]:::ui

      COMPONENTS_DIR -->|"contains"| NAV
      COMPONENTS_DIR -->|"contains"| HERO
      COMPONENTS_DIR -->|"contains"| QUIEN
      COMPONENTS_DIR -->|"contains"| HABS
      COMPONENTS_DIR -->|"contains"| PORT
      COMPONENTS_DIR -->|"contains"| CONT
    end

    subgraph "Shared Logic"
      HOOKS_DIR["Hooks Directory"]:::group
      RESPONSIVE["useResponsive Hook"]:::logic
      HOOKS_DIR -->|"contains"| RESPONSIVE
    end

    %% Composition wiring
    PAGE -->|"composes"| NAV
    PAGE -->|"composes"| HERO
    PAGE -->|"composes"| QUIEN
    PAGE -->|"composes"| HABS
    PAGE -->|"composes"| PORT
    PAGE -->|"composes"| CONT

    %% Responsive deps (common usage)
    NAV -->|"uses"| RESPONSIVE
    HERO -->|"uses"| RESPONSIVE
  end

  %% =========================
  %% Static Assets
  %% =========================
  subgraph "Static Assets"
    PUBLIC_DIR["public/ (static root)"]:::storage
    IMAGES_DIR["public/images/ (static images)"]:::storage
    PUBLIC_DIR -->|"contains"| IMAGES_DIR
  end

  %% Runtime delivery flows
  BROWSER -->|"HTTP_GET_/_request"| VERCEL
  VERCEL -->|"response_html_js_css"| BROWSER
  BROWSER -->|"fetch_static_assets"| EDGE
  EDGE -->|"serves_public_assets"| BROWSER
  EDGE -->|"serves"| PUBLIC_DIR
  EDGE -->|"serves"| IMAGES_DIR

  %% Components reference images (conceptually)
  HERO -.->|"loads_images"| IMAGES_DIR
  PORT -.->|"loads_images"| IMAGES_DIR

  %% =========================
  %% Build / Tooling (Build-time)
  %% =========================
  subgraph "Build & Tooling (Build-time)"
    DEV["Developer / CI"]:::build
    PKG["package.json (scripts & deps)"]:::build
    NEXTBUILD["next build / next dev"]:::build

    subgraph "Configuration Profiles"
      NEXTCFG["next.config.mjs"]:::config
      NEXTCFGOPT["next.config.optimized.mjs (alternate profile)"]:::config
      OPTDOC["OPTIMIZACION.md"]:::doc
    end

    subgraph "Tooling Config"
      POSTCSS["postcss.config.mjs"]:::config
      ESLINT["eslint.config.mjs"]:::config
      JSCONFIG["jsconfig.json"]:::config
    end

    DEV -->|"runs"| NEXTBUILD
    NEXTBUILD -->|"reads"| PKG

    NEXTBUILD -.->|"reads_config"| NEXTCFG
    NEXTBUILD -.->|"reads_config"| NEXTCFGOPT
    NEXTBUILD -.->|"guided_by"| OPTDOC

    NEXTBUILD -.->|"processes_css_with"| POSTCSS
    NEXTBUILD -.->|"lint_rules"| ESLINT
    NEXTBUILD -.->|"module_paths"| JSCONFIG

    NEXTBUILD -->|"produces_build_output"| VERCEL
  end

  %% Render mode note
  NOTE["Note: Rendering mode is SSG/SSR depending on usage; no API routes present"]:::note
  RUNTIME --- NOTE

  %% =========================
  %% Click Events (from component mapping)
  %% =========================
  click PAGE "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/page.js"
  click LAYOUT "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/layout.js"
  click COMPONENTS_DIR "https://github.com/eliascoca85/my-portfolio/tree/main/src/app/components/"
  click NAV "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/components/nav.js"
  click HERO "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/components/hero.js"
  click QUIEN "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/components/QuienSoy.js"
  click HABS "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/components/habilidades.js"
  click PORT "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/components/portafolio.js"
  click CONT "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/components/contacto.js"
  click RESPONSIVE "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/hooks/useResponsive.js"
  click HOOKS_DIR "https://github.com/eliascoca85/my-portfolio/tree/main/src/app/hooks/"
  click CSS "https://github.com/eliascoca85/my-portfolio/blob/main/src/app/globals.css"
  click PUBLIC_DIR "https://github.com/eliascoca85/my-portfolio/tree/main/public/"
  click IMAGES_DIR "https://github.com/eliascoca85/my-portfolio/tree/main/public/images/"
  click NEXTCFG "https://github.com/eliascoca85/my-portfolio/blob/main/next.config.mjs"
  click NEXTCFGOPT "https://github.com/eliascoca85/my-portfolio/blob/main/next.config.optimized.mjs"
  click POSTCSS "https://github.com/eliascoca85/my-portfolio/blob/main/postcss.config.mjs"
  click ESLINT "https://github.com/eliascoca85/my-portfolio/blob/main/eslint.config.mjs"
  click JSCONFIG "https://github.com/eliascoca85/my-portfolio/blob/main/jsconfig.json"
  click PKG "https://github.com/eliascoca85/my-portfolio/blob/main/package.json"
  click OPTDOC "https://github.com/eliascoca85/my-portfolio/blob/main/OPTIMIZACION.md"

  %% =========================
  %% Styles
  %% =========================
  classDef external fill:#dbeafe,stroke:#1d4ed8,stroke-width:1.5px,color:#0b1b3a
  classDef platform fill:#bfdbfe,stroke:#1e40af,stroke-width:1.5px,color:#0b1b3a
  classDef runtime fill:#93c5fd,stroke:#1e3a8a,stroke-width:1.5px,color:#0b1b3a
  classDef ui fill:#bbf7d0,stroke:#166534,stroke-width:1.5px,color:#052e16
  classDef logic fill:#86efac,stroke:#15803d,stroke-width:1.5px,color:#052e16
  classDef styles fill:#fde68a,stroke:#92400e,stroke-width:1.5px,color:#3b2202
  classDef storage fill:#e5e7eb,stroke:#374151,stroke-width:1.5px,color:#111827
  classDef build fill:#fdba74,stroke:#9a3412,stroke-width:1.5px,color:#3b1406
  classDef config fill:#fecaca,stroke:#991b1b,stroke-width:1.5px,color:#3b0a0a
  classDef doc fill:#f5d0fe,stroke:#7e22ce,stroke-width:1.5px,color:#2e0a3b
  classDef group fill:#dcfce7,stroke:#166534,stroke-width:1.2px,color:#052e16
  classDef note fill:#fff7ed,stroke:#c2410c,stroke-width:1.2px,color:#431407,stroke-dasharray:4 3
```
