# deibyrayo/portfolio architecture

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

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

## Overview

##### Project Type and Purpose
- This is a single-page, component-driven portfolio web application built with Next.js (App Router), showcasing interactive 3D and canvas effects using Three.js and Framer Motion, styled via Tailwind CSS. It’s primarily a frontend-centric project with light server-side/static rendering responsibilities.

##### File Structure Analysis
- **app/** – Next.js 13 App Router directory. Contains server and client components:
- layout.tsx, globals.css, global-error.tsx – global wrappers and styling
- page.tsx – root landing page
- provider.tsx – context or state provider at app level
- **components/** – React UI building blocks, subdivided into:
- top-level UI (Hero, Footer, Grid, etc.)
- ui/ – low-level, reusable primitives (3d-pin, MagicButton, CanvasRevealEffect, Globe, etc.)
- **data/** – static JSON assets and index.ts exporting content (confetti.json, globe.json).
- **lib/** – utility functions (utils.ts).
- **public/** – static assets (images, fonts).
- **instrumentation.ts** + **sentry.*.config.ts** – application monitoring/tracing with Sentry.
- Config files – next.config.mjs, postcss.config.mjs, tailwind.config.ts, tsconfig.json.

##### Key Architectural Insights from README
- UI is assembled from independent React/Next.js components.
- Heavy use of Three.js for 3D, Framer Motion for animation.
- Styled with Tailwind; site supports server-side rendering (SSR) and static generation.
- No separate backend API—data is local/static.

##### Main Components
a. Browser (Client)
b. Next.js Application (Server-Side/Host)
- App Router (app/)
- Components Layer (components/, components/ui/)
- Data Layer (data/)
- Utility Layer (lib/)
- Monitoring (instrumentation.ts + Sentry configs)
c. Static Assets CDN (public/)
d. External Services
- Sentry (Error/Performance Monitoring)
- (Optional) Vercel or Hosting Provider for deployment

##### Relationships & Data Flow
- User → Browser: interacts with UI components (Hero, Grid, Footer, 3D Globe)
- Browser ↔ Next.js Server:
- Initial HTML (SSR/SSG) delivered
- Subsequent client hydration loads React, Three.js, Framer Motion bundles
- Static JSON data fetched from `/_next/static` or imported at build time
- Next.js Server ↔ CDN: serves static assets (images, fonts, confetti.json, globe.json)
- App ↔ Sentry: instrumentation.ts sends logs/metrics to Sentry endpoints

##### Architectural Patterns & Design Principles
- Component-Based Architecture: reusable building blocks under components/ui
- Feature-Based Grouping: grouping by feature (Hero, Approach, Experience)
- File-Based Routing via Next.js App Router
- Server/Client Components: Next.js 13 automatic segregation
- Static-First Approach: most data is static, reducing API complexity

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    Browser["Browser (Client)"]:::frontend
    CDN["Static Assets CDN\n(public/)"]:::static
    SentryService["Sentry\n(Error & Performance Monitoring)"]:::external
    Hosting["Hosting Provider\n(Vercel)"]:::external

    %% Next.js Application
    subgraph "Next.js Application" 
        direction TB
        AppRouter["App Router\n(app/)"]:::backend
        subgraph "│ Files" 
            direction TB
            Layout["layout.tsx"]:::backend
            Page["page.tsx"]:::backend
            Provider["provider.tsx"]:::backend
            GlobalError["global-error.tsx"]:::backend
            GlobalsCSS["globals.css"]:::backend
        end

        UIComponents["UI Components\n(components/)"]:::frontend
        subgraph "│ Feature Components" 
            direction TB
            Hero["Hero.tsx"]:::frontend
            Approach["Approach.tsx"]:::frontend
            Clients["Clients.tsx"]:::frontend
            Experience["Experience.tsx"]:::frontend
            GridComp["Grid.tsx"]:::frontend
            Recent["RecentProjects.tsx"]:::frontend
            Footer["Footer.tsx"]:::frontend
        end

        UIPRimitives["UI Primitives\n(components/ui/)"]:::frontend
        subgraph "│ Primitives" 
            direction TB
            Pin3D["3d-pin.tsx"]:::frontend
            Bento["BentoGrid.tsx"]:::frontend
            CanvasReveal["CanvasRevealEffect.tsx"]:::frontend
            NavFloat["FloatingNav.tsx"]:::frontend
            GlobeUI["Globe.tsx"]:::frontend
            Gradient["GradientBg.tsx"]:::frontend
            GridGlobe["GridGlobe.tsx"]:::frontend
            Cards["InfiniteMovingCards.tsx"]:::frontend
            MagicBtn["MagicButton.tsx"]:::frontend
            Borders["MovingBorders.tsx"]:::frontend
            Spotlight["Spotlight.tsx"]:::frontend
            TextGen["TextGenerateEffect.tsx"]:::frontend
        end

        DataLayer["Data Layer\n(data/)"]:::static
        subgraph "│ Data Files" 
            direction TB
            DataIndex["index.ts"]:::static
            Confetti["confetti.json"]:::static
            GlobeJSON["globe.json"]:::static
        end

        Utils["Utility Functions\n(lib/utils.ts)"]:::backend
        Monitoring["Monitoring & Instrumentation"]:::backend
        subgraph "│ Instrumentation" 
            direction TB
            Instr["instrumentation.ts"]:::backend
            SentryClient["sentry.client.config.ts"]:::backend
            SentryEdge["sentry.edge.config.ts"]:::backend
            SentryServer["sentry.server.config.ts"]:::backend
        end
    end

    %% Relationships
    Browser -->|"Page SSR / SSG"| AppRouter
    Browser -->|"Client Hydration\n(React, Three.js,\nFramer Motion)"| UIComponents
    AppRouter -->|"serves static assets"| CDN
    UIComponents -->|"uses primitives"| UIPRimitives
    AppRouter -->|"imports data at build"| DataLayer
    AppRouter -->|"calls utils"| Utils
    Monitoring -->|"sends logs/metrics"| SentryService
    AppRouter -->|"deployed on"| Hosting

    %% Click Events
    click AppRouter "https://github.com/deibyrayo/portfolio/tree/main/app/"
    click Layout "https://github.com/deibyrayo/portfolio/blob/main/app/layout.tsx"
    click Page "https://github.com/deibyrayo/portfolio/blob/main/app/page.tsx"
    click Provider "https://github.com/deibyrayo/portfolio/blob/main/app/provider.tsx"
    click GlobalError "https://github.com/deibyrayo/portfolio/blob/main/app/global-error.tsx"
    click GlobalsCSS "https://github.com/deibyrayo/portfolio/blob/main/app/globals.css"
    click UIComponents "https://github.com/deibyrayo/portfolio/tree/main/components/"
    click Hero "https://github.com/deibyrayo/portfolio/blob/main/components/Hero.tsx"
    click Approach "https://github.com/deibyrayo/portfolio/blob/main/components/Approach.tsx"
    click Clients "https://github.com/deibyrayo/portfolio/blob/main/components/Clients.tsx"
    click Experience "https://github.com/deibyrayo/portfolio/blob/main/components/Experience.tsx"
    click GridComp "https://github.com/deibyrayo/portfolio/blob/main/components/Grid.tsx"
    click Recent "https://github.com/deibyrayo/portfolio/blob/main/components/RecentProjects.tsx"
    click Footer "https://github.com/deibyrayo/portfolio/blob/main/components/Footer.tsx"
    click UIPRimitives "https://github.com/deibyrayo/portfolio/tree/main/components/ui/"
    click Pin3D "https://github.com/deibyrayo/portfolio/blob/main/components/ui/3d-pin.tsx"
    click Bento "https://github.com/deibyrayo/portfolio/blob/main/components/ui/BentoGrid.tsx"
    click CanvasReveal "https://github.com/deibyrayo/portfolio/blob/main/components/ui/CanvasRevealEffect.tsx"
    click NavFloat "https://github.com/deibyrayo/portfolio/blob/main/components/ui/FloatingNav.tsx"
    click GlobeUI "https://github.com/deibyrayo/portfolio/blob/main/components/ui/Globe.tsx"
    click Gradient "https://github.com/deibyrayo/portfolio/blob/main/components/ui/GradientBg.tsx"
    click GridGlobe "https://github.com/deibyrayo/portfolio/blob/main/components/ui/GridGlobe.tsx"
    click Cards "https://github.com/deibyrayo/portfolio/blob/main/components/ui/InfiniteMovingCards.tsx"
    click MagicBtn "https://github.com/deibyrayo/portfolio/blob/main/components/ui/MagicButton.tsx"
    click Borders "https://github.com/deibyrayo/portfolio/blob/main/components/ui/MovingBorders.tsx"
    click Spotlight "https://github.com/deibyrayo/portfolio/blob/main/components/ui/Spotlight.tsx"
    click TextGen "https://github.com/deibyrayo/portfolio/blob/main/components/ui/TextGenerateEffect.tsx"
    click DataLayer "https://github.com/deibyrayo/portfolio/tree/main/data/"
    click DataIndex "https://github.com/deibyrayo/portfolio/blob/main/data/index.ts"
    click Confetti "https://github.com/deibyrayo/portfolio/blob/main/data/confetti.json"
    click GlobeJSON "https://github.com/deibyrayo/portfolio/blob/main/data/globe.json"
    click Utils "https://github.com/deibyrayo/portfolio/blob/main/lib/utils.ts"
    click Instr "https://github.com/deibyrayo/portfolio/blob/main/instrumentation.ts"
    click SentryClient "https://github.com/deibyrayo/portfolio/blob/main/sentry.client.config.ts"
    click SentryEdge "https://github.com/deibyrayo/portfolio/blob/main/sentry.edge.config.ts"
    click SentryServer "https://github.com/deibyrayo/portfolio/blob/main/sentry.server.config.ts"
    click CDN "https://github.com/deibyrayo/portfolio/tree/main/public/"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6,stroke-width:1.5px
    classDef backend fill:#E8F0FE,stroke:#4176f5,color:#4176f5,stroke-width:1.5px
    classDef static fill:#E6FFEA,stroke:#28a745,color:#28a745,stroke-width:1.5px
    classDef external fill:#FFF4E5,stroke:#dd6b20,color:#dd6b20,stroke-width:1.5px
```
